No ads, no sign-upChecked 2026-08-24

Bayes' Theorem Calculator

Result

0.153846

Result: 0.153846
How the result moves

Bayes' theorem turns a belief held before the evidence into one held after it. The surprise is how much the prior weighs: with a 1 % prior, a test that catches 90 % of cases and cries wolf on 5 % leaves the posterior at 15 %, not at 90 %.

Worked examples

How it's calculated

P(A|B) = P(B|A)·P(A) ÷ [P(B|A)·P(A) + P(B|¬A)·(1 − P(A))]

  1. StepEnter the prior P(A) — how likely A is before any evidence.
  2. StepEnter P(B|A), the chance of seeing the evidence when A is true.
  3. StepEnter P(B|¬A), the chance of the same evidence when A is false.
  4. ResultRead the posterior P(A|B), the belief after the evidence.

What this number means

Bayes' theorem answers the question a test result raises but does not answer by itself: given a positive result, how likely is the condition? The calculator gets there by weighing two groups against each other. Take the values set here. A prior of 0.01 means one person in a hundred is affected; a likelihood of 0.9 means nine of every ten of those test positive. Out of ten thousand people that is 100 affected, 90 of whom test positive. The other 9,900 are unaffected, and a false-positive rate of 0.05 puts 495 of them in the positive column as well. The denominator of the formula is nothing more than the sum of those two streams — 90 + 495 = 585 positive results in all — and the posterior is the genuine share of them: 90 ÷ 585 = 0.153846. What the calculator never checks is where the prior came from. The theorem is an updating rule, not a source of belief: feed it a prior plucked from the air and it hands back a posterior of the same quality, neatly carried to six decimals. And it weighs exactly two hypotheses against exactly one piece of evidence. A third possibility, or a second test whose result is tied to the first, needs more than this page.

P(A|B) is not P(B|A)

A test that catches 90 % of cases gives you P(B|A). What a positive result is worth is P(A|B), and with a prior of 0.01 and a 5 % false-positive rate that is 0.153846.

The base rate carries most of the weight

When the prior is small, most positive evidence comes from the far larger group in which A is false. A prior of 0.001 with a 0.99 likelihood and a 0.01 false-positive rate still lands at 0.090164.

The prior decides what the evidence buys

With a prior of 0.01, a likelihood of 0.9 and 0.05 false positives give 0.153846. With a prior of 0.3, a likelihood of 0.95 and the same 0.05 give 0.890625.

A prior of 0 or 1 never moves

Zero times any likelihood stays zero, so no evidence brings back a hypothesis already ruled out. A prior of 1 stays 1 for the same reason.

Commonly misread

The test catches 90 % of cases, so a positive result makes me 90 % likely to have it.

Those are two different probabilities: 90 % is P(B|A), while the question asks for P(A|B). With a prior of 0.01 and 5 % false positives the answer is 0.153846.

With a good enough test the prior hardly matters.

It is usually the strongest lever. A prior of 0.001 with a 0.99 likelihood and 0.01 false positives gives 0.090164 — under ten percent, from an excellent test.

A posterior of 0.154 shows the test is unreliable.

The test is doing its job; the base rate is doing the rest. Most positive results come from the 99 % of cases in which A is false.

Reference table

Prior, P(B|A), P(B|¬A)SituationPosterior
0.01, 0.9, 0.05Rare condition, decent test0.153846
0.001, 0.99, 0.01Very rare, excellent test0.090164
0.1, 0.8, 0.2Uncommon, mediocre test0.307692
0.3, 0.95, 0.05Common, excellent test0.890625
0.5, 0.9, 0.1Coin-flip prior0.900000

Questions

How do I use Bayes' theorem?

Multiply the likelihood of the evidence given A by the prior of A, then divide by the total probability of that evidence. Enter the three probabilities as decimals between 0 and 1 and the calculator returns the posterior P(A|B).

What is the posterior probability?

The posterior P(A|B) is the probability of A after the evidence B has been observed. It updates the prior P(A) using how likely the evidence is when A is true versus when A is false.

Why is the posterior so low even with strong evidence?

That is the base-rate effect. When the prior is small, most of the positive evidence comes from the much larger group in which A is false, so even a high P(B|A) leaves the posterior modest. A prior of 0.01 with a likelihood of 0.9 and a false-positive rate of 0.05 gives about 0.154.

What inputs does the calculator need?

Three probabilities, each a decimal between 0 and 1: the prior P(A), the likelihood P(B|A) — the true-positive rate — and the likelihood P(B|¬A), the false-positive rate. The complement P(¬A) = 1 − P(A) is worked out for you.

When is there no answer at all?

Only when the evidence is impossible under both hypotheses, which makes the denominator zero and the posterior undefined. The calculator shows zero there, because an event that never occurs updates nothing.

Sources and last check

  1. en.wikipedia.org

Information, not professional advice.