Math calculator

Bayes’ Theorem Calculator

What a positive result actually means, in percentages and in people.

What a positive result actually means

1 in 10,000, with a 99%/99% test. A positive is right 0.98% of the time.

Prior 0.0100%, sensitivity 99.00%, specificity 99.00%

P(H | positive) = 0.9804%

Among 100,000 tested: 9.9 true positives and 999.9 false ones.

P(H | positive)

0.9804%

the answer

P(H | negative)

0.000101%

after a negative result

True positives / 100k

9.9

False positives / 100k

999.9

Likelihood ratio +

99.0000

multiplies the prior odds

Likelihood ratio −

0.010101

after a negative

After two positives

49.5000%

if independent

After three

98.9800%

if independent

The answer most people give is 99.00% — the sensitivity — which overstates it by a factor of 101.0. That is base rate neglect, and it is not a lay error: Gigerenzer put the mammography version to practising physicians and most of them answered with the sensitivity too. The failure is in the format rather than the arithmetic. “80% sensitivity, 9.6% false positive rate, 1% prevalence” is hard to combine in your head; “of 1,000 women, 10 have it and 8 of those test positive, while 95 of the other 990 also test positive” is not. Which is why the counts are printed above the percentages here.
The likelihood ratio is 99.000, and it is the part of the test that does not depend on the prior. Posterior odds = prior odds × likelihood ratio. That factorisation is why a test can be described once and applied to any population: the likelihood ratio is a property of the test, the prior is a property of who is being tested, and only their product is a property of the result. A ratio of 99 sounds decisive and turns odds of 1:9,999 into 99:9,999 — still about 1 in 100.
There are more false positives than true ones here — 999.9 against 9.9 per 100,000. That is the general rule for screening a rare condition, and it is not a flaw in the test. The false positives are drawn from the enormous healthy population and the true positives from the tiny affected one, so even a very small false positive rate applied to a very large group outnumbers a very high detection rate applied to a small one. It is the argument for testing people with symptoms rather than everybody, and the reason a screening programme needs a confirmatory second test.
Two independent positives would give 49.5000% and three would give 98.9800%. Each positive multiplies the odds by the same likelihood ratio, which is why repeat testing works so well on paper. The word doing the work is independent, and it is usually false: the biological quirk, the lab handling or the cross-reacting antibody that produced the first false positive tends to produce the second. A genuinely different test — different mechanism, different failure mode — is what the arithmetic above assumes, and repeating the same one is not that.

What this tool shows

A 99% accurate test for a 1-in-10,000 condition is right 0.98% of the time. That sounds like a trick until you count: among 100,000 people there are 9.9 true positives and 999.9 false ones. The counts are printed above the percentages, because that is the format in which the base rate becomes impossible to ignore.

  • The posterior from a prior, a sensitivity and a specificity
  • True and false positives per 100,000 — the natural-frequency version
  • The probability after a NEGATIVE result, which is usually the reassuring one
  • Likelihood ratios, the part of a test independent of who is being tested
  • What two and three independent positives would give
  • The wrong answer named explicitly, because it is the one people give
Counts, not just rates Base rate neglect named Likelihood ratios Repeat testing

9.9 true positives against 999.9 false ones.

Updated 12 September 2026 · Works in any browser, no installation

Bayes’ theorem turns a test result into a belief. It combines how accurate the test is with how common the condition was to begin with — and the second half is the one people leave out, which is why a highly accurate test for a rare condition produces mostly false positives.

At a glance

Formula shown
P(H|E) = P(E|H)·P(H) / P(E), where P(E) = P(E|H)·P(H) + P(E|¬H)·P(¬H). With a prior p, sensitivity s and specificity t, the posterior after a positive is p·s / (p·s + (1 − p)(1 − t)). In odds form it is simpler: posterior odds = prior odds × likelihood ratio, where the likelihood ratio for a positive is s/(1 − t).
Scenario support
Medical test results, screening programmes, drug and security screening, spam filtering, fault diagnosis, legal evidence, and any situation where a test with a known error rate is applied to a population with a known base rate.
Educational estimate
Planning support from the values you enter — not professional advice.

Why a 99% accurate test is right 1% of the time

The sentence sounds contradictory and is not. Both numbers are correct and they answer different questions.

99% accurate answers: if you have it, does the test say so? What you want to know is the reverse: the test said so, do you have it? Those two conditional probabilities are not the same, and swapping them is the whole error.

Count 100,000 people with a 1-in-10,000 condition. Ten have it, and the test finds 9.9 of them. The other 99,990 do not, and 1% of those — 999.9 people — test positive anyway.

So among the 1,009.8 positives, 9.9 are real. That is 0.98%. No step in that calculation is subtle; it is arithmetic on counts, and the counts are what the tool prints first.

The false positives come from a much bigger pool. A small error rate applied to almost everybody outnumbers a high detection rate applied to almost nobody. That is the general rule for screening anything rare, and it is not a defect in the test.

The crossover is worth knowing. With a 99%/99% test the posterior reaches exactly 50% when the prevalence is exactly 1% — 990 true positives and 990 false ones. Below that, most positives are wrong; above it, most are right.

The format is the intervention

This is not a failure of intelligence and not confined to the public. It is a failure of presentation, and it has a documented fix.

Gigerenzer put the mammography version to practising physicians. 1% prevalence, 80% sensitivity, 9.6% false positive rate. Most of them answered with something near the sensitivity. The answer is 7.76%.

Restated as counts, the same people get it right. “Of 1,000 women, 10 have it and 8 of those test positive; of the other 990, about 95 also test positive.” 8 out of 103. The arithmetic is easier and the base rate cannot be dropped because it is sitting in the sentence.

Conditional probabilities hide the denominators. “80% sensitivity” does not say what it is 80% of, so the reader has nowhere to attach the prevalence. Natural frequencies carry the denominator with them.

Which is why this tool prints the counts above the percentages, rather than offering them as an optional extra below.

And why it names the wrong answer. The sensitivity is labelled as what most people say, next to the figure that is right. Naming the specific error is more useful than describing the category of error it belongs to.

The same reframing works far beyond medicine. Any risk communication — side effects, forensic match probabilities, model precision on an imbalanced class — becomes easier to reason about the moment it is stated as counts out of a fixed population.

The odds form, and why it is the useful one

The version with a denominator is the one everyone learns. The version without one is the one worth keeping.

Posterior odds = prior odds × likelihood ratio. No total probability term, no normalising, and the evidence enters as a single multiplier.

That factorisation separates the test from the population. The likelihood ratio, sensitivity/(1 − specificity), is a property of the test alone. The prior is a property of who is being tested. Only their product describes a particular result.

So a test can be characterised once and applied anywhere. A likelihood ratio of 99 means the same thing in a screening programme and in a specialist clinic; what changes is the prior it multiplies.

And it makes the magnitude legible. 99 sounds decisive. Applied to odds of 1:9,999 it gives 99:9,999 — about 1 in 100. The multiplier is large and the starting point was smaller.

Repeated independent evidence just multiplies again. Two positives multiply the prior odds by the likelihood ratio twice, which is why the tool can report the two- and three-positive figures without any additional machinery.

It also explains the negative result. The likelihood ratio for a negative is (1 − sensitivity)/specificity, and multiplying by a number below 1 drives the posterior down. A very small negative likelihood ratio is what makes a test good at ruling things out.

The negative result is usually the strong one

Screening tests get discussed in terms of their positives, and for a rare condition the negative is the result carrying most of the information.

On the rare-disease preset a negative leaves a probability of 0.000101%. Roughly one in a million, down from one in ten thousand. The test has reduced the risk by a factor of a hundred.

Which is the asymmetry base rates create. When something is rare, a negative confirms what was already likely and a positive fights a prior that was strongly against it. The same test does very different amounts of work in each direction.

Ruling out and ruling in are different jobs. High sensitivity makes a negative informative; high specificity makes a positive informative. A test optimised for one is not automatically good at the other, which is why screening and confirmatory tests are usually different tests.

That is also the design of a two-stage programme. Screen everyone with a sensitive test, then confirm the positives with a specific one. The second test faces a much higher prior — the positives from stage one — so its positives mean far more.

And it is why a negative can still be worrying. With a common condition and an imperfect test, a negative may leave a substantial probability. The tool prints that figure rather than leaving it to be inferred from the positive one.

Repeat testing, and the assumption it rests on

Two positives look conclusive. The arithmetic that makes them conclusive has one word in it doing most of the work.

Independent positives multiply the odds twice. On the rare-disease preset one positive gives 0.98%, two give 49.5% and three give 98.98%. Three tests turn near-certainty of a false alarm into near-certainty of a true one.

Independence is usually false for a repeated test. Whatever caused the first false positive — a cross-reacting antibody, a biological quirk, a handling error, a mislabelled sample — is still there for the second run, so the second result is not new evidence.

The figures above are therefore an upper bound. Real repeat testing does less than this, sometimes far less, and the tool says so rather than presenting the multiplication as what will happen.

A genuinely different test is what the arithmetic assumes. Different mechanism, different failure mode — an antigen test and a PCR, not the same assay twice. Confirmatory protocols specify a different method for exactly this reason.

The same trap appears wherever evidence is accumulated. Several forensic markers from one contaminated sample, several models trained on the same biased data, several witnesses who spoke to each other. Multiplying likelihood ratios assumes the pieces of evidence could have failed independently, and correlated evidence multiplied as if independent overstates the case badly.

Where the prior comes from

The theorem is arithmetic and the prior is a judgement, which is the whole of the argument that has run around Bayesian methods for two centuries.

Sometimes it is a known frequency. Population prevalence for a disease, base rates for a fault, spam share in a mail stream. Then the prior is data and nothing is contentious.

Often it is not. The probability that a hypothesis is true, that a defendant is guilty, that a new product will sell. There is no frequency to look up, and the number expresses a belief.

The right response is a sensitivity analysis, not a fight. Run the calculation across a plausible range of priors. If the conclusion holds throughout, the prior did not matter; if it flips, you have found the number the argument actually turns on — which is useful either way.

The prior should be the rate for the person in front of you. Population prevalence is the right prior for screening an unselected population and the wrong one for somebody with symptoms, a family history or an exposure. Those raise the prior, sometimes by orders of magnitude, and that is why the same positive result means different things in a clinic and in a screening van.

Evidence accumulates through it. Today’s posterior is tomorrow’s prior, which is the mechanism by which a sequence of weak signals becomes a strong conclusion — and the mechanism by which a bad starting point propagates if nothing ever contradicts it.

Sources and methodology

References for the theorem and for the presentation problem.

Method. The posterior is computed from the counts rather than from the ratio, so the true and false positives per 100,000 are the primary output and the percentage is derived from them — which is the presentation Gigerenzer’s work shows people can actually reason with. Likelihood ratios are reported for both directions, and repeated evidence is handled in odds form, where n independent positives multiply the prior odds by the likelihood ratio n times. The suite checks that the evidence term matches the law of total probability and that the odds form agrees with the direct posterior across 2,000 random parameter sets, that the posterior is monotone in the prior, and that a test whose sensitivity equals 1 − specificity leaves the prior exactly unchanged. It pins the presets: 0.98% and 9.9 against 999.9 per 100,000 for the rare disease, exactly 50% at 1% prevalence, and 7.764% for the mammography figures. That engine is verified on every change against 123 assertions. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

ProbabilityTwo events, repeated trials and Bayes, with the three usual errors handled — the dropped overlap in P(A or B), n×p instead of the complement, and the base rate that makes a 99% test 17% right.
Odds RatioOdds ratio, relative risk, risk difference and number needed to treat from one 2x2 table — because an odds ratio of 6.00 can describe a relative risk of 1.50.
Fisher's Exact TestThe exact p for a 2×2 table under all three two-sided conventions, because they disagree — 0.0406 against 0.0699 on the built-in table, across the 5% line — plus the test's actual size by enumeration, which is 2.30% at a nominal 5%.
Monty HallGeneralises the puzzle so the famous 100-door explanation stops hiding its own assumption — open one door instead of 98 and switching is worth 1.0102% against 1%, still right and barely.
Cohen's KappaKappa with the two figures that explain it: the maximum the marginals permit, and PABAK. Two built-in tables with identical 85% agreement give kappas of 0.6995 and 0.3219, and a third with 94.4% agreement gives −0.0234.
Expected ValueReports the spread, the chance of any gain and the single most likely outcome beside the average — because on a roulette number bet the expected value is −2.70% and the modal result is losing, 36 times in 37.

More in Math, or browse all calculators.

Educational use disclaimer

An educational tool and not medical advice. Results depend entirely on the prior, sensitivity and specificity supplied; published test accuracy figures vary by population and by laboratory, and repeated testing with the same method does not provide independent evidence.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (4 updates)

Published 12 September 2026

  1. Published a Bayes calculator that prints the COUNTS per 100,000 above the percentages, because the posterior alone does not make the answer believable. A 99% sensitive, 99% specific test for a condition affecting 1 in 10,000 returns a positive that is right 0.98% of the time — which sounds like a trick until you see 9.9 true positives against 999.9 false ones.
  2. The format is the intervention. Gigerenzer put the mammography version to practising physicians and most answered with the sensitivity; restated as natural frequencies the same people get it right. So the tool names that wrong answer explicitly — labelled as what most people say, beside the figure that is correct — rather than describing the category of error.
  3. Includes the preset where the arithmetic is cleanest: at exactly 1% prevalence a 99%/99% test gives exactly 50%, with 990 true positives and 990 false ones. Below that prevalence most positives are wrong and above it most are right.
  4. Reports likelihood ratios and handles repeated evidence in odds form, while stating that independence is usually false for a repeated test — whatever produced the first false positive is still there for the second — so the two- and three-positive figures are an upper bound rather than an expectation.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.