Bayes’ Theorem Calculator

Update a hypothesis’s probability after new evidence with Bayes’ theorem, from the prior and the evidence rates.

Your details

Between 0 and 1, such as 0.25

Between 0 and 1, such as 0.25

Between 0 and 1, such as 0.25

Your data stays in your browser

Result

Enter the prior and the two evidence probabilities, then press “Calculate”.

Analysis and suggestions

Once calculated, this shows what your result means and suggestions based on your numbers.

Behind the result

Update a hypothesis’s probability after new evidence with Bayes’ theorem, from the prior and the evidence rates.

Example · P(A|B) = P(B|A) × P(A) ÷ P(B)، حيث P(B) = P(B|A)P(A) + P(B|A′)(1 − P(A))

0.95 × 0.01 ÷ 0.059 = 0.161

How it is calculated

Comprehensive Calculator Guide

This calculator updates the probability of a hypothesis after evidence. With a 1% prior, 95% detection and a 5% false-positive rate, a positive result means only about a 16% chance of the condition. It explains the result by picturing 1,000 cases.

How it works

P(B) = P(B|A)P(A) + P(B|not A)P(not A); then P(A|B) = P(B|A)P(A) ÷ P(B). Rare hypotheses stay unlikely after one piece of evidence because false alarms among the many outnumber true hits among the few.

How to Use

  1. Enter the prior P(A).
  2. Enter P(B|A) and P(B|not A).
  3. Press “Calculate” to see the posterior.

Formula Used

P(A|B) = P(B|A)P(A) ÷ [P(B|A)P(A) + P(B|not A)(1 − P(A))]

Practical Examples

Example 1
0.01, 0.95, 0.05: posterior ≈ 0.161.
Example 2
Spam filter 0.3, 0.8, 0.1: ≈ 0.774.

Important Tips

  • Always start from the prior.
  • Repeat with the posterior as the new prior.
  • Think in 1,000 cases.

Common Mistakes to Avoid

  • Ignoring the base rate.
  • Confusing P(B|A) with P(A|B).
  • Taking P(B|not A) as 1 − P(B|A).

Frequently Asked Questions

Prior vs posterior?
Before and after the evidence.
Where is it used?
Medicine, spam filters, machine learning.
Why so low after an accurate test?
The condition is rare.

Read Also

Results are estimates for educational purposes and may vary depending on your situation and data sources.