Bayes' Theorem Calculator
Calculate conditional probability using Bayes' theorem. Determine the posterior probability of a hypothesis given prior knowledge and new evidence from tests or observations.
This free online bayes' theorem calculator provides instant results with no signup required. All calculations run directly in your browser — your data is never sent to a server. Enter your values below and see results update in real time as you type. Perfect for everyday calculations, homework, or professional use.
The initial probability of the hypothesis before observing evidence.
Probability of observing the evidence given the hypothesis is true.
Probability of observing the evidence given the hypothesis is false.
How to Use This Calculator
Enter your input values
Fill in all required input fields for the Bayes' Theorem Calculator. Most fields include unit selectors so you can work in your preferred unit system — metric or imperial, whichever matches your problem.
Review your inputs
Double-check that all values are correct and that you have selected the right units for each field. Incorrect units are the most common source of calculation errors and can produce results that are off by factors of 2, 10, or more.
Read the results
The Bayes' Theorem Calculator instantly computes the output and displays results with units clearly labeled. All calculations happen in your browser — no loading time and no data sent to a server.
Explore parameter sensitivity
Try adjusting individual input values to see how the output changes. This is a quick and effective way to develop intuition about how different parameters influence the result and to identify which inputs have the largest effect.
Formula Reference
Bayes' Theorem Calculator Formula
See calculator inputs for the governing equation
Variables: All variables and their units are labeled in the calculator interface above. Input fields accept values in multiple unit systems — select your preferred unit from the dropdown next to each field.
When to Use This Calculator
- •Use the Bayes' Theorem Calculator when you need accurate results quickly without the risk of manual computation errors or unit conversion mistakes.
- •Use it to verify calculations made by hand or in spreadsheets — an independent check can catch errors before they lead to costly decisions.
- •Use it to explore how changing input parameters affects the output — a quick way to develop intuition and identify the most influential variables.
- •Use it when collaborating with others to ensure everyone is working from the same numbers and applying the same assumptions.
About This Calculator
The Bayes' Theorem Calculator is a free, browser-based calculation tool for engineers, students, and technical professionals. Calculate conditional probability using Bayes' theorem. Determine the posterior probability of a hypothesis given prior knowledge and new evidence from tests or observations. It implements standard formulas and supports both metric (SI) and imperial unit systems with automatic unit conversion. All calculations are performed instantly in your browser with no data sent to a server. Use this calculator as a quick reference and sanity-check tool during design, analysis, and learning. Always verify results against primary engineering references and applicable standards for any safety-critical application.
About Bayes' Theorem Calculator
The Bayes' theorem calculator computes the posterior probability of a hypothesis after observing new evidence. Named after Reverend Thomas Bayes, this theorem is the cornerstone of Bayesian statistics and has wide-ranging applications in medical diagnostics, spam filtering, machine learning, forensic science, and decision analysis. The key insight is that the probability of a hypothesis is not fixed but should be updated as new data becomes available. For example, the probability that a patient has a disease changes after a positive test result, and Bayes' theorem quantifies exactly how much it changes by combining the prior probability with the test's sensitivity and false positive rate.
The Math Behind It
Formula Reference
Bayes' Theorem
P(A|B) = P(B|A) * P(A) / P(B)
Variables: P(A|B) = posterior probability; P(B|A) = likelihood; P(A) = prior; P(B) = total probability of evidence
Worked Examples
Example 1: Medical diagnostic test
A disease affects 1% of the population. A test has 95% sensitivity and 5% false positive rate. What is the probability of having the disease given a positive test?
Despite a positive test, the probability of actually having the disease is only about 16.1%, because the disease is rare.
Example 2: Email spam filter
5% of emails are spam. The word 'free' appears in 80% of spam and 10% of legitimate emails. What is the probability an email containing 'free' is spam?
An email containing 'free' has about a 29.6% chance of being spam.
Common Mistakes & Tips
- !Ignoring the base rate (prior probability), which leads to grossly overestimating the posterior after a positive test.
- !Confusing P(A|B) with P(B|A). The probability of a positive test given disease is not the same as the probability of disease given a positive test.
- !Forgetting that P(B|not A) contributes significantly to P(B) when P(not A) is large.
Related Concepts
Used in These Calculators
Calculators that build on or apply the concepts from this page:
Frequently Asked Questions
Why does a positive test not guarantee the disease?
Because when a disease is rare, the false positives from the large healthy population can outnumber the true positives from the small diseased population. Bayes' theorem accounts for this base-rate effect.
What is a conjugate prior?
A conjugate prior is a prior distribution that, when combined with a particular likelihood function via Bayes' theorem, produces a posterior distribution in the same family. This simplifies the math considerably.
Can Bayes' theorem handle multiple hypotheses?
Yes. The generalized form divides P(B|Hi)*P(Hi) by the sum of P(B|Hj)*P(Hj) over all hypotheses j. Each hypothesis receives its own posterior probability.