Bayes' Theorem Calculator – Update Probability with New Evidence

Calculate a revised (posterior) probability using Bayes' theorem, given a prior probability, sensitivity, and false positive rate.

AI Quick Summary

Definition & Purpose:

This calculator applies Bayes' theorem to compute the revised probability of an event (like having a condition) after observing new evidence (like a positive test), given the event's prior probability, the test's sensitivity, and its false positive rate.

When to Use:

Use it whenever you need to update a probability estimate after new evidence comes in — most commonly interpreting a medical test result, but the same logic applies to any diagnostic or screening scenario.

Key Takeaway Insights:

  • For rare conditions, even a fairly accurate test can produce a posterior probability far lower than people intuitively expect — this is sometimes called the base rate fallacy.
  • The prior probability (how common the condition is before testing) matters just as much as the test's own accuracy in determining what a positive result actually means.
  • A 99%-accurate test on a 1%-prevalence condition still leaves most positive results as false positives, because there are simply far more people without the condition to draw false positives from.

Probability Inputs

Bayesian probability output

Posterior Probability P(A|B)16.667%Chance that event A is true given positive evidence B
Probability of Not A99.00%
Probability of Evidence P(B)5.94%
Share or Export Results

Introduction

Bayes' Theorem Calculator

Enter a prior probability, a test's sensitivity, and its false positive rate, and this calculator computes the revised (posterior) probability of the event given a positive result.

Formula

P(A|B) = [P(B|A) × P(A)] / P(B), where P(B) = P(B|A) × P(A) + P(B|not A) × P(not A).

For a condition with 1% prior probability, 99% sensitivity, and a 5% false positive rate: P(B) = (0.99 × 0.01) + (0.05 × 0.99) = 0.0594, and P(A|B) = 0.0099 / 0.0594 ≈ 16.67%. A positive result raises the probability from 1% to about 16.67% — well below what the test's 99% sensitivity alone might suggest.

Why a positive result isn't proof

A positive result can come from a true positive (correctly catching someone with the condition) or a false positive (incorrectly flagging someone without it). When a condition is rare, the pool of people without it is much larger, so even a small false positive rate can generate more false positives than true positives among all positive results — that's exactly what Bayes' theorem is calculating.

The base rate matters as much as the test

This is the base rate fallacy in action: judging a test purely by its accuracy while ignoring how common the condition actually is. A 99%-sensitive test sounds highly reliable, but paired with a 1% base rate, a positive result still only means about a 16.67% real chance of having the condition — the prior probability pulls the answer down substantially from what intuition might expect.

Formula & Variables Explained

P(A|B) = [P(B|A) x P(A)] / P(B), where P(B) = P(B|A) x P(A) + P(B|not A) x P(not A).

This tool utilizes standard equations formulated under standard rules.

Variables:

  • Input parameter: Values supplied to resolve the output formula.

How to Calculate (Step-by-Step)

  1. Input the required parameters into the form.
  2. Click the calculate or auto-compute option.
  3. The outputs will refresh instantly with step-by-step variables.

Worked Examples Calculation

11% prior, 99% sensitivity, 5% false positive rate

Inputs Given:

Prior probability P(A) = 1%, Sensitivity P(B|A) = 99%, False positive rate P(B|not A) = 5%

Step-by-Step Calculation:

P(not A) = 1 - 0.01 = 0.99. P(B) = (0.99 x 0.01) + (0.05 x 0.99) = 0.0099 + 0.0495 = 0.0594. P(A|B) = (0.99 x 0.01) / 0.0594 = 0.0099/0.0594 = 0.1667

Result Obtained:

P(A|B) = 16.67% — a positive result raises the probability from 1% to about 16.67%

Real-World Applications

Widely used in student curriculum, professional projections, and quick estimations.

Limitations & Common Mistakes

Caution & Mistakes:
  • Entering incompatible unit formats (e.g. Mixing Metric and Imperial).
  • Typographical mistakes in numeric entry fields.
Limitations:

The result is only as accurate as the three input probabilities you provide — real-world sensitivity, false positive rate, and especially prior probability (base rate) can be uncertain or context-dependent, and using rough estimates for them will produce a rough estimate here.

Frequently Asked Questions (FAQ)

Q:Why does a positive test result not mean you definitely have the condition?

Because a positive result can come from two sources: correctly detecting someone who actually has the condition (true positive), or incorrectly flagging someone who doesn't (false positive). When the condition is rare, there are far more people without it in the population, so even a small false positive rate applied to that much larger group can produce more false positives than true positives among all positive results — which is exactly what Bayes' theorem calculates.

Q:What is the base rate fallacy?

It's the common mistake of ignoring how rare or common something is beforehand (the base rate, or prior probability) and judging a positive test result only by the test's own accuracy. A 99%-accurate test sounds very reliable, but for a condition with only 1% prevalence, this example shows a positive result still only means about a 16.67% actual chance of having the condition — much lower than the test's accuracy alone would suggest.

Q:What's the difference between sensitivity and false positive rate?

Sensitivity (also called the true positive rate) is the probability the test correctly comes back positive when someone actually has the condition. False positive rate is the probability the test incorrectly comes back positive when someone does not have the condition. Both numbers matter to interpreting a result — a test can have high sensitivity but still produce mostly false positives among all its positive results if the condition is rare enough.

Q:Does a more sensitive test always give a more reliable positive result?

Not necessarily — sensitivity alone doesn't determine how trustworthy a positive result is. The false positive rate and, especially, the prior probability (how common the condition is) both play a major role. A highly sensitive test with even a modest false positive rate can still produce mostly false positives for a rare condition, which is why all three inputs matter together rather than any one in isolation.

Last Updated: 2026-08-09
Formula Verified
Written By

CalculationDesk Editorial Team

Content & Calculation Editors

The CalculationDesk Editorial Team consists of math educators, technical writers, and product specialists dedicated to ensuring accuracy and clarity for everyday calculations.

Reviewed By

CalculationDesk Review Team

Quality Assurance & Formula Verifiers

Our internal Review Team ensures that every calculator logic corresponds precisely to established academic standards and industry specifications.

Was this calculator helpful?

Embed this Calculator

You are welcome to embed this tool on your own blog or website. Simply copy the code snippet below and paste it into your HTML code.