Statistics

Bayes Theorem Calculator

The inversion theorem: prior and test behaviour in, posterior out — with the natural-frequency tree (Gigerenzer) computed live, because 99% sensitivity is not 99% chance when the base rate is small.

Bayes Theorem Calculator

Results recalculate instantly on every keystroke. Nothing you type is transmitted.

Prior and evidence
Posterior P(H | E)
—
The natural-frequency tree, live—
The theorem with your numbers—
Reading the inversion—
Base rates are not decoration—

What this result does not account for

  • Binary hypothesis, single piece of evidence — chains run sequentially
  • Priors must be owned: the page cannot pick your base rate for you
● Zero-Server Execution Updated 11 Aug 2026 Reviewed by Sana Khalid IEEE-754 Double Precision

In short: A disease with 1% prevalence, a test that catches 99% of the sick (sensitivity) and false-alarms on 5% of the healthy: out of 10,000 people, 100 are sick and 99 test positive; 9,900 are healthy and 495 still test positive — 594 positives, of which 99 are true. P(sick | positive) = 99/594 = 0.166667. A “99% accurate” test delivers a one-in-six posterior, because the healthy outnumber the sick 99 to 1 and their false positives swamp the true ones. The tree card builds those counts live from your numbers; the theorem is just their ratio: prior × sensitivity over prior × sensitivity + (1 − prior) × false-positive rate.

Formula

P(H|E) = P(E|H)P(H) / [P(E|H)P(H) + P(E|¬H)P(¬H)]

The denominator is P(E) computed two ways and added up — the total evidence rate. When it hits zero (sensitivity and false-positive rate both 0), the evidence cannot occur under this model at all, and the page refuses rather than divide.

Worked Example

  1. Enter the base rate P(H) and the two evidence rates: P(E|H) and P(E|not H).
  2. Read the posterior and the tree that produced it — counts out of 10,000, computed live.
  3. Check the reading card: posterior versus prior, and how much the evidence moved you.
  4. Stress the false-positive rate: with rare conditions it dominates the denominator.

1% / 99% / 5%: tree counts 99 and 495 per 10,000, posterior 0.166667 (99 of 594 positives). At 95% / 5% sensitivity it is 0.161017 — the literature’s 16%. A useless test (sensitivity = false-positive rate) returns the prior unchanged.

Strengths & Limits Of This Model

Where this engine is strong

  • The frequency tree computed live — counts, not recited percentages
  • Refuses the impossible-evidence case (P(E) = 0) with the model failure named

Where it stops

  • No continuous priors or likelihood functions — the single-event form only
  • No decision thresholds (treat/no-treat economics out of scope)

Risk & accuracy notice. Bayes’ theorem is arithmetic; the prior is policy. The same clean computation can launder a self-serving base rate into an impressive posterior — the theorem guarantees coherence, not honesty. This page prints the prior on every card so the assumption travels with the answer, and the tree keeps the counts concrete enough to argue with.

Practical Use Cases

Medicine

screening positives, honest PPV

Security

alert triage with rare real threats

Teaching

the base-rate lesson, computed not recited

Methodology & Editorial Standards

Computation runs in IEEE-754 double precision at full internal precision; rounding to two decimal places occurs strictly at the display layer, so no cumulative drift enters the result. All monetary outputs use accounting presentation — grouped thousands, two decimals, negatives in parentheses — so figures can be transcribed directly into a model or working paper. Division-by-zero and out-of-domain inputs return an em-dash rather than a misleading number.

This engine was reconciled against an independent reference implementation and hand-verified for the worked example above before release. Our full five-stage review process is published on the About Us page.

Sana Khalid Principal Front-End Engineer · ApexConverter

Statistical inference, experiment design and numerical stability. Last reviewed: 11 August 2026.

Disclaimer. This calculator is provided for informational and modelling purposes only and does not constitute financial, tax, legal, medical, or engineering advice. Verify all figures with a qualified professional before acting on them.


Bayes Theorem Calculator — 8 Expert FAQs

8 analyst-written answers to the questions practitioners actually ask — optimised for voice and answer-engine retrieval.

Why isn’t a 99% test 99% convincing?

Because 99% describes the TEST’S behaviour in two separate worlds, not your situation after a positive. With 1% prevalence the healthy world is 99 times bigger, so its 5% false alarms (495 per 10,000) outnumber the caught sick (99) five to one. The posterior is 99/594 = 0.166667 — the tree card shows the counting that intuition skips.

What exactly is the prior doing?

Setting the size ratio of the two worlds before any evidence. The theorem cannot run without it: the same 99%/5% test gives posterior 0.166667 at prior 0.01 but 0.951923 at prior 0.5. An unmentioned prior is not objectivity — it is an unowned assumption.

What does it mean that the test is useless here?

When P(E|H) = P(E|not H), the evidence occurs at the same rate in both worlds, so observing it changes nothing: the posterior returns exactly the prior (try 0.3 / 0.4 / 0.4). That is the cleanest definition of uninformative evidence, and the reading card says so in those words.

Why natural frequencies instead of percentages?

Because people — including doctors — reason better with counts than with conditional percentages (Gigerenzer): 99 sick-and-positive against 495 healthy-and-positive out of a concrete 10,000 is checkable arithmetic, while “the posterior is P(H)P(E|H) over P(E)” is a recitation. The tree card prints the counts; the theorem card shows the same numbers as ratios.

The posterior jumped ABOVE the sensitivity — how?

Direction is not bounded by either evidence rate: the posterior weighs the two worlds’ sizes and their evidence rates together. With a strong prior and a low false-positive rate the posterior can exceed both conditionals. What it can never escape is [0, 1] and monotonicity: better evidence or a higher prior moves it up, never down.

What if the evidence is impossible?

If P(E|H) and P(E|not H) are both 0, the denominator P(E) is 0: the model says this evidence cannot occur at all, so observing it refutes the model, not the hypothesis. The page refuses the division and says exactly that — a 0 denominator is a broken model, not a small posterior.

Can I chain several pieces of evidence?

Sequentially: yesterday’s posterior is today’s prior. Run this page with the posterior you just got and the next test’s rates. Two independent 99%/5% reads in a row lift 0.166667 to about 0.798387 — evidence compounds, which is why confirmatory testing works.

Where does the probability-algebra page fit?

It runs the union and intersection rules FORWARD from P(A), P(B) and their overlap; this page runs the INVERSE conditioning — from the evidence rates back to P(H|E). Same axioms, opposite direction, and the two cross-link: Bayes is the probability page’s addition rule read backwards through the conditionals.

Related Statistics Engines