# Bayes' Theorem Calculator

Free Bayes' theorem calculator. Calculate posterior probability from prior probability, sensitivity (true positive rate), and false positive rate.

## What this calculates

Calculate updated probabilities using Bayes' theorem. Enter the prior probability, the likelihood of evidence given the hypothesis, and the false positive rate to find the posterior probability.

## Inputs

- **Prior Probability P(A) (%)** — min 0.001, max 99.999 — The initial probability of event A before new evidence (e.g., disease prevalence).
- **P(B|A) - Sensitivity (%)** — min 0.001, max 100 — Probability of observing B given that A is true (e.g., true positive rate).
- **P(B|not A) - False Positive Rate (%)** — min 0, max 100 — Probability of observing B given that A is false (e.g., false positive rate).

## Outputs

- **P(A|B) - Posterior Probability** — formatted as percentage — The updated probability of A given that B is observed.
- **P(B) - Total Probability** — formatted as percentage — The total probability of observing B.
- **P(not A|B)** — formatted as percentage — Probability that A is false given that B is observed.
- **Likelihood Ratio** — P(B|A) / P(B|not A). How much B increases the odds of A.
- **Calculation** — formatted as text — Step-by-step Bayes' theorem calculation.

## Details

Bayes' theorem updates the probability of a hypothesis based on new evidence.

Formula:
P(A|B) = P(B|A) × P(A) / P(B)

Where:

- P(A|B) = posterior probability of A given B

- P(B|A) = likelihood of B given A (sensitivity)

- P(A) = prior probability of A

- P(B) = P(B|A)×P(A) + P(B|not A)×P(not A)

Classic Example:
A medical test has 95% sensitivity and 5% false positive rate. If a disease affects 1% of the population, a positive test result means only ~16% chance of actually having the disease. This is the base rate fallacy.

## Frequently Asked Questions

**Q: Why is the posterior probability often surprisingly low?**

A: This is the base rate fallacy. When the prior probability (base rate) is very low, even a highly accurate test produces many false positives relative to true positives. For a 1% prevalence disease with a 95% sensitive / 5% false positive test, only about 16% of positive results are true positives.

**Q: What is a likelihood ratio?**

A: The likelihood ratio is P(B|A) / P(B|not A). It measures how much more likely the evidence is under the hypothesis compared to the alternative. A ratio > 1 means the evidence supports the hypothesis; a ratio > 10 provides strong support.

**Q: Can I apply Bayes' theorem multiple times?**

A: Yes. The posterior probability from one application can become the prior for the next update. This is called Bayesian updating. Each new piece of independent evidence refines the probability. This is the foundation of Bayesian inference.

---

Source: https://vastcalc.com/calculators/statistics/bayes-theorem
Category: Statistics
Last updated: 2026-04-21
