InputTestHub

Bayes Theorem Calculator

Works out what a positive test result actually means, from the base rate, sensitivity and specificity, with the counting shown.

Calculators Nothing uploaded No sign-up Free, unlimited
Calculators tool
How common the condition is in the group being tested. This is the term people leave out.
Of people who HAVE it, the share the test catches.
Of people who do NOT have it, the share the test correctly clears.
Enter your figures and press Calculate.
In short A test that is 99% sensitive and 99% specific, applied to a condition that affects 1 person in 1,000, gives a positive result that is right only 9.02% of the time. That is not a trick and the test is not bad — it is what the counting says, and it is the most consequential misunderstanding in probability. Out of 100,000 people, 100 have the condition and the test finds 99 of them. The other 99,900 do not have it, and 1% of those — 999 people — are wrongly flagged. So 1,098 people test positive and only 99 of them are actually affected. The healthy group is a thousand times larger, so even a small false-positive rate produces ten times more false alarms than real cases. The base rate is not a detail; when the condition is rare, it dominates the answer completely. Two consequences follow. Sensitivity and specificity are properties of the TEST, but the predictive value is not — it depends on who is being tested, which is why screening a whole population and testing someone with symptoms give very different answers from the same kit. And a negative result is far more informative than a positive one here: 99.999% of people testing negative are genuinely clear. This page prints the whole calculation as counts out of 100,000, because the arithmetic is convincing in a way the formula is not.

How to use the Bayes Theorem Calculator

  1. Enter your figures in the input fields.
  2. The result updates as you type, together with the full working.
  3. Check the breakdown table to see exactly how the number was reached.

About the Bayes Theorem Calculator

What a positive result really means, given how common the condition is.

What people use it for

  • Reading a medical screening result properly.
  • Understanding why rare-disease tests produce so many false alarms.
  • Probability coursework on conditional probability.

Details

0.1% base rate, 99/99 testa positive means 9.02%
True positives per 100,00099
False positives per 100,000999
Same test on a 10% base ratea positive means 91.67%
A negative result99.9990% genuinely clear

The maths behind it

This tool uses P(condition | positive) = sensitivity × base rate ÷ (sensitivity × base rate + (1 − specificity) × (1 − base rate)). Every intermediate value is shown on screen, so the result can be checked by hand.

The table shows how the same test performs across base rates from 0.1% to 50%. Nothing about the test changes down that column — only who is being tested — and the answer moves from under 10% to over 99%.

Where this tool stops

This assumes the test result is the only evidence and that sensitivity and specificity are known exactly. In practice both are estimated with their own uncertainty, and a doctor testing someone with symptoms is already working from a much higher base rate than a screening programme.

Frequently asked questions

How can a 99% accurate test be wrong most of the time?
Because "99% accurate" describes how it behaves on each group, and the healthy group is vastly larger. One per cent of a very large number beats 99% of a very small one, so most positives come from the healthy majority.
What is the difference between sensitivity and predictive value?
Sensitivity is a property of the test: of people who have it, how many are caught. Predictive value is about you: given a positive, how likely you are to have it. The second depends on the base rate and the first does not.
Why do doctors retest after a positive?
Because a second independent positive multiplies the evidence. Running the numbers again with the first result as the new base rate is exactly what Bayes says to do, and it moves the answer enormously.
Does this apply outside medicine?
Yes — to spam filters, fraud detection, security screening and any rare-event alarm. Whenever what you are looking for is rare, most alerts will be false however good the detector is.
Is there a limit on how often I can use the Bayes Theorem Calculator?
Free, unlimited, and no email address required. You can use it a hundred times a day and nothing changes.
Does anything I enter leave my computer?
No. The Bayes Theorem Calculator runs entirely in your browser using JavaScript. Nothing is transmitted, logged or stored, which you can verify yourself in the Network tab of your browser's developer tools.
How is the result calculated?
It uses P(condition | positive) = sensitivity × base rate ÷ (sensitivity × base rate + (1 − specificity) × (1 − base rate)). The full working is printed under the result, so you can follow every step rather than trusting a black box.
What do I get if I try it?
Enter 0.1% base rate, 99% / 99% test and the Bayes Theorem Calculator returns a positive means 9.02%.
What problem does the Bayes Theorem Calculator solve?
The jobs it is built for: reading a medical screening result properly. Understanding why rare-disease tests produce so many false alarms. Probability coursework on conditional probability. It is built for exactly those cases rather than being a general-purpose tool with this bolted on.
When is the Bayes Theorem Calculator not the right tool?
This assumes the test result is the only evidence and that sensitivity and specificity are known exactly. In practice both are estimated with their own uncertainty, and a doctor testing someone with symptoms is already working from a much higher base rate than a screening programme. Knowing where a tool stops being trustworthy matters more than the cases where it works.
Which values should I know?
0.1% base rate, 99/99 test is a positive means 9.02%. True positives per 100,000 is 99. False positives per 100,000 is 999. These are printed on the page itself, so you do not have to take them on trust.
Can I rely on this for exact work?
The calculation runs in double precision and the result is shown to ten significant figures, so converting a value and converting it back returns the original. What is displayed is rounded for readability; what is copied is not.

Related calculators tools

All 382
01

Loan Calculator

Works out the monthly payment, total interest and full repayment schedule for any loan from…

02

EMI Calculator

Calculates your Equated Monthly Instalment with a full principal-versus-interest breakdown and…

03

Mortgage Calculator

Estimates a full monthly housing payment including principal, interest, property tax…

04

Car Loan Calculator

Calculates a car finance payment from the price, deposit, trade-in, interest rate and term…

05

Personal Loan Calculator

Works out instalments and total cost for an unsecured personal loan, including any processing…

09

SIP Calculator

Projects the maturity value of a monthly Systematic Investment Plan, showing invested amount…