Want a Custom tool for Yourself?

Need a Custom Tool? We build custom tools that can save hours per employee per day.

Bayes' Theorem Calculator

Use Bayes theorem to compute P A given B from priors and likelihoods. Great for testing scenarios and updating probabilities with evidence.

Enter the Details


Result will appear here...


Last updated: March 12, 2026

Created by: Eon Tools Dev Team

Reviewed by: Ankit Khatiwada



What the Bayes theorem calculator does

Bayes' theorem tells you how to revise a probability when new evidence arrives. This calculator applies it directly: from the starting chance of A, the overall chance of the evidence B, and the chance of B when A is true, it works out the updated chance of A given that B has been observed.

It is one of the most useful results in all of probability, the formal way to change your mind in the face of data. Below is how it works and why it so often surprises people.

How to use it

  1. Enter P(A), the starting chance of A, as a percentage.
  2. Enter P(B), the overall chance of the evidence, and P(B given A), the chance of the evidence when A is true.
  3. Press Calculate for the updated probability P(A given B), or Reset to clear it.

How Bayes' theorem works

The theorem connects the two conditional probabilities that people so often confuse, the chance of A given B and the chance of B given A, through the starting rates of each:

P(A given B) = P(B given A) × P(A) ÷ P(B)

In words, you take how strongly A predicts B, scale it by how common A was to begin with, and divide by how common B is overall. The result flips the conditional around, turning what you know, how often the evidence shows up when the cause is present, into what you want, how likely the cause is once you have seen the evidence.

Updating a belief with evidence

The natural way to read Bayes' theorem is as an update. You start with a prior, the chance of A before you knew anything, which is P(A). Then evidence B arrives. The theorem combines the prior with how telling that evidence is and returns a posterior, the revised chance of A now that B is known.

This is how a diagnosis sharpens as test results come in, or how a spam filter grows more sure as it reads more of a message. Each new piece of evidence takes the current probability and nudges it, and Bayes' theorem is the exact rule for that nudge.

The base rate, and why it matters

The piece people leave out is the base rate, the prior P(A), and leaving it out is the single most common error in probability. It is tempting to think that a test which is 90 percent accurate means a positive result is 90 percent likely to be right. That skips the base rate, and the real answer can be far lower.

The reason is that when a condition is rare, most of the positive results come from the sheer number of cases where it is absent, not from the few where it is present. Bayes' theorem forces the base rate back into the calculation through P(A), which is why its answers are often so much smaller than intuition expects, and why it is the honest way to reason from evidence.

A worked example

Suppose 1 percent of people have a condition, so P(A) is 1 percent. A test is positive 90 percent of the time when the condition is present, so P(B given A) is 90 percent. And across everyone, about 5.85 percent of tests come back positive, so P(B) is 5.85 percent.

Bayes' theorem gives P(A given B) = 90 percent times 1 percent, divided by 5.85 percent, which is about 15 percent. So even after a positive result from a test that sounds highly accurate, the chance of actually having the condition is only around 15 percent, because it was so rare to start with. This is the base rate refusing to be ignored.

Entering your values, and finding P(B)

Enter all three values as percentages between 0 and 100. The calculator needs the overall chance of the evidence, P(B), as a direct input. If you do not know it but you do know how often the evidence shows up when A is false, our conditional probability calculator works P(B) out for you through the law of total probability, and you can bring that figure here.

Questions people ask

What is Bayes' theorem?

A rule for updating a probability when new evidence arrives. It gives the chance of A given B from the chance of B given A, the starting chance of A, and the overall chance of B.

What is a prior and a posterior?

The prior is the probability of A before the evidence, and the posterior is the revised probability after it. Bayes' theorem turns one into the other.

Why do the answers seem so low?

Because of the base rate. When A is rare, most occurrences of the evidence come from cases where A is absent, so even strong evidence leaves the updated chance of A modest.

What if I don't know P(B)?

You can work it out from the chance of the evidence when A is true and when A is false, using the law of total probability. The conditional probability calculator does that step for you.

References

A quick note on where the methods here come from. Bayes' theorem and the updating of probabilities with evidence are set out in the NIST/SEMATECH e-Handbook of Statistical Methods, the US government's public statistics reference. OpenStax Introductory Statistics is a free, widely used textbook covering Bayes' theorem and conditional probability.

  1. NIST/SEMATECH e-Handbook of Statistical Methods (conditional probability and Bayes' rule). https://www.itl.nist.gov/div898/handbook/
  2. OpenStax, Introductory Statistics (conditional probability and Bayes' theorem). https://openstax.org/details/books/introductory-statistics-2e


Ankit Khatiwada

Ankit Khatiwada is a researcher and graduate student in Computer Science at Saarland University, with strengths in statistics, data analysis, data engineering, and full stack development. His work sits at the intersection of quantitative reasoning and applied technology, making him a strong fit for tools that depend on clear numerical logic. At Eon Tools, he reviews number and statistical tools.