Bayes' Theorem Visualizer

You tested positive. What are the real odds? Set the base rate and the test's accuracy, then watch 1,000 people answer the question. This is the math behind medical screening, spam filters, and security alerts, and it fools almost everyone.

100% in your browser. Every slider updates all 1,000 people instantly.
A screening test for a disease that 1 in 100 people have.
How common the condition really is before any test. Also called the prior or prevalence. This is the number intuition ignores.
Of the people who truly have it, how many the test catches. The "accuracy" number ads love to quote.
Of the healthy people, how many the test correctly clears. Everything below 100% becomes false alarms.
You got a positive result. The chance it's real:
9.2%
What most people guess (the test's accuracy)
90%
The actual chance you have it
9.2%
9 sick, caught 1 sick, missed 89 false alarms 901 correctly cleared
The false-positive paradox

About the Bayes' Theorem Visualizer

Here is the puzzle that famously stumps most people, including most doctors when researchers put it to them: a disease affects 1 in 100 people. The screening test catches 90% of real cases and correctly clears 91% of healthy people. You test positive. What is the chance you actually have the disease? Almost everyone says something near 90%. The real answer is about 9%.

This tool makes that answer impossible to disbelieve, because instead of a formula it shows you 1,000 people. Ten of them are sick, and the test catches 9. But 990 are healthy, and a 91% specificity means about 89 of them get a false alarm anyway. So the positive-result pile contains 9 real cases buried among 89 false ones. Your positive result is one ticket in that pile: about a 9% chance of being real. That reasoning is Bayes' theorem, and once you have seen it as a crowd of dots, the formula is just bookkeeping.

Experiments worth running

The formula, in crowd language

Bayes' theorem is usually written P(A|B) = P(B|A) × P(A) / P(B), which reads as a wall of symbols. In crowd language it is one sentence: out of everyone who got this evidence, what fraction are the real thing? The numerator counts the true positives. The denominator counts everyone holding a positive result, real or false. The tool prints this arithmetic under the grid with your live numbers plugged in, so you can check it by literally counting dots.

Where you meet this math

Medical screening decisions, courtroom arguments about forensic matches, spam filters deciding what you never see, fraud alerts on your credit card, and the calibration of every machine learning classifier. If you have used our ML Performance Metrics tool, the headline number here has a name you already know: precision. A model with great recall on a rare class and mediocre precision is this exact paradox wearing a lab coat.

Common questions

What is the false positive paradox?

When a condition is rare, the healthy majority is so large that even a small error rate produces more false alarms than real cases. A 90% accurate test for a 1-in-100 condition gives positives that are only about 9% likely to be real, and the 1,000-person grid makes that visible.

If I test positive on a 99% accurate test, do I have the condition?

Not necessarily, and often probably not. The answer depends on the base rate: how common the condition is among people like you. Set the sliders to your scenario and watch the grid count it out, then remember why doctors confirm positives with a second test.

What is Bayes' theorem in plain English?

Out of everyone who got this evidence, what fraction are the real thing? The numerator counts true positives, the denominator counts everyone holding a positive result, real or false. The tool prints this arithmetic with your live numbers so you can check it by counting dots.

What do sensitivity and specificity mean?

Sensitivity is how many real cases the test catches; specificity is how many healthy people it correctly clears. For rare conditions, specificity matters far more, because false alarms come from the huge healthy majority. Try improving each slider and watch which one moves the answer.

Who is this tool for?

Students meeting conditional probability, health professionals explaining results to patients, engineers who own alerting systems, and anyone who has ever gotten a scary screening result and wanted the honest math.

Related tools