Skip to main content
Calkulon

How to Calculate Bayes Theorem

What is Bayes Theorem?

Bayes' Theorem describes how to update the probability of a hypothesis given new evidence. Named after Rev. Thomas Bayes (1702–1761), it is the mathematical foundation of Bayesian statistics and is central to medical diagnosis, spam filtering, machine learning, and forensic science. The theorem shows why even a highly accurate test can produce mostly false positives when the disease is rare — this is the base rate fallacy.

Formula

P(B) = P(B|A)×P(A) + P(B|¬A)×P(¬A) — the total probability
P
P(B|A)×P(A) + P(B|¬A)×P(¬A) — the total probability — P(B|A)×P(A) + P(B|¬A)×P(¬A) — the total probability
B
P(B|A)×P(A) + P(B|¬A)×P(¬A) — the total probability — P(B|A)×P(A) + P(B|¬A)×P(¬A) — the total probability
A
posterior probability (after evidence) — posterior probability (after evidence)

Step-by-Step Guide

  1. 1P(A|B) = P(B|A) × P(A) / P(B)
  2. 2P(A) = prior probability (before evidence)
  3. 3P(B|A) = likelihood (probability of evidence given hypothesis)
  4. 4P(A|B) = posterior probability (after evidence)
  5. 5P(B) = P(B|A)×P(A) + P(B|¬A)×P(¬A) — the total probability

Worked Examples

Input
Disease prevalence 1%, test sensitivity 99%, specificity 95%
Result
P(disease | positive test) ≈ 16.7%
Despite 99% accuracy, only 1 in 6 positives are true positives
Input
Prevalence 10%, same test
Result
P(disease | positive) ≈ 68.8%
Higher base rate dramatically changes posterior

Frequently Asked Questions

What is Bayes Theorem?

Bayes' Theorem describes how to update the probability of a hypothesis given new evidence. Named after Rev

How accurate is the Bayes Theorem calculator?

The calculator uses the standard published formula for bayes theorem. Results are accurate to the precision of the inputs you provide. For financial, medical, or legal decisions, always verify with a qualified professional.

What units does the Bayes Theorem calculator use?

This calculator works with inches. You can enter values in the units shown — the calculator handles all conversions internally.

What formula does the Bayes Theorem calculator use?

The core formula is: P(A|B) = P(B|A) × P(A) / P(B). Each step in the calculation is shown so you can verify the result manually.

Ready to calculate? Try the free Bayes Theorem Calculator

Try it yourself →

Settings

PrivacyTermsAbout© 2026 Calkulon