calqulio.
◎ English · Global

Bayes Theorem Calculator

Update a two-category prior using the probability of evidence within each category.

Enter your values

Enter a numeric value. Use a non-negative value. Allowed range: 0–1.
Enter a numeric value. Use a non-negative value. Allowed range: 0–1.
Enter a numeric value. Use a non-negative value. Allowed range: 0–1.

Use a decimal point, without thousands separators.

Example result
Posterior P(A given B)
0.42857143
Evidence probability P(B)0.35

The initial result uses the example values. Enter your own values and calculate again.

Edit inputs

How it works

Treat A and not A as complementary categories covering every case. For prior 0.2, evidence likelihood 0.75 in A and 0.25 outside A, P(B) is 0.35 and P(A given B) is about 0.42857143. A zero evidence probability makes the conditional result undefined and is rejected. Inputs are probabilities between 0 and 1.

Inputs and units
Bayes Theorem Calculator · Inputs and units
InputExample valueWhat to enter
Prior P(A)0.2Enter a numeric value. Use a non-negative value. Allowed range: 0–1.
Evidence likelihood P(B given A)0.75Enter a numeric value. Use a non-negative value. Allowed range: 0–1.
Evidence likelihood P(B given not A)0.25Enter a numeric value. Use a non-negative value. Allowed range: 0–1.
P(B) = P(A)P(B∣A) + (1 − P(A))P(B∣not A); P(A∣B) = P(A)P(B∣A)/P(B)

Worked example

Show example inputs and results

This example is generated by the same calculation engine using the starting values in the form. Your own inputs produce your own result.

Prior P(A)
0.2
Evidence likelihood P(B given A)
0.75
Evidence likelihood P(B given not A)
0.25

Complete example results

Posterior P(A given B)
0.42857143
Evidence probability P(B)
0.35

Reading the result

Check the probability scale, sample size and assumptions stated by the method. A decimal probability of 0.5 represents 50%. Mean and spread inputs must describe the same dataset; the calculation does not validate those estimates.

Questions and answers

Can I use the example values for my own calculation?

The example values illustrate the calculation. Replace every input with your own information, especially dates, rates and the selected operation.

Can I swap P(A given B) with P(B given A)?

They condition on different events and are not generally equal. The prior and likelihood for the complementary category are needed to make the reversal.

Why are some results rounded?

Results display up to 8 decimal places. Calculations use the unrounded values; very small values use scientific notation. JavaScript floating-point arithmetic can introduce tiny rounding differences.

Are my inputs sent to a server?

The calculator processes inputs in your browser. Its code does not send your values to a server.

Method sources: openstax.org

Methods & accuracy

What would you like to calculate?

Browse all calculators