Files never leave your device

Bayes’ theorem calculator

Find how a positive observation changes the probability of a hypothesis. Your inputs stay on your device.

Set up your task

Ready. Processing stays in this browser.

How to use Bayes’ theorem calculator

Find how a positive observation changes the probability of a hypothesis. The pre-filled problem gives you a worked starting point. Compare the response with your own working before trying the self-check below.

  1. Check the example inputs: Prior probability of the hypothesis, P(positive | hypothesis true), P(positive | hypothesis false).
  2. Change the inputs for your problem. Results update as you type, so finish entering the values before copying an answer.
  3. Use the working to check an intermediate value or assumption. Then change the example as suggested in the self-check and compare the result.

Supported inputs and limits

Enter a prior and both probabilities of observing positive evidence. All values are from 0 to 1.

How it works

Bayes’ theorem answers a question about a hypothesis after seeing evidence. In the numerator, multiply the prior probability by the chance of positive evidence given that the hypothesis is true. The denominator also includes positives observed when the hypothesis is false.

The two contributions shown can be useful in a frequency interpretation. In a group of a thousand cases, multiply each displayed joint probability by a thousand to estimate the count associated with that branch. A strong observation can have limited predictive value when the hypothesis is very rare.

Example

Run the pre-filled example. Its first result is “Posterior: 0.5”.

Prior probability of the hypothesis
0.1
P(positive | hypothesis true)
0.9
P(positive | hypothesis false)
0.1
Posterior: 0.5
True and positive: 0.09
False and positive: 0.09
Total probability of positive evidence: 0.18

Questions about Bayes’ theorem calculator

What if positive evidence is impossible?

A conditional probability on an event with probability zero is undefined. The tool asks you to check the supplied rates.

Does a high true-positive rate imply a high posterior?

The posterior also depends on the prior and the false-positive rate. A common false-positive pathway can dominate the positive observations.

Keep the example prior and true-positive rate but enter a zero false-positive rate.

The posterior becomes one because, under those assumptions, every positive must come from the true branch.

Related tools

Year 1: Foundations

Last updated