What the page computes
Bayes theorem answers a specific kind of question: given that you observed some evidence, how likely is it that a hypothesis A is true? You supply three numbers. The prior is how likely A was before you saw the evidence. The first likelihood is the chance of seeing the evidence if A is true. The second likelihood, called the alternative here, is the chance of seeing the same evidence if A is false. The page returns two results. The probability of the evidence is how often you would expect to see it overall, mixing both cases. The posterior is the updated probability of A after the evidence. All three inputs are probabilities written as decimals, so 10 percent is 0.1. The two outcomes, A and not A, are treated as covering every possibility, which is why the formula needs only these inputs. The page performs probability arithmetic and does not decide what your numbers should be, so most of the work is choosing sensible inputs.
The formula with the default values
The evidence probability is likelihood × prior + alternative × (1 − prior). The posterior is likelihood × prior divided by that evidence probability. With the defaults, the prior is 0.1, the likelihood given A is 0.8 and the likelihood given not A is 0.2. The first term of the evidence is 0.8 × 0.1 = 0.08. The second term is 0.2 × 0.9 = 0.18. Their sum is 0.26, so the evidence appears in 26 percent of all cases. The posterior is 0.08 / 0.26, which is about 0.3077. A hypothesis that started at 10 percent has risen to roughly 31 percent after one observation that is four times as likely under A as under not A. That is a large relative gain, yet the posterior is still well below one half. The reason is the low starting point: most of the cases that show the evidence still come from the large group where A is false.
Checking the result with natural frequencies
Many people find the arithmetic easier to trust when it is phrased as counts. Gerd Gigerenzer and colleagues have argued that natural frequencies make Bayesian reasoning easier to follow, and the defaults show why. Imagine 1,000 cases. With a prior of 0.1, about 100 have A and 900 do not. Of the 100 with A, 80 show the evidence, because the likelihood is 0.8. Of the 900 without A, 180 show it, because the alternative is 0.2. In total 260 cases show the evidence, which is the 0.26 probability of the evidence written as a count out of 1,000. Among those 260, 80 truly have A. So the posterior is 80 out of 260, or 0.3077. Whenever a result looks surprising, rebuilding the table of 1,000 cases is a quick way to confirm the page and to see where the surprise comes from. The large group without A produces most of the positives.
The odds form and the likelihood ratio
There is a second way to write the same update. Divide the likelihood under A by the likelihood under not A to get the likelihood ratio, here 0.8 / 0.2 = 4. Convert the prior to odds, 0.1 / 0.9 = 1/9. Posterior odds equal prior odds times the likelihood ratio, so the posterior odds are 4/9. Converting odds back to a probability gives 4 / (4 + 9) = 4/13, which is 0.3077, matching the page. The odds form is useful because it separates the strength of the evidence from the starting belief. A likelihood ratio of 4 multiplies the odds by 4 no matter what the prior is. A ratio near 1 barely moves the odds, which means the evidence is not informative. A ratio below 1 argues against A. If you can estimate only the ratio, you can combine it with any prior by multiplying odds, which makes the odds form handy for what-if questions about different starting points.
A screening-test example
Consider an illustrative screening test for a condition that affects 1 percent of a group. Suppose the test flags 90 percent of people who have the condition and also flags 5 percent of people who do not. Enter a prior of 0.01, a likelihood of 0.9 and an alternative of 0.05. The evidence term is 0.9 × 0.01 + 0.05 × 0.99 = 0.009 + 0.0495 = 0.0585. The posterior is 0.009 / 0.0585, which is about 0.1538, or roughly 15 percent. Even with a test that sounds accurate, most positive results come from people without the condition, because they greatly outnumber the people with it. This pattern is called base-rate neglect, and it surprises many readers the first time they see it. The numbers are invented for illustration and do not describe any real test. The page is probability arithmetic and is not medical advice, so real results must be interpreted with a clinician using the actual performance data for the test.
Likelihood is not the same as posterior
The most frequent error with this formula is mixing up two conditional probabilities. The probability of the evidence given A and the probability of A given the evidence are different quantities, and one cannot be read off as the other. Courts have seen this mistake as the prosecutor's fallacy, where the small chance that an innocent person would match some evidence is mistaken for the chance that a matching person is innocent. The two likelihood inputs here must both describe the evidence, one under each hypothesis. They do not have to add to 1. A test might flag 90 percent of true cases and 5 percent of false ones, and those two numbers sum to 0.95, which is fine. Only the pair of probabilities for the same hypothesis, such as flagged and not flagged under A, must sum to 1. If you find yourself entering 1 minus the first likelihood as the second one, stop and ask whether you mean the false positive rate instead.
Choosing a prior
The prior is the input people argue about, and the posterior can be sensitive to it. When a base rate is known, such as the share of a population with a trait or the share of emails that are spam, use it. When no reliable base rate exists, run the calculator with several priors and see how much the answer moves. With the default likelihoods, a prior of 0.5 gives an evidence probability of 0.8 × 0.5 + 0.2 × 0.5 = 0.5 and a posterior of 0.4 / 0.5 = 0.8. A prior of 0.1 gives 0.31, so the same evidence yields very different conclusions depending on where you start. A prior of exactly 0 or 1 never changes, whatever the evidence, which is a sign that such certainty should be reserved for logical facts. Stating the prior openly, and the reason for it, lets other people redo the calculation with their own.
Updating in stages
Posteriors can become the next prior when new, independent evidence arrives. Start with the defaults, where the posterior is about 0.3077. Suppose a second observation with the same likelihoods appears. Entering 0.3076923 as the prior, the evidence probability is 0.8 × 0.3077 + 0.2 × 0.6923, which is about 0.3846, and the posterior is 0.2462 / 0.3846 = 0.64. The odds form gives the same result more directly: 4/9 times 4 is 16/9, and 16 / (16 + 9) = 0.64. Two modestly informative observations moved a 10 percent prior to 64 percent. The word independent matters. If the second observation is just a repeat of the first, such as the same test run twice on the same sample, the likelihoods are not independent and multiplying their effects overstates the evidence. Chained updates are only as sound as the independence claim behind them.
A spam-filter example
A mail filter provides a quite different use. Suppose 40 percent of incoming messages are spam, so the prior is 0.4. A particular phrase appears in 70 percent of spam messages and in 10 percent of legitimate ones. Enter a prior of 0.4, a likelihood of 0.7 and an alternative of 0.1. The evidence probability is 0.7 × 0.4 + 0.1 × 0.6 = 0.28 + 0.06 = 0.34. The posterior is 0.28 / 0.34, about 0.8235. A message containing the phrase is therefore spam with a probability near 82 percent. The example is illustrative, since real filters combine many features and estimate their probabilities from large collections of messages. A single phrase with a likelihood ratio of 7 is a strong signal, yet the page shows it still leaves nearly one message in six as legitimate. Filters therefore set thresholds and weigh the cost of discarding good mail against the cost of letting spam through.
Limits and scope
The page assumes A and not A are the only alternatives and that every probability is supplied by you. If there are several competing hypotheses, the denominator must sum over all of them, and this two-way version does not do that. The evidence probability cannot be zero, because the posterior divides by it, and the page requires finite results. Inputs should be valid probabilities between 0 and 1. The mathematics goes back to Thomas Bayes, whose essay was published after his death in 1763 with help from Richard Price, and the MIT OpenCourseWare notes for course 18.05 give a clear modern treatment of the theorem. The calculation says nothing about whether your probabilities are accurate, whether the evidence was gathered fairly or whether A and the evidence were defined consistently. It is arithmetic, and the quality of the answer is the quality of the inputs.
Combining several pieces of evidence at once
Real cases often involve more than one clue, and it is tempting to run the page once per clue and chain the answers. That works only when the clues are independent given the hypothesis. A reasonable test is to ask whether learning the first clue would change how likely you think the second clue is, once you already know whether A is true. If the answer is yes, the clues overlap and the combined likelihood must be estimated jointly. Doing so is often harder than it sounds. Medical tests that share a biological mechanism, or two spam features that always appear together, are typical overlaps. When in doubt, treat the combined evidence as a single event with its own two likelihoods, such as the chance that both clues appear under A and under not A, and enter those. This keeps the page honest, because it asks for exactly the two numbers the formula needs.