Bayesian Probability Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

Why use a Bayesian probability calculator?

Bayes’ theorem is a standard way to update a belief (a hypothesis) after you observe some new evidence. Instead of treating probability as fixed, Bayesian updating treats it as something you revise as information arrives. This is useful in everyday “is it true?” questions (spam filtering, A/B testing, fraud detection) and in high-stakes settings (medical testing, quality control, risk assessment).

This calculator implements the classic binary form of Bayes’ theorem: a hypothesis is either true (H) or not true (¬H), and the evidence E is either observed (for example, a “positive” test) or not. You provide three inputs—the prior probability of the hypothesis, the likelihood of the evidence if the hypothesis is true, and the likelihood of the evidence if the hypothesis is false—and the calculator returns the posterior probability of the hypothesis after seeing the evidence.

What the inputs mean (plain language)

Tip: Many users accidentally enter specificity into “Likelihood if False.” If you have specificity instead, convert it first: false positive rate = 100% − specificity.

The formula (Bayes’ theorem)

In symbols, the posterior probability is:

P(H|E) = P(E|H) P(H) P(E|H) P(H) + P(E|¬H) P(¬H)

Where P(¬H) = 1 − P(H). The denominator is a “normalizing” term that makes sure the result is between 0 and 1. It is also the overall probability of seeing the evidence:

P(E) = P(E|H)P(H) + P(E|¬H)P(¬H)

Interpreting the result

The output P(H|E) is the probability that the hypothesis is true given that you observed the evidence. If the result is higher than your prior, the evidence supports the hypothesis. If it’s lower than your prior, the evidence argues against it.

Two common interpretation pitfalls:

Worked example (medical test)

Suppose a disease affects 1% of the population. A test returns positive 95% of the time when the disease is present, and returns positive 10% of the time when the disease is absent.

Compute:

P(H|E) = (0.95×0.01) / (0.95×0.01 + 0.10×0.99) ≈ 0.0876

So even after a positive test, the chance the patient truly has the disease is about 8.8%. The test is fairly sensitive, but the disease is rare and false positives accumulate among the many healthy people.

Quick comparison table (how inputs affect the posterior)

Scenario Prior P(H) P(E|H) P(E|¬H) Posterior P(H|E) What changed?
Baseline example 1% 95% 10% ≈ 8.8% Rare condition limits posterior
Higher prior 10% 95% 10% ≈ 51.3% More plausible upfront → higher posterior
Lower false positives 1% 95% 1% ≈ 49.0% Better specificity (lower FPR) boosts posterior
Weaker evidence 1% 60% 10% ≈ 5.7% Evidence less diagnostic

Assumptions and limitations

Reference note

Bayes’ theorem is a standard identity in probability theory relating conditional probabilities: P(H|E) and P(E|H). Terminology like sensitivity/specificity is common in diagnostic testing and maps directly to the likelihood inputs above.

Fill in the probabilities to see the updated chance.

Embed this calculator

Copy and paste the HTML below to add the Bayesian Probability Calculator - Update Beliefs with Evidence to your website.