Bayes Theorem Calculator
Enter the prior P(A), the hit rate P(B|A) and the false alarm rate P(B|not A) to get the posterior P(A|B) as a decimal between 0 and 1.
P(A|B)
—
Bayes' theorem
Bayes' theorem tells you how to revise a belief once new evidence comes in. The formula is P(A|B) = P(B|A) · P(A) / P(B), where P(A) is the prior, P(B|A) the likelihood and P(A|B) the posterior. Take a rapid COVID test that is 95% sensitive and 95% specific, used on a population where prevalence sits at 1%. Get a positive result and the chance you actually have the disease is roughly 16%, not 95%. Because the disease is so rare, most of the positives that show up are false alarms. That result feels wrong to most people, and the gap is exactly what base-rate neglect describes; it is also why low-prevalence screening tends to over-diagnose.
Applications
It shows up in medicine, where the difference between sensitivity and positive predictive value drives screening decisions. Spam filters lean on it through Naive Bayes, the approach Paul Graham popularised in "A Plan for Spam" back in 2002. Forensic analysts use it to read DNA evidence correctly and steer clear of the prosecutor's fallacy. You will also find it under the hood of probabilistic machine learning (Bayesian networks, MCMC), in risk assessment, in A/B testing that starts from priors, and really anywhere a decision has to be made without full information.
FAQ
Why isn't a 95% test 95% accurate? What you get out of the test depends on the prior going in. With a rare disease, even a tiny false-positive rate produces more false positives than true ones, and the positive predictive value falls apart.
How is P(B) computed? You get it from the law of total probability: P(B) = P(B|A)·P(A) + P(B|¬A)·P(¬A). The calculator handles that step for you.
What's the difference from frequentist statistics? For a frequentist, the parameters are fixed and the data is what varies. A Bayesian flips that around: the parameters carry uncertainty and you keep refining them with data through Bayes' theorem.
Related Tools
Pythagorean Theorem Calculator
Calculate any side of a right triangle from the other two. Enter two sides and get the third with the formula a² + b² = c².
Bitcoin Block Time Calculator
Computes approximate time to mine N bitcoin blocks adopting the 10 minute average target per block kept by difficulty adjustment.
NR-6 PPE Life Months
Estimates PPE service life in months based on daily usage hours per Brazilian NR-6.
Organic Fertilizer per Pot
Estimates grams of organic fertilizer needed for a pot by liters.
Blender Cycles Render Time by Resolution
Estimates total Blender Cycles render time from resolution and frame count.
Mold Fill Time
Calculate the fill time of a casting mold, t = V ÷ Q, dividing the cavity volume V by the metal flow rate Q of the gating system. The result, in seconds, is the time to completely fill the mold with molten metal. It is a critical parameter: filling too slowly lets the metal cool and solidify before filling everything (cold shut, misrun defects), while too fast causes turbulence, gas entrapment, mold erosion and inclusions. The optimal time depends on the part's weight and thickness and the metal. Sizing the gating system for the right time is central to casting design. Enter the cavity volume and the flow rate.
The results provided by this tool are for general informational and educational purposes only and do not constitute professional, financial, medical, legal, tax or accounting advice. Always confirm important decisions with a qualified professional and official sources.