Sensitivity and specificity calculator

This sensitivity and specificity calculator evaluates a diagnostic test against a reference standard. Enter the true positives, false positives, false negatives and true negatives to get sensitivity, specificity, the predictive values and the likelihood ratios, each proportion with a 95% confidence interval.

Your counts are calculated in your browser and are not sent or stored.

Sensitivity and specificity calculatorOr describe it in Studio →
Disease presentDisease absent
Test positive
Test negative

Top row: true positives, false positives. Bottom row: false negatives, true negatives. “Disease” is whatever the reference standard says.

Fill this in when the study sample does not reflect real-world prevalence, for example a case-control design. The predictive values are then recalculated for it.

MeasureValue95% CI
Sensitivity90.0%82.6% to 94.5%
Specificity96.7%95.3% to 97.7%
Positive predictive value75.0%66.6% to 81.9%
Negative predictive value98.9%97.9% to 99.4%
Likelihood ratio +
27.00 (95% CI 18.88 to 38.62)
Likelihood ratio −
0.10 (95% CI 0.06 to 0.19)
Accuracy
96.0%
Prevalence in this sample
10.0%
Youden’s J
0.867

To report

Sensitivity 90.0% (95% CI 82.6%–94.5%), specificity 96.7% (95% CI 95.3%–97.7%); PPV 75.0%, NPV 98.9%

Check your result: sensitivity uses only the people who have the disease, and PPV only the people who test positive. In the worked example 90 ÷ (90 + 10) = 90.0% and 90 ÷ (90 + 30) = 75.0%. LR+ should equal sensitivity ÷ (1 − specificity): 0.900 ÷ 0.0333 = 27.0.
sensitivity in the worked example
90.0%
sensitivity in the worked example
PPV in the same example, at 10% prevalence
75.0%
PPV in the same example, at 10% prevalence
positive likelihood ratio
27.0
positive likelihood ratio
numbers from one 2 × 2 table, prevalence included
9
numbers from one 2 × 2 table, prevalence included
  • Sensitivity and specificity
  • PPV and NPV, at any prevalence
  • Likelihood ratios, accuracy, Youden’s J
  • 95% Wilson confidence intervals
  • Runs in your browser, free

01

The 2 × 2 table

Disease presentDisease absent
Test positiveTrue positive (TP)False positive (FP)
Test negativeFalse negative (FN)True negative (TN)

sensitivity = TP ÷ (TP + FN) · specificity = TN ÷ (TN + FP)
PPV = TP ÷ (TP + FP) · NPV = TN ÷ (TN + FN)
LR+ = sensitivity ÷ (1 − specificity) · LR− = (1 − sensitivity) ÷ specificity

02

Worked example

A test is applied to 1,000 people, 100 of whom have the disease: 90 true positives, 10 false negatives, 30 false positives and 870 true negatives.

MeasureValue95% CI
Sensitivity90.0%82.6% to 94.5%
Specificity96.7%95.3% to 97.7%
Positive predictive value75.0%66.6% to 81.9%
Negative predictive value98.9%97.9% to 99.4%
Likelihood ratio +27.0
Likelihood ratio −0.10

03

What each measure tells you

  • Sensitivity: of the people with the disease, the share the test detects. A highly sensitive test rarely misses cases, so a negative result helps rule the disease out.
  • Specificity: of the people without the disease, the share the test correctly clears. A highly specific test rarely raises false alarms, so a positive result helps rule it in.
  • PPV and NPV: of those who test positive (or negative), the share for whom the result is right. These are what a patient with a result in hand wants to know.
  • Likelihood ratios: how much a result shifts the odds of disease. They do not depend on prevalence.

04

Predictive values depend on prevalence

Sensitivity and specificity belong to the test. PPV and NPV also depend on how common the disease is in the people tested. Keep the same test (90% sensitive, 96.7% specific) but apply it to 1,000 people of whom only 1% have the disease:

PrevalenceTPFPFNTNPPVNPV
10%90301087075.0%98.9%
1%933195721.4%99.9%

At 1% prevalence nearly four in five positives are false. You do not need to rebuild the table to see this: enter the prevalence of the setting where the test will be used in the optional box, and the calculator recomputes PPV and NPV for it. Predictive values from a study only carry over to settings with a similar prevalence; from a case-control design they are not meaningful at all.

05

Confidence intervals

The likelihood ratios get intervals by the log method: exp(ln LR ± 1.96 × SE), with SE(ln LR+) = √(1/TP − 1/(TP + FN) + 1/FP − 1/(FP + TN)). In the example LR+ is 27.0 (18.9 to 38.6) and LR− is 0.10 (0.06 to 0.19). Each proportion gets a Wilson score interval, which behaves well for values near 0% or 100% and for small groups: see the confidence interval calculator for the formula. A sensitivity estimated from 20 diseased people has a wide interval however good the point estimate looks.

06

Common mistakes with sensitivity and specificity

  • Carrying a PPV to another population. The same test, 90% sensitive and 96.7% specific, has a PPV of 75.0% at 10% prevalence but 21.4% at 1%.
  • Reading sensitivity as the chance that a positive result is right. In the worked example sensitivity is 90.0% but PPV is 75.0%: one positive in four is false.
  • Judging a test by its accuracy. At 10% prevalence, calling everyone negative is 90.0% accurate; this test is 96.0% accurate.
  • Using a simple (Wald) interval on small counts. For 9 of 10 cases detected it runs from 71.4% to 108.6%, past 100%; the Wilson interval used here gives 59.6% to 98.2%.

Trust

How this page is checked

  • The calculation runs on code with automated tests against worked reference values. Every number in the examples on this page was produced by that same code, not typed by hand.
  • The formulas and conventions used are stated on the page, so you can reproduce the result yourself or compare it with your own software.
  • Last reviewed by the Sciloom team, Zebra Nine Studio Inc. It is a tool for research and teaching, not a substitute for a statistician, a validated lab method or medical advice.

Cite this page

Sciloom. (2026). Sensitivity and specificity calculator. Zebra Nine Studio Inc. https://sciloom.si/sensitivity-specificity-calculator

Read the full methodology · Who makes Sciloom

Frequently asked questions

How do I calculate sensitivity and specificity?

Sensitivity is true positives divided by everyone with the disease (TP + FN). Specificity is true negatives divided by everyone without it (TN + FP).

What is the difference between sensitivity and PPV?

Sensitivity starts from people who have the disease and asks how many test positive. PPV starts from people who test positive and asks how many have the disease. PPV changes with prevalence; sensitivity does not.

What is a good likelihood ratio?

A positive likelihood ratio above about 10 or a negative one below about 0.1 shifts the probability of disease substantially. Values near 1 barely change it.

What is Youden’s J?

Sensitivity plus specificity minus 1. It runs from 0 for a useless test to 1 for a perfect one and is often used to choose a cut-off.

Planning a diagnostic accuracy study? The sample size calculator estimates how many participants a proportion needs.
Free to start, no sign-up.
Back to the tool ↑

More research tools