Loona Calculators
Loona Calculators › Math › Bayes Theorem Calculator

🔄 Bayes Theorem Calculator

Enter three numbers — how common the condition is (prior), how often the evidence appears when the condition is present (sensitivity), and how often it appears when it is not (false-positive rate) — and Bayes' theorem returns the updated probability.

Quick answer: Posterior = (prior × sensitivity) ÷ (prior × sensitivity + (1 − prior) × false-positive rate). The famous example: a disease affecting 1 in 100, a test 99% sensitive with 5% false positives — a positive result still means only about a 16.7% chance of disease.

How to use the Bayes Theorem Calculator

  1. Enter the prior probability P(A) — how likely the condition was before the evidence.
  2. Enter P(evidence | A) — the true-positive rate / sensitivity.
  3. Enter P(evidence | not A) — the false-positive rate.
  4. Read the posterior P(A | evidence) and the full breakdown.
Example: Screening 10,000 people for a 1% condition: 100 have it and 99 test positive; 9,900 do not and 495 falsely test positive. Of 594 positives, only 99 are real: 99 ÷ 594 = 16.7%.

Frequently Asked Questions

Why is the answer so much lower than 'the test is 99% accurate'?

Because the condition is rare. False positives from the huge healthy group (9,900 × 5% = 495) swamp the true positives from the tiny sick group (100 × 99% = 99). Base rates dominate — that is the whole lesson of Bayes' theorem.

What do prior and posterior mean?

The prior is your belief before the new evidence; the posterior is the updated belief after weighing the evidence by how expected it is under each possibility. Bayes' theorem is the exact arithmetic of that update.

Can I use it beyond medical tests?

Yes — spam filters, fault diagnosis, forensic likelihoods and forecasting all use the same structure: a base rate, a hit rate and a false-alarm rate.

What if I only know the overall evidence rate P(B)?

The classic form P(A|B) = P(B|A) × P(A) ÷ P(B) needs P(B) directly; this calculator builds P(B) from the two conditional rates instead, which is how the inputs are usually known in practice.

Related Calculators

%

Percentage Calculator

Math

📊

Statistics Calculator

Math

½

Fraction Calculator

Math

🧮

Equation Solver

Math

🔬

Scientific Calculator

Math

📐

Average Calculator

Math

🔔

Z-Score Calculator

Math

🎲

Probability Calculator

Math

How it works — the formula

P(A | B) = P(B | A) × P(A) ÷ P(B), with the total evidence rate built by the law of total probability: P(B) = P(B | A) × P(A) + P(B | not A) × P(not A). Substituting gives the three-input form this calculator uses.

Worked example

Inputs: prior 0.01, sensitivity 0.99, false-positive rate 0.05.

Steps: P(B) = 0.99 × 0.01 + 0.05 × 0.99 = 0.0099 + 0.0495 = 0.0594. Posterior = 0.0099 ÷ 0.0594 = 0.1667.

Result: P(A | positive) = 16.67% — despite a '99% accurate' test, because the condition is rare.

Embed this calculator on your website — free

Add this calculator to your own website or blog — it is completely free, needs no sign-up, and always shows the latest version. Copy the code below and paste it into your page where you want the calculator to appear. Keeping the small “Powered by Loona Automation” credit line under the embed helps keep this tool free — but you are free to style or remove it; the tool works either way.