Post-Test Probability Calculator
Update the probability of a condition after a test result. Enter a pre-test probability with a likelihood ratio, or with sensitivity, specificity and the result you observed, and see the odds, the post-test probability and every step.
What this post-test probability calculator does
A test result changes how likely a condition is, but by how much depends on where you started. This calculator takes the probability before the test (the pre-test probability) and the strength of the evidence in the result, and returns the probability afterwards. If you start at 30% and the result carries a likelihood ratio of 8.5, the probability rises to 78.46%. If the result is negative and its likelihood ratio is 0.1667, it falls to 6.67%.
Short answer: convert the pre-test probability to odds, multiply the odds by the likelihood ratio of the result, and convert back to a probability. The answer is the probability of the condition after that result, given the pre-test estimate you supplied.
The calculation is an application of Bayes' theorem, sometimes called Bayesian diagnostic updating. It is a way of organising diagnostic reasoning, so the result is only as good as the pre-test estimate and the test performance figures that go into it.
What to enter
There are two main routes, and a third that helps you reach the first two.
- A likelihood ratio. Enter the pre-test probability and the likelihood ratio that applies to the result you observed. Use this when a study or guideline already quotes the ratio, or when a test has several result levels, each with its own ratio.
- Sensitivity and specificity. Enter the pre-test probability, the sensitivity, the specificity and whether the result was positive or negative. The calculator works out the matching likelihood ratio itself and also shows what the opposite result would have meant.
- A 2 by 2 table of counts. If you have the counts from a study, enter the true positives, false negatives, false positives and true negatives. The calculator derives the sensitivity and specificity, then continues as above. Your own pre-test probability is still the starting point.
Probabilities can be typed as percentages (30 or 30%), as decimals (0.3) or as fractions (3/10). A likelihood ratio is different: it is a plain number with no unit, so 8.5 means 8.5 times, never 8.5%, and a percentage typed into that field is rejected. Zero and 100% are both accepted for the pre-test probability, and the page explains what they imply.
Use Fill with an example to load the worked example below for whichever input route you have selected.
Pre-test probability and disease prevalence
Pre-test probability is the estimated chance that the person has the condition before the result is known. It can draw on the prevalence of the condition among similar people, routine or practice data, the history, symptoms and risk factors, a clinical scoring system where a suitable one exists, and clinical judgement.
It is tempting to treat it as the same thing as prevalence, and sometimes they are close, but they answer different questions. Prevalence describes a population. Pre-test probability describes one person in a particular setting. A person with relevant symptoms usually starts above the general prevalence, and someone screened with no symptoms may start at or below it. Because the estimate is a judgement, a sensible habit is to run the calculator at a low, a middle and a high starting value and see whether the conclusion changes.
| Pre-test probability | After a positive result | After a negative result |
|---|---|---|
| 1% | 7.91% | 0.17% |
| 10% | 48.57% | 1.82% |
| 30% | 78.46% | 6.67% |
| 60% | 92.73% | 20.00% |
The table shows why the starting point matters so much. After a positive result, a person who started at 1% is still more likely not to have the condition (7.9%), while a person who started at 60% is at 92.7%. After a negative result the 60% group is still at 20.0%, which is not reassuring.
Likelihood ratios: positive and negative
A likelihood ratio compares how likely a particular result is in people who have the condition with how likely it is in people who do not. It is not the probability that the test is correct. A test with a likelihood ratio of 8.5 for a positive result is not “8.5 times right”. It means a positive result is 8.5 times as likely in someone with the condition as in someone without it.
- The positive likelihood ratio applies after a positive result: sensitivity ÷ (1 − specificity). With 85% sensitivity and 90% specificity it is 8.5.
- The negative likelihood ratio applies after a negative result: (1 − sensitivity) ÷ specificity. For the same test it is 0.1667.
- Use the ratio that matches the result you actually have. The two describe different outcomes of the same test and are never interchangeable.
A likelihood ratio above 1 raises the odds of the condition, a likelihood ratio below 1 lowers them, and a ratio of exactly 1 leaves them unchanged. The further a ratio is from 1, the more it moves the probability. Ratios above 10 or below 0.1 are commonly treated as strong evidence, and values close to 1 as weak. In the calculator, the before-and-after bars and the change in percentage points show the effect of the ratio you used.
Sensitivity and specificity that add up to exactly 100% give a ratio of 1 for both results, so the test tells you nothing. If they add up to less than 100%, the test is worse than guessing: a positive result lowers the probability and a negative one raises it. The calculator allows this, because it is a valid calculation, and flags it so you can check for swapped values.
Post-test probability formula
The calculation moves from probability to odds, applies the likelihood ratio, and moves back.
- Pre-test odds = pre-test probability ÷ (1 − pre-test probability)
- Positive likelihood ratio: LR+ = sensitivity ÷ (1 − specificity)
- Negative likelihood ratio: LR− = (1 − sensitivity) ÷ specificity
- Post-test odds = pre-test odds × likelihood ratio
- Post-test probability = post-test odds ÷ (1 + post-test odds)
- In one step: post-test probability = p × LR ÷ (p × LR + 1 − p)
Odds are multiplied by the likelihood ratio, not probabilities. Multiplying the probability directly goes wrong quickly: 30% × 8.5 = 2.55, which is not a probability at all because it is above 1. Working in odds avoids that, and the one-step form in the last line of the list gives the identical answer without showing the odds.
The steps for the worked example are laid out in the next section, and the calculator prints the same steps for your own numbers, with full precision kept internally and only the displayed values rounded.
Worked examples: a positive and a negative result
Both examples use the same starting values: a pre-test probability of 30%, a sensitivity of 85% and a specificity of 90%.
Positive result
Likelihood ratio: LR+ = 0.85 ÷ (1 − 0.90) = 0.85 ÷ 0.10 = 8.5.
Pre-test odds: 0.30 ÷ (1 − 0.30) = 0.30 ÷ 0.70 = 0.4286.
Post-test odds: 0.4286 × 8.5 = 3.6429.
Post-test probability: 3.6429 ÷ (1 + 3.6429) = 3.6429 ÷ 4.6429 = 0.7846, or 78.46%.
In plain terms, a person who started at 30% is now at about 78% after the positive result.
Negative result
Likelihood ratio: LR− = (1 − 0.85) ÷ 0.90 = 0.15 ÷ 0.90 = 0.1667.
Pre-test odds: unchanged at 0.4286.
Post-test odds: 0.4286 × 0.1667 = 0.0714.
Post-test probability: 0.0714 ÷ (1 + 0.0714) = 0.0714 ÷ 1.0714 = 0.0667, or 6.67%.
The same person is now at about 6.7%. The probability has dropped a long way, and it has not reached zero.
You can check both answers with natural frequencies. Imagine 1,000 people who all start at 30%: 300 have the condition and 700 do not. Of the 300, 255 test positive and 45 negative. Of the 700, 70 test positive and 630 negative. Among the 325 positive tests, 255 are true positives, so 255 ÷ 325 = 78.46%. Among the 675 negative tests, 45 are false negatives, so 45 ÷ 675 = 6.67%. These match the calculation above.
Reading the result
The headline figure is labelled as the probability of the condition after the test. It always answers the question “how likely is the condition now?” and never “how likely is the test to be right?”.
- After a positive result it is the probability that the condition is present. When the pre-test probability equals the prevalence in the group the test was evaluated in, this is the positive predictive value. Otherwise the two differ.
- After a negative result it is the residual probability that the condition is present despite the negative test. It is not the negative predictive value, which is the probability that the condition is absent. When the pre-test probability equals the prevalence behind the NPV, the residual probability is 1 minus the NPV.
A negative result lowers the probability without removing it. How much is left depends on the likelihood ratio and on where you started, which is why a negative test is more reassuring for a person who started low than for one who started high.
Fagan nomogram
A Fagan nomogram is a chart with three vertical scales: pre-test probability on the left, likelihood ratio in the middle and post-test probability on the right. You lay a straight edge across the pre-test probability and the likelihood ratio, and read the post-test probability where it meets the right-hand scale. Fagan published the nomogram in 1975 as a graphical form of Bayes' theorem.
It is the same calculation as the one on this page. The scales are spaced so that moving along the middle scale multiplies the odds, which is what the likelihood ratio does. For the positive example above, the line runs from 30% through 8.5 and lands at about 78%. The calculator shows these three readings under the result, so you can check them against a printed nomogram. A chart is handy when no calculator is at hand, but reading it by eye is less precise than the figures here.
Supporting diagnostic measures
Sensitivity and specificity come from comparing a test with a reference standard in a group of people whose true status is known. The four cells of that comparison are the building blocks for everything else.
- Sensitivity
- The share of people who have the condition and test positive. A highly sensitive test misses few cases.
- Specificity
- The share of people who do not have the condition and test negative. A highly specific test produces few false alarms.
- True positive
- A person with the condition who tests positive.
- False negative
- A person with the condition who tests negative, so the test missed them.
- False positive
- A person without the condition who tests positive.
- True negative
- A person without the condition who tests negative.
- Positive predictive value
- The share of positive tests that are true positives, within the group the table describes.
- Negative predictive value
- The share of negative tests that are true negatives, within the group the table describes.
| Test positive | Test negative | Total | |
|---|---|---|---|
| Condition present | 85 (true positives) | 15 (false negatives) | 100 |
| Condition absent | 10 (false positives) | 90 (true negatives) | 100 |
Here the sensitivity is 85 ÷ 100 = 85% and the specificity is 90 ÷ 100 = 90%. This table also has a prevalence of 50%, because half of the people in it have the condition. At that starting point a positive result gives 89.47%, which is exactly the table's positive predictive value of 85 ÷ 95 = 89.47%. At the 30% pre-test probability used earlier, the same test gives 78.46%. That gap is the difference between predictive values, which belong to the table's group, and post-test probability, which belongs to the person.
If you only need sensitivity, specificity and predictive values from a set of counts, the Sensitivity and Specificity Calculator is built for that, and the Confusion Matrix Calculator covers related classification measures. The 2 by 2 option above is a shortcut for getting from counts to a post-test probability in one place.
For general Bayesian updating beyond diagnostic tests, including several hypotheses and the probability tree, use the Bayes' Theorem Calculator. To see how a base rate can make a positive result misleading, try the False Positive Paradox Calculator. To convert between probability and odds on their own, the Odds Calculator handles that for betting and statistical odds.
Input checks and edge cases
The calculator stops and explains the problem, rather than showing a misleading number, when:
- a probability is not a number, a percentage or a fraction, is negative, or is above 100% (or above 1 when decimals are selected);
- a likelihood ratio is negative, is typed as a percentage, or is above 1,000,000,000;
- a count is not a whole number, is negative, or is above 1,000,000,000,000, or a row of the counts table adds up to 0;
- the observed result cannot occur with the values entered. For example, a negative result is impossible when sensitivity is 100% and specificity is 0%, and a pre-test probability of 100% with a likelihood ratio of 0 is contradictory. The post-test probability is undefined in these cases, and the calculator says so instead of printing 0 or infinity.
Some unusual inputs are valid and are handled openly. A specificity of 100% makes the positive likelihood ratio infinite, because nobody without the condition tests positive, so a positive result gives a post-test probability of 100% (as long as the pre-test probability is above 0). A pre-test probability of 0% stays at 0% and 100% stays at 100%. Real tests rarely have a perfect specificity, so a result like that mostly reflects the rounded figure you entered.
Assumptions and limitations
- The result depends directly on the pre-test probability you supply. It is an estimate, and a different reasonable estimate gives a different answer.
- Sensitivity, specificity and likelihood ratios are themselves estimates from studies, with their own uncertainty, and they can differ between settings and patient groups. The calculator uses them as exact values and does not carry that uncertainty through.
- The calculation applies to one test result. Using a post-test probability as the pre-test probability for a second test is valid only when the two tests give independent information once the condition is known, and that often cannot be assumed.
- The condition is treated as present or absent, and the result as positive or negative, or as one stated likelihood ratio. Tests with graded results need the ratio for the specific level you observed.
- The output is an aid to diagnostic reasoning. It is not a diagnosis, it does not recommend any treatment, and it cannot replace the judgement of a qualified clinician who knows the person and the setting. This calculator provides a mathematical result from the values you enter and is an informational and educational tool, not medical or professional advice.
Formula sources
The likelihood ratio definitions, the odds update, the worked numbers and the relationship to predictive values were checked against these independent references:
- Deeks JJ, Altman DG, Diagnostic tests 4: likelihood ratios, BMJ 2004;329:168–9 (likelihood ratios from sensitivity and specificity, post-test odds as pre-test odds multiplied by the ratio, a worked example, the 10 and 0.1 convention and the nomogram)
- MedCalc Software, Biostatistics in Practice: Likelihood Ratios in Diagnostic Testing (the LR+ and LR− formulas, the three-step update and a worked example at several starting probabilities)
- Faculty of Public Health, Health Knowledge: Pre- and post-test probability (how pre-test probability is estimated, the post-test probability formula, the likelihood ratio formulas and the nomogram)
- Altman DG, Bland JM, Diagnostic tests 2: predictive values, BMJ 1994;309:102 (predictive values depend on prevalence, and are revised probabilities for people who test positive or negative)
The nomogram is described by Fagan, “Nomogram for Bayes theorem”, New England Journal of Medicine 1975;293:257, as cited in the Deeks and Altman note above.
Frequently asked questions
How do I calculate post-test probability from pre-test probability and a likelihood ratio?
Convert the pre-test probability to odds with p ÷ (1 − p), multiply those odds by the likelihood ratio, and convert back with odds ÷ (1 + odds). For a pre-test probability of 30% and a likelihood ratio of 8.5, the pre-test odds are 0.4286, the post-test odds are 3.6429 and the post-test probability is 78.46%.
How do I calculate post-test probability using sensitivity and specificity?
First turn them into the likelihood ratio for the result you saw: sensitivity ÷ (1 − specificity) for a positive result, or (1 − sensitivity) ÷ specificity for a negative one. Then apply that ratio to the pre-test odds as above. With 85% sensitivity and 90% specificity, LR+ is 8.5 and LR− is 0.1667. In the calculator, choose the sensitivity and specificity option and select the observed result.
How do I estimate pre-test probability for a patient?
There is no single formula. Common starting points are the prevalence of the condition among people similar to the patient, routine or practice data, the patient's history, symptoms and risk factors, a clinical scoring system where a suitable one exists, and clinical judgement. Because the estimate is a judgement, it helps to try a few plausible values and see how far the answer moves.
Is pre-test probability the same as disease prevalence?
Not necessarily. Prevalence describes a defined population, while pre-test probability is the probability for one person before the result is known. The two can coincide when all you know about the person is that they belong to that population, but symptoms, risk factors and the clinical setting usually move the pre-test probability away from the prevalence of the general population.
When should I use the positive likelihood ratio versus the negative likelihood ratio?
Use the one that matches the result you observed: LR+ after a positive result and LR− after a negative result. They describe different outcomes of the same test, so LR+ should never be applied to a negative result or the reverse. A test with more than two possible results has a separate likelihood ratio for each.
What is the difference between pre-test probability and pre-test odds?
Probability is the chance of the condition out of 1 (or 100%). Odds compare the chance of having it with the chance of not having it. A pre-test probability of 30% is odds of 0.3 ÷ 0.7 = 0.4286, which is about 3 to 7. Likelihood ratios multiply odds, which is why the conversion is part of the calculation.
How do I convert post-test odds into post-test probability?
Divide the odds by 1 plus the odds. Post-test odds of 3.6429 give 3.6429 ÷ 4.6429 = 0.7846, or 78.46%. Odds of 1 correspond to a probability of 50%.
What is the probability of disease after a negative test result?
It is the residual probability: lower than before, but not zero unless the inputs make it so. Starting at 30% with a negative likelihood ratio of 0.1667, the post-test probability is 6.67%. The same negative result leaves 20.0% if you start at 60%, so the starting point matters as much as the test.
Is post-test probability the same as positive predictive value?
Only in a special case. Positive predictive value is the probability of the condition after a positive result in the group the test was evaluated in, so it depends on that group's prevalence. Post-test probability starts from the pre-test probability for the person you are assessing. They match when the two starting points are equal. In the example table the prevalence is 50%, giving a PPV of 89.47%, while a pre-test probability of 30% gives 78.46%.
How is negative predictive value related to disease probability after a negative result?
Negative predictive value is the probability that the condition is absent after a negative result. The post-test probability after a negative result is the probability that it is present. When the pre-test probability equals the prevalence behind the NPV, the post-test probability is 1 minus the NPV. In the example table the NPV is 85.71% and the residual probability is 14.29%.
How do I use a Fagan nomogram to estimate post-test probability?
Mark the pre-test probability on the left scale and the likelihood ratio on the middle scale, then draw a straight line through the two points. The line crosses the right scale at the post-test probability. It is the same odds calculation done graphically, and its accuracy is limited by how precisely you can read the scales.
What happens to post-test probability when the likelihood ratio equals 1?
Nothing changes. The odds are multiplied by 1, so the post-test probability equals the pre-test probability. A likelihood ratio of 1 means the result is equally likely with and without the condition, so it gives no help in telling them apart. Sensitivity and specificity that add up to 100% give a likelihood ratio of 1 for both results.