#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
🎲 FREE · PLAIN-ENGLISH BREAKDOWN

Bayes Theorem Calculator: Update a Probability With New Evidence

See how likely something really is after a positive test or signal.

  • 🧪 Medical test style inputs
  • 👥 10,000-people view
  • 📐 Likelihood ratio

How to use the Bayes Theorem Calculator

  1. 1. Enter the priorType how common A is before any evidence, as a percentage.
  2. 2. Enter the test ratesAdd the true positive rate and the false positive rate.
  3. 3. Read P(A | B)See the updated probability and the natural-frequency table.

The formula

P(A | B) = P(B | A) × P(A) ÷ P(B), where P(B) = P(B | A) × P(A) + P(B | not A) × (1 − P(A)). The prior P(A) is what you believe before seeing B. The result is the posterior: what you should believe after seeing B.

Worked example: a disease affects 1% of people. A test catches 95% of cases but also flags 5% of healthy people. P(B) = 0.95 × 0.01 + 0.05 × 0.99 = 0.059, so P(disease | positive) = 0.0095 ÷ 0.059 = 16.1%. Most positives are false alarms, because healthy people vastly outnumber sick ones.

Why the answer surprises people

Think in counts instead of percentages. Out of 10,000 people, 100 have the disease and 95 of them test positive. Of the 9,900 healthy people, 495 also test positive. So only 95 of the 590 positives are real. This mistake, ignoring how rare A is, is called base-rate neglect, and it shows up in spam filters, fraud alerts and machine-learning classifiers too.

  • Spam filtering: A = message is spam, B = it contains a certain word.
  • Fraud models: even a 99% accurate model raises many false alerts when fraud is rare.
  • Naive Bayes classifiers chain this rule across many features at once.

The likelihood ratio, P(B | A) ÷ P(B | not A), tells you how strongly the evidence points to A. Above 10 is strong evidence. Explore classifier trade-offs with the confusion matrix calculator.

Frequently asked questions

What is P(A | not B)?

It is the chance A is still true when the test is negative, such as a missed case. It uses the same inputs.

Can I use decimals instead of percentages?

Enter percentages: 0.5 means 0.5%, not 50%. Type 50 for one half.

Is the Bayes Theorem Calculator free?

Yes, the Bayes Theorem Calculator is free. The first time you see your first result, you are asked for your name and WhatsApp number once. After that, this and every other Uncodemy tool opens straight away without the form.

More free tools

See all free tools