About Bayes' Theorem Calculator
This calculator applies Bayes' theorem. Enter the prior probability of A, the chance of the evidence B when A is true, and the chance of B when A is false, and it returns P(A | B), the probability after seeing the evidence. It is free, needs no sign-up and runs in your browser, so nothing you enter is uploaded.
The classic use is a medical test. If 1% of people have a condition, the test finds 90% of them and wrongly flags 9% of the others, then a positive result means only about a 9% chance of having the condition. The table of counts out of 10,000 people shows why: 90 true positives are swamped by 891 false positives.
How to use Bayes' Theorem Calculator
- Choose a calculation: Two events, Conditional, Bayes' theorem or Repeated trials.
- Enter the probabilities as decimals, percentages or fractions, such as 0.4, 40% or 2/5.
- For two events, say how A and B are related: independent, mutually exclusive, or P(A and B) known.
- Read the headline answer and the table of related probabilities. The Venn diagram shows each region.
- Open the working to see each formula with your numbers filled in.
Features
- P(A and B), P(A or B), complements, conditional probabilities and exactly one or neither.
- Independent, mutually exclusive and known-overlap cases, with a check that the numbers are possible.
- Conditional probability with an independence check.
- Bayes' theorem with the total probability P(B) and a count table out of 10,000 people.
- Repeated trials: none, at least one, exactly k, at most k and at least k, using the binomial distribution.
- Venn diagram in SVG that scales to your screen.
- Decimals, percentages and fractions accepted everywhere.
Bayes' theorem
The probability of the evidence is the weighted sum over A and not A.
P(B) = P(B | A) P(A) + P(B | not A) P(not A)
P(A | B) = P(B | A) P(A) / P(B)Worked examples
1% prevalence, 90% sensitivity, 9% false positives gives P(A | B) = 0.091743
P(B) = 0.0981.
P(A) = 0.3, P(B | A) = 0.8, P(B | not A) = 0.1 gives P(A | B) = 0.774194
P(B) = 0.31.
Privacy: how it works
- All calculations run in your browser tab. The probabilities you enter are not sent to Ulkaa or to any other server.
Tips
- Probabilities must be between 0 and 1. The calculator says which input is out of range.
- For "at least one", it is easier to find the chance of none and subtract from 1.
- If the overlap you enter is impossible for the given P(A) and P(B), the tool shows the allowed range.
- Repeated trials assume each trial is independent with the same chance.
Frequently asked questions
Is it really free?
Yes. There is no price, no trial and no credit card. Ulkaa Tool does the work with your own device, so there is no server bill to pass on to you.
Do I need an account?
No. There is no sign-up and no login. Open the page and use it. An Ulkaa account is not needed for anything on this tool.
Does it run in my browser?
Yes. Your probabilities are processed by code running in your browser tab, on your own device.
Is my data uploaded?
No. Your probabilities are never sent to Ulkaa or to anyone else. You can check this yourself by watching the Network tab in your browser developer tools while you use the tool.
What is the prior?
The probability of A before you see the evidence, such as how common a condition is.
Why is the posterior so low for a good test?
When the thing is rare, false positives from the many healthy people outnumber true positives from the few sick ones.
More Probability Calculator pages
- Probability CalculatorWork out the chance of two events together, either, or one given the other, with the steps and a Venn diagram.
- Conditional Probability CalculatorEnter P(A), P(B) and P(A and B) to get P(A given B) and P(B given A).
- At Least One Probability CalculatorEnter the chance of one trial and the number of trials to get the chance of at least one success.