Free calculator · runs in your browser

Bayes’ theorem calculator

A test is 90% accurate and you tested positive. How worried should you be? It depends on how common the thing is in the first place. Set the numbers and count the people.

% of people
%
%

Try an example

Teaching numbers only. Not medical advice.

Chance a positive result is right

9%

  • Has it, tests positive
  • Doesn’t have it, tests positive
  • Has it, test misses it
  • Doesn’t have it, tests negative
Positive results
Negative result is right
Get better with numbers, a few minutes a day The app covers the base rate fallacy, Bayesian updating, relative risk and more

Counting people instead of percentages

Most people asked this question guess something close to the test’s accuracy. With the default numbers (1 in 100 have the condition, the test catches 90% of cases, and 9% of healthy people get a false alarm) the real answer is about 1 in 11. Picture 1,000 people: 10 have the condition and 9 of them test positive. Of the 990 who don’t, about 89 also test positive. So 98 people hold a positive result and only 9 of them have the condition.

Psychologists Gerd Gigerenzer and Ulrich Hoffrage showed in 1995 that people get these problems right far more often when the numbers are given as counts like these (“natural frequencies”) rather than probabilities. That’s why the grid shows people.

The formula

Bayes’ theorem says: P(has it | positive) = sensitivity × base rate ÷ (sensitivity × base rate + false positive rate × (1 − base rate)). The calculator does exactly that. The step-by-step version, with everyday uses from spam filters to smoke alarms, is in our guide Bayes’ theorem explained.

Where the base rate fallacy shows up

Any time a fairly accurate signal hunts for something rare: fraud alerts on a credit card, a security scanner at an airport, a plagiarism checker, a rumor that “fits” someone. A good test of something rare still produces mostly false alarms. For headlines about risk, the relative vs absolute risk calculator is the companion tool.

Common questions

What does Bayes’ theorem calculate?

How much to believe something after new evidence comes in. Here: given how common a condition is (the base rate) and how accurate a test is, what’s the chance someone who tests positive really has it? In symbols, P(condition | positive) = P(positive | condition) × P(condition) ÷ P(positive).

Why is the answer so much lower than the test’s accuracy?

Because when a condition is rare, the few true positives are outnumbered by false positives from the much larger group who don’t have it. Ignoring how rare something is to begin with is called the base rate fallacy.

What are sensitivity and false positive rate?

Sensitivity is the share of people who have the condition that the test catches. The false positive rate is the share of people who don’t have it who still test positive (it equals 100% minus the specificity).

Can I use this for medical decisions?

No. The examples are made-up teaching numbers. Real tests have published figures that vary by group and setting, and what a result means for you is a question for a doctor.

Critical Thinking Concepts app icon

Make it stick.

Reading is a start. Critical Thinking Concepts brings each idea back as flashcards, audio and swipe cards until you know it cold. For iPhone and iPad, iOS 18.0 or later.

Download on the App Store