Study and Productivity

Sensitivity, Specificity, PPV and NPV: How to Judge a Diagnostic Test

What sensitivity, specificity, predictive values and likelihood ratios mean, why PPV falls when a condition is rare, and how to get them with intervals.

Saizul Amin
Saizul Amin7 Nov 2026 · 4 min read
Sensitivity, Specificity, PPV and NPV: How to Judge a Diagnostic Test

Every screening programme, rapid test and lab assay has to answer the same question: how often is it right? The answer is never a single number. A test can be excellent at finding people who have a condition and poor at clearing those who do not, or the other way round, and the value of a positive result depends on how common the condition is. This guide walks through the standard measures and shows how to calculate them, with confidence intervals, using the free Diagnostic Test Accuracy Calculator.

The 2x2 table

A diagnostic accuracy study compares a new test with a reference standard, the best available way of knowing who truly has the condition. Each person lands in one of four cells. True positives have the condition and test positive. False negatives have it but are missed. False positives test positive without having it. True negatives are correctly cleared. Every measure in this article is a ratio of those four counts.

Sensitivity and specificity

Sensitivity is the share of people with the condition who test positive: true positives divided by everyone with the condition. Specificity is the share of people without the condition who test negative. A highly sensitive test rarely misses a case, which makes a negative result reassuring; a highly specific test rarely raises a false alarm, which makes a positive result convincing. Clinicians remember this with the phrases SnNout and SpPin: a sensitive test, when negative, rules out; a specific test, when positive, rules in.

These two measures belong to the test itself. They do not change when the condition becomes more or less common, although they can shift if the test is used on a different kind of patient, for example people with milder disease.

Predictive values

Patients and doctors usually want the reverse question answered. If my test is positive, how likely is it that I have the condition? That is the positive predictive value, true positives divided by all positives. The negative predictive value is true negatives divided by all negatives.

Here lies the most common misunderstanding in medical statistics. Predictive values depend heavily on prevalence. Take a test with 90 percent sensitivity and 95 percent specificity. In a clinic where one person in ten has the condition, two in three positives are genuine. In a general screening programme where only one person in fifty has it, barely more than one in four positives are real, because the 5 percent false positive rate is now applied to a much larger healthy group. The calculator draws this curve across every prevalence and lets you set the value for your own setting.

Likelihood ratios

Likelihood ratios combine sensitivity and specificity into a single number that tells you how much a result should change your belief. The positive likelihood ratio is sensitivity divided by the false positive rate; the negative one is the miss rate divided by specificity. To use them, convert a pre-test probability into odds, multiply by the ratio and convert back. A positive likelihood ratio above 10 or a negative one below 0.1 usually moves the probability enough to change a decision. The calculator does this conversion for any list of pre-test probabilities, in the style of a Fagan nomogram.

Confidence intervals matter

Accuracy studies are often small, and a sensitivity of 80 percent based on 15 patients is far less certain than the same figure based on 1,500. Always report an interval. For proportions the tool offers the Wilson score interval, which behaves well even near 0 or 100 percent, and the Clopper-Pearson exact interval, which is more conservative. Likelihood ratios and the diagnostic odds ratio use intervals calculated on the log scale. If any cell is zero, half a person is added to every cell for those ratios so they stay finite, and the tool tells you when it has done so.

A worked example

The screening example in the tool has 1,000 people, 100 of whom have the condition. The test detects 90 of them and wrongly flags 45 of the 900 others. Sensitivity is 90 percent, with a 95 percent interval of 82.6 to 94.5 percent, and specificity is 95 percent. The positive likelihood ratio is 18 and the negative one about 0.105. In this sample the PPV is 66.7 percent, but at a real-world prevalence of 2 percent it falls to about 27 percent while the NPV climbs to 99.8 percent. The grid of 1,000 people makes the point visually: 18 true positives sit beside 49 false alarms.

Other summary measures

The tool also reports overall accuracy, the Youden index (sensitivity plus specificity minus one), balanced accuracy, the F1 score and the diagnostic odds ratio. Accuracy alone can mislead when the condition is rare, since a test that calls everyone negative scores well; the Youden index and balanced accuracy avoid that trap.

Where the numbers come from

You can type the four counts, build a table from published sensitivity, specificity and prevalence, or import a CSV with one row per person and let the calculator count the cells. Results export as CSV or a printed report. This is a tool for study data and teaching. It is not medical advice, and anyone wondering what their own result means should talk to a doctor, nurse or pharmacist.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages