Bayes' Theorem

Posterior probability with a tree diagram

About this calculator

The Bayes' Theorem Calculator finds the posterior probability P(H|E) from a prior, a sensitivity (true-positive rate), and a false-positive rate. It draws a probability tree showing how the prior splits into the true-positive path P(H ∩ E) and the false-positive path P(¬H ∩ E), reports the total evidence P(E), and updates the belief in the hypothesis. A clear way to see the base-rate fallacy in medical screening, spam filters, and diagnostic testing.

How to use the Bayes' Theorem calculator

  1. Enter the values for your problem into the input fields.
  2. Read the result — it updates instantly as you type.
  3. Check the formula and the visual explanation to follow how the answer was found.
  4. Copy the page URL to share the exact calculation.

Common examples

  • Rare disease: prior 1%, sensitivity 99%, false-positive 5% → posterior P(H|E) ≈ 16.7%
  • Prior 0.1%, sensitivity 90%, false-positive 1% → posterior ≈ 8.26% despite the accurate test
  • Prior 50%, sensitivity 80%, false-positive 20% → posterior 0.8, marginal P(E) = 0.5
  • Same 50/80/20 setup with negative evidence → P(H|¬E) = 0.2

Frequently asked questions

How does the Bayes' Theorem calculator work?

Enter your values and the calculator applies the exact mathematical method for this problem, showing the result together with the formula it used. Everything is computed with high-precision arithmetic, so the answer you see is not limited by ordinary floating-point rounding.

When would I use the Bayes' Theorem calculator?

It is useful for homework and exam preparation, for checking work done by hand, and whenever a step in a larger problem needs this calculation done quickly and reliably.

How accurate are the results?

Calculations run at 30 significant digits of precision internally. Displayed values are rounded for readability, but the underlying result is far more precise than a typical hand or pocket-calculator computation.

Can I share a specific calculation with someone else?

Yes. Every value you enter updates the URL, so copying the address bar and sharing the link reopens the exact same calculation for whoever clicks it.