Bayes’ Theorem Calculator


Use this online Bayes’ Theorem Calculator to get the probability of an event A conditional on another event B, given the prior probabilities of A and B, and the probability of B conditional on A. You can enter the values of any three parameters in the fields of this Bayesian calculator and find the missing parameter.


P(A), %:
P(B), %:
P(B|A), %:
P(A|B), %:


Bayes’ theorem

In probability theory and statistics, Bayes’s theorem (also known as Bayes’s law or Bayes’s rule) defines the posterior conditional probability of an event, based on knowledge of prior probabilities related to the event and relevant conditions. In its current form, the Bayes theorem is usually expressed as follows:

$${\displaystyle P(A\mid B)={\frac {P(B\mid A)\cdot P(A)}{P(B)}}}$$

where \(A\) and \(B\) are events with probabilities \(P(A)\) and \(P(B)\) respectively and \(P(B)\neq 0\). \(P(A\mid B)\) is a conditional probability of event \(A\) given that \(B\) is true. And \(P(B\mid A)\) is a conditional probability of event \(B\) given that \(A\) is true.

The Bayes formula can be interpreted the following way: before we do an experiment (given by the event \(B\)) the probability of the event \(A\) is \(P(A)\). But after the experiment the probability that the event \(A\) occurs is \(P(A\mid B)\). So Bayes formula is, in a sense, a way to learn the world if the world is uncertain.

Let’s take a look at a simple example. The morning today is cloudy and you want to know the chance of rain during the day. Denote by \(A\) the event of rain, and \(B\) the event of clouds. It’s known from prior experience that 50% of all rainy days start off cloudy, and 40% of all days start cloudy in the place where you live. At the same time it’s known that this month is usually a dry month, so the chance of rain is only 10%. Using our notations we can represent the above information in the form:

\(P(A)\) is probability of rain = 10%,
\(P(B)\) is probability of clouds = 40%,
\(P(B\mid A)\) is probability of clouds, given that rain happens = 50%
\(P(A\mid B)\) is probability of rain, given that clouds happen.

Using our Bayes’ Theorem Calculator we can easily get the answer: \(P(A\mid B)\) = 12.5%, or a 12.5% chance of rain.

Applications of Bayes’ Theorem

Bayes’ theorem is a powerful tool for making probabilistic predictions based on uncertain or incomplete information. Such predictions are widely used in various fields such as machine learning, artificial intelligence, data analysis, etc.

For example, Bayes’ theorem can be used to classify an email as spam or not spam based on the words used in the email and the prior probability that such an email is spam.

In medical testing this theorem is often used to determine the probability of a disease given a positive test result based on the prior probability of disease and the accuracy of the test.

In various sales and customer service systems, Bayes’ theorem can be used to provide recommendations based on past preferences, such as movie or book recommendations based on a user’s previous ratings.

Bayes’ theorem has many financial applications. For example, it can be used to predict the future performance of a stock based on past trends and current market conditions.

In financial applications this theorem is used to detect fraudulent transactions based on past fraud patterns and the likelihood that certain transactions are fraudulent.


Related calculators

Check out our other statistics calculators such as Odds To Probability Calculator or Poisson Distribution Calculator.