Bayes' Theorem Calculator

Update the probability of a hypothesis after observing new evidence. Provide the prior belief, likelihood of the evidence if the hypothesis is true, and the false alarm rate if the hypothesis is false.

Your belief in the hypothesis before seeing the evidence.

Chance of observing the evidence if the hypothesis is true.

Chance of observing the evidence if the hypothesis is false.

Tip: Enter probabilities as decimals between 0 and 1. For example, 5% = 0.05.

Posterior P(H | E)

15.38%

Updated belief after evidence

Evidence Probability P(E)

5.85%

Total chance of observing the evidence

Posterior Complement P(¬H | E)

84.62%

Remaining probability hypothesis is false

QuantityValueMeaning
Prior P(H)1.00%Initial belief before evidence
Prior Complement P(¬H)99.00%Chance the hypothesis is false initially
Likelihood P(E | H)90.00%Probability of evidence if the hypothesis is true
False Alarm Rate P(E | ¬H)5.00%Probability of evidence if the hypothesis is false
Evidence Probability P(E)5.85%Total probability of observing the evidence
Posterior P(H | E)15.38%Updated belief after observing the evidence

How to Use This Calculator

1

Estimate the prior

Determine your baseline belief in the hypothesis before any new evidence is observed.

2

Measure test accuracy

Enter the chance of seeing the evidence if the hypothesis is true and if it is false.

3

Run the update

The calculator combines your inputs to compute the posterior probability using Bayes’ theorem.

4

Interpret the result

Compare the posterior to your decision thresholds to decide whether the evidence changes your conclusion.

Formula

P(H | E) = [P(E | H) · P(H)] / [P(E | H) · P(H) + P(E | ¬H) · P(¬H)]
  • P(H) — Prior probability that the hypothesis is true.
  • P(E | H) — Likelihood: probability of the evidence when the hypothesis holds.
  • P(E | ¬H) — False alarm rate: evidence occurring when the hypothesis is false.
  • P(E) — Total probability of the evidence across both scenarios.
  • P(H | E) — Posterior probability after incorporating the evidence.

Full Description

Bayes’ theorem provides a principled way to revise beliefs when new data arrives. By multiplying your prior belief with how compatible the evidence is with the hypothesis, and normalizing by the overall probability of the evidence, you obtain a posterior probability that reflects both sources of information. This approach underlies medical diagnostics, email spam filters, forensic analysis, and many machine learning algorithms.

Use this calculator when you know the sensitivity (true positive rate) and the false positive rate of a test. Even highly accurate tests can produce counterintuitive results if the prior probability is very small, so Bayes’ theorem helps you interpret the outcome correctly. Experiment with different priors and error rates to see how much each component influences the posterior.

Frequently Asked Questions

Why does the posterior remain low for rare events?

When the prior probability is tiny, even strong evidence may not raise the posterior very high because false positives can dominate the total evidence. This is common in medical screening for rare diseases.

Can I enter percentages instead of decimals?

Convert percentages to decimals before entering values (divide by 100). For example, 72% becomes 0.72. The calculator requires decimals to avoid ambiguity.

What if I only know sensitivity and specificity?

Sensitivity corresponds to P(E | H) and specificity equals 1 − P(E | ¬H). Subtract the specificity from 1 to obtain the false alarm rate used as P(E | ¬H).

How do I compute the likelihood ratio?

The likelihood ratio is P(E | H) ÷ P(E | ¬H). Multiply your prior odds by this ratio to obtain posterior odds, which is equivalent to the probability approach used here.