Bayes Rule Probability Calculator

Test priors, sensitivity, specificity, and evidence with confidence. Compare priors and posteriors using clean visuals. Understand uncertainty faster with practical Bayesian calculations and exports.

Calculator Inputs

Enter percentages from 0 to 100. The calculator updates the posterior probability using Bayes rule.

Example: Disease present, Fraud, Spam.
Example: Positive test, Flagged alert, Message contains keyword.
Used for expected counts and exports.
Probability of the hypothesis before evidence.
Chance of evidence when the hypothesis is true.
Chance of evidence when the hypothesis is false.
Controls result formatting.

Example Data Table

These examples show how priors and evidence can change the final probability.

Scenario P(A) P(B|A) P(B|¬A) P(A|B)
Medical screening 1% 95% 5% 16.10%
Fraud review 20% 80% 10% 66.67%
Spam filtering 40% 70% 20% 70.00%

Formula Used

Bayes rule updates a prior belief after new evidence appears.

P(A|B) = [P(B|A) × P(A)] / P(B)

P(B) = [P(B|A) × P(A)] + [P(B|¬A) × P(¬A)]

P(A) is the prior probability of the hypothesis.

P(B|A) is the probability of the evidence when the hypothesis is true.

P(B|¬A) is the probability of the evidence when the hypothesis is false.

P(A|B) is the updated posterior probability after observing the evidence.

How to Use This Calculator

  1. Enter a short name for the hypothesis and the observed evidence.
  2. Add the prior probability of the hypothesis before seeing evidence.
  3. Enter the probability of observing the evidence when the hypothesis is true.
  4. Enter the probability of observing the evidence when the hypothesis is false.
  5. Choose a sample size for expected count estimates.
  6. Set the decimal precision you want.
  7. Click the calculate button to generate posterior results and the chart.
  8. Use the export buttons to save the summary as CSV or PDF.

Frequently Asked Questions

1. What does Bayes rule calculate?

It calculates an updated probability after you observe new evidence. The method starts with a prior belief and adjusts it using how likely the evidence is under different conditions.

2. What is the difference between prior and posterior probability?

The prior is your starting probability before evidence appears. The posterior is the revised probability after the evidence is observed and weighed using Bayes rule.

3. Why is P(B|¬A) important?

It measures how often the same evidence appears even when the hypothesis is false. A large value can greatly reduce the final posterior probability.

4. Can I use this for medical tests?

Yes. Bayes rule is commonly used for screening interpretation, especially when disease prevalence is low and false positives can meaningfully change the final probability.

5. Does this work for fraud or spam detection?

Yes. It is useful wherever alerts, scores, or evidence update your belief about an event, such as fraud review, anomaly detection, filtering, or risk scoring.

6. What happens if the evidence probability is zero?

The posterior becomes undefined because the denominator is zero. The calculator checks for that case and asks you to adjust the probabilities.

7. Why does a strong test still give a modest posterior sometimes?

A very low prior probability can keep the posterior limited, even with strong evidence. This is why rare events often require multiple confirmations.

8. What do expected counts show?

Expected counts translate the probabilities into approximate case counts for your chosen sample size. They make the results easier to interpret in practical scenarios.

Related Calculators

maximum a posteriori calculatorbayes risk calculatordecision boundary calculatorbayesian credible interval calculatorlikelihood ratio test calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.