Posterior Probability from Priors & Evidence
Updated October 2026
Bayes' theorem tells you how to update a probability when new evidence arrives. You start with a prior — your belief before the evidence — and combine it with how informative the evidence is, to get a posterior: the updated probability. This calculator takes the prior probability of an event, the chance the evidence shows up when the event is true (the true positive rate), and the chance it shows up when the event is false (the false positive rate), and returns the revised probability. It's the mathematical core of rational belief-updating, used in medicine, spam filtering, and machine learning.
The everyday version of the question is: "Given a positive test, what's the chance I actually have the condition?" That's not the same as the test's accuracy, and the gap between the two is where intuition famously fails.
The classic example: a disease affects 1% of people, a test catches 90% of real cases, and it has a 9% false positive rate. If you test positive, most people guess your chance of having the disease is around 90%. The actual answer is about 9%. The reason is the rare prior — because so few people have the disease, the false positives from the huge healthy majority swamp the true positives from the tiny sick minority. This calculator makes that effect concrete, breaking out the true and false positives so you can see where the number comes from.
The prior probability — often called the base rate — does enormous work in the result, and ignoring it is such a common error it has a name: the base rate fallacy. A test result has to be weighed against how common the thing was to begin with. The rarer the condition, the more a single positive should be treated with caution, and the more it takes a very specific test to move the probability meaningfully. If you work with raw probabilities, our general probability calculator covers the basics.
Although the disease-testing framing is the clearest illustration, the same math governs any evidence-and-hypothesis pair: an email and the chance it's spam, a security alert and the chance of a real breach, a search result and the chance it's relevant. In every case Bayes' theorem combines a base rate with the reliability of the signal. The structure is identical; only the labels change.
The most instructive way to see Bayes' theorem at work is a second example with different numbers, because the surprise it produces is so persistent. Suppose a particular cancer affects 0.5% of a screening population. A mammogram detects 90% of real cancers (its sensitivity, the true positive rate) but also returns a positive result for 8% of healthy women (its false positive rate). A woman receives a positive result. What is the actual probability she has cancer? Intuition usually lands somewhere near 90%, anchored on the test's detection rate. The real answer is far lower, and working it through shows why.
Bayes' theorem asks you to compare two groups of positive results: the true positives and the false positives. Out of every 10,000 women screened, the 0.5% prevalence means about 50 actually have cancer. The test catches 90% of them, producing roughly 45 true positives. The other 9,950 women are healthy, but the 8% false positive rate means about 796 of them also test positive. So among everyone who receives a positive result, the total is 45 + 796 = 841 positives, of whom only 45 genuinely have cancer. The probability of cancer given a positive test is therefore 45 ÷ 841 ≈ 0.0535, or about 5.4%.
That figure — a positive result on a 90%-sensitive test corresponding to only a 5.4% chance of disease — is not a trick or an error. It is the correct consequence of a rare condition. Because cancer is uncommon in the screened population, the enormous pool of healthy women generates far more false positives in raw numbers than the small pool of sick women generates true positives, even though the test is individually accurate. The calculator performs this same comparison instantly: enter 0.5 for the prior, 90 for the sensitivity, and 8 for the false positive rate, and it returns the posterior probability along with the underlying true-positive and false-positive breakdown.
The lesson buried in that example is the single most important idea in interpreting evidence: the base rate, or prior probability, does enormous work in the final answer, and ignoring it is such a common error that it has a name — the base rate fallacy. A test result cannot be read in isolation; it must be weighed against how common the condition was to begin with. The rarer the condition, the more a single positive should be treated as a reason for further testing rather than a conclusion. This is precisely why medical guidelines often call for a confirmatory second test after an initial positive screen: the follow-up updates the probability again, and a second independent positive raises it substantially.
The same structure governs far more than medicine. A spam filter weighs the base rate of spam against how strongly a particular word or pattern indicates junk mail. A fraud detection system balances the rarity of genuine fraud against the suspiciousness of a transaction — and because fraud is rare, even a good detector generates many false alarms for every real catch, which is why flagged transactions are reviewed rather than automatically blocked. A security alert, a diagnostic warning light, a positive result on any rare-event test: all of them combine a base rate with the reliability of a signal, and all of them produce the same counterintuitive result when the base rate is low.
Two practical habits follow from this. First, when you encounter a test result, ask not only "how accurate is the test?" but "how common is the thing it is testing for?" — the two questions have different answers and the second is usually the more decisive. Second, recognize that the posterior probability the calculator gives you is itself a new prior. If a second piece of independent evidence arrives, you feed that updated probability back in and update again, which is exactly how rational belief accumulates as evidence mounts. For working with the underlying probabilities directly, the general probability calculator covers single and combined events, and the statistics calculator handles the descriptive figures behind a dataset.
Pay close attention to the prior — the base rate does most of the work in the result, and ignoring it is the single most common Bayesian mistake.
The lower the prior, the more cautiously you should treat a single positive result, because false positives come to dominate.
The posterior is not the test’s accuracy. "How accurate is the test" and "given a positive, what’s my chance" are different questions with different answers.
This same structure applies far beyond medicine — spam filters, fraud alerts, and search relevance all use the identical prior-plus-evidence logic.