Probability Calculators

Bayes' Theorem Calculator

Update a two-event probability using a base rate and likelihoods. Check compatibility and reproduce a hypothetical file-classification example.

Jump to calculator ↓Help me choose a test

Initial probability of A before evidence

Probability of B given A is true

Overall probability of observing B

Bayes' Theorem

P(A|B) = P(B|A) × P(A) / P(B)

P(A):

Prior probability (before evidence)

P(A|B):

Posterior probability (after evidence)

P(B|A):

Likelihood (evidence given hypothesis)

P(B):

Marginal likelihood (total probability)

Supply compatible event probabilities

Simple mode uses P(A), P(B|A) and a positive P(B). Full mode uses P(A), P(B|A) and P(B|Aᶜ), then computes P(B) by total probability. All inputs must describe the same target population and event definitions.

The result is P(A|B)=P(B|A)P(A)/P(B). Simple-mode inputs must be jointly compatible, not just individually between 0 and 1: P(B) must include the joint event P(B|A)P(A) and cannot exceed that contribution plus P(Aᶜ).

Reproduce the hypothetical file example

Select the file-checker example. Assume 1% of files are problematic, 90% of problematic files are flagged, and 5% of other files are flagged. The total flag probability is 0.90×0.01+0.05×0.99=0.0585. The problematic probability given a flag is 0.009/0.0585≈0.1538, or 15.38%.

Imagine 10,000 files: 90 problematic flags and 495 other flags give the same answer, 90/(90+495). The 90% detection rate asks the reverse question and cannot substitute for the 15.38% result. The preset is hypothetical and is not a performance claim about a real service.

Read the odds carefully

For nonboundary probabilities, prior odds are P(A)/P(Aᶜ), and posterior odds multiply by the likelihood ratio P(B|A)/P(B|Aᶜ). Zero denominators can make odds infinite or an update factor undefined. They do not justify manufacturing a finite interpretation.

The result depends on the base rate. Conditional performance may also change with population or case mix. Explore plausible assumptions rather than treating one supplied prior as universal.

This is an event-probability update, not Bayesian fitting from raw data, a beta-binomial posterior, or a causal model. Repeated evidence requires a dependence model.

Continue

Read Bayes’ theorem and Bayesian inference. All calculations run in the browser; the probabilities and results are excluded from analytics.

Want to learn the theory?

Our lessons explain the statistical concepts behind this calculator with clear examples.

Understand this method →