Free online tools

Bayes’ Theorem Calculator

Update the probability of an event after observing related evidence. Enter the prior and the chance of seeing the same evidence both when the event occurs and when it does not.

Enter your values

Enter the probability of A before observing B.

Enter the probability of the evidence B when A occurs.

Enter the probability of the same evidence when A does not occur.

This tool processes your input in your browser.

Result

Use the same evidence in both likelihoods

For example, 20% of a collection comes from Batch A. A blue label appears on 80% of Batch A and on 10% of the other items. After seeing a blue label, Bayes’ theorem asks how likely the item is to come from Batch A.

Divide the joint probability by the overall evidence probability

P(A and B) equals P(A) × P(B given A). P(B) adds that joint probability to P(not A) × P(B given not A). Their ratio gives P(A given B). In the example it is 16% divided by 24%, or about 66.67%.

Frequently asked questions

Is P(B given A) the same as P(A given B)?

The first describes seeing the evidence under the event. The second describes the event after seeing the evidence. Computing it also uses the prior and the likelihood when the event is absent.

What if the evidence has zero probability?

The posterior conditioned on that evidence is undefined. Inspect the prior and likelihoods to confirm whether the observation is possible under the entered model.

Can the likelihoods add to more than 100%?

Yes. Each likelihood is conditional on a different case. Only the prior and its complement must add to 100%.