Bayes Theorem Calculator

Calculate posterior probability using Bayes' theorem. Enter a prior probability, P(B|A), and P(B|not A) to get the updated probability after observing evidence.

Formula:
P(A|B) = P(B|A) × P(A) / (P(B|A) × P(A) + P(B|not A) × (1 − P(A)))

Result will appear here.
Metric Value

Privacy: calculations run locally in your browser. No inputs are stored or transmitted.

How it works

Bayes' theorem updates an initial probability after new evidence is observed. This is often used for medical tests, spam filters, diagnostics, and risk analysis.

A low prior probability can still produce a modest posterior even if the test sensitivity is high, especially when the false positive rate is not very small.

Examples

  • Prior: 1%
  • P(B|A): 95%
  • P(B|not A): 5%
  • Posterior P(A|B) is much higher than 1%, but still far below 95%.

FAQ

  • What does this Bayes theorem calculator compute?

    It computes the posterior probability P(A|B) using a prior probability, true positive probability P(B|A), and false positive probability P(B|not A).

  • What is the formula used?

    This page uses P(A|B) = P(B|A) × P(A) / (P(B|A) × P(A) + P(B|not A) × (1 − P(A))).

  • Can I enter percentages instead of decimals?

    Yes. You can enter values as percentages or decimals and switch the input mode.

  • What is posterior probability?

    Posterior probability is the updated probability of event A after observing evidence B.

  • Are calculations stored?

    No. Everything runs locally in your browser.

Related tools