All free tools

Bayes' theorem calculator

Find the probability of an event after positive evidence. Enter three percentages to see your result.

Enter percentages

Example values shown. Results update as you type.

Chance the event is true before seeing the evidence.

Chance of positive evidence when the event is true.

Chance of positive evidence when the event is false.

Posterior probability

Chance the event is true after positive evidence.

15.38%

How this is calculated

Posterior = (prior × true positive rate) ÷ [(prior × true positive rate) + ((1 − prior) × false positive rate)].

In 10,000 hypothetical cases, these rates imply about 90 true positives and 495 false positives. Of 585 positive results, only the true positives count toward the posterior.

  1. Find the probability of a true positive.1% × 90% = 0.9%
  2. Find the probability of a false positive.99% × 5% = 4.95%
  3. Divide true positives by all positive evidence.0.9% ÷ 5.85% = 15.38%

These rates describe a single positive observation and must refer to the same event and population. The result depends on the probabilities you enter; it does not estimate those probabilities from data. Rates are rounded for display; the calculation uses full precision.

Source: MIT OpenCourseWare · Conditional probability and Bayes' theorem

How to use this calculator

  1. Enter the prior probability: how likely the event is before you see the evidence.
  2. Enter the true positive and false positive rates for the same event and population. Use percentages, from 0 to 100.
  3. Read the posterior probability after positive evidence. Expand the calculation to check the working.

Example: a rare event and a positive signal

Use Reset example to reproduce these inputs.

Prior probability
1%
True positive rate
90%
False positive rate
5%

Posterior probability: 15.38%

In 10,000 hypothetical cases, these rates imply 90 true positives and 495 false positives. The posterior is 90 ÷ (90 + 495), about 15.38%. Positive evidence raises the probability from 1%, but the many false positives still matter.

Frequently asked questions

How do I choose the prior probability?

Use the probability of the event before observing this evidence. A relevant population frequency can help, provided it describes the population you are evaluating. If the prior is uncertain, try more than one plausible value and compare the results.

Why is the posterior 15.38% when the true positive rate is 90%?

The true positive rate asks how often the evidence is positive when the event is true. The posterior asks how often the event is true among all positive results. In the example, the event is rare and false positives outnumber true positives, so these two probabilities differ.

Should I enter percentages or decimal probabilities?

Enter percentages: use 25 for 25%, or 1 for 1%. Entering 0.25 means 0.25%, not 25%. The calculator converts percentages to probabilities before applying Bayes’ theorem.

Why do some inputs produce no result?

The posterior is undefined when the inputs assign zero probability to positive evidence. For example, a 0% prior together with a 0% false positive rate makes a positive observation impossible under the model. Adjust the assumptions instead of treating the undefined result as 0% or 100%.

Want to understand the calculation?

Practise Bayes in Python