Skip to content
MoneyDeck

Sensitivity and Specificity Calculator

Get sensitivity, specificity, PPV, NPV and likelihood ratios from a 2×2 table

Updated · Free, no signup

Sensitivity (true positive rate)

90%

Specificity (true negative rate)

96.7%

Positive predictive value (PPV)

75%

Negative predictive value (NPV)

98.9%

Positive likelihood ratio (LR+)

27

Negative likelihood ratio (LR−)

0.103

Accuracy

96%

Prevalence used for PPV/NPV

10%

Diagnostic odds ratio

261

  • A positive result multiplies the pre-test odds by 27.0; LR+ ≥ 10 is generally considered strong evidence to rule in.
  • A negative result multiplies the pre-test odds by 0.10; LR− 0.1–0.2 is a moderate shift.

Test performance

2×2 table

Disease presentDisease absentTotal
Test positive9030120
Test negative10870880
Total1009001,000

About the Sensitivity and Specificity Calculator

This calculator evaluates a diagnostic or screening test from a standard 2×2 table. Enter the number of true positives, false positives, false negatives and true negatives — from a validation study, a journal article or your own audit — and it returns sensitivity, specificity, positive and negative predictive values (PPV and NPV), positive and negative likelihood ratios, overall accuracy, the diagnostic odds ratio and the prevalence in the sample.

Sensitivity and specificity describe the test itself, but predictive values depend heavily on how common the condition is. A test with 97% specificity can still produce mostly false positives when screening a low-prevalence population. Switch on the custom prevalence option to recalculate PPV and NPV for the population you actually test, using Bayes’ theorem with the sensitivity and specificity from your table.

It is useful for medical students learning evidence-based medicine, clinicians appraising a paper, and anyone comparing screening tests. Results describe test performance only; how a result changes management depends on the clinical context and pre-test probability.

With the default inputs, the sensitivity (true positive rate) is 90%. Change any value above to recalculate instantly.

How to use the sensitivity and specificity calculator

  1. 1Enter true positives, false positives, false negatives and true negatives from your 2×2 table.
  2. 2Read sensitivity, specificity, PPV, NPV and the likelihood ratios.
  3. 3Turn on custom prevalence to see predictive values for your own population.
  4. 4Use the likelihood ratios to update a pre-test probability.

Formula and method

Sens = TP ÷ (TP + FN) · Spec = TN ÷ (TN + FP) · PPV = TP ÷ (TP + FP) · NPV = TN ÷ (TN + FN) · LR+ = Sens ÷ (1 − Spec) · LR− = (1 − Sens) ÷ Spec

Sensitivity is the share of people with the condition who test positive, and specificity the share without it who test negative. PPV and NPV are the share of positive and negative results that are correct. Likelihood ratios combine sensitivity and specificity into a single number that converts pre-test odds into post-test odds (post-test odds = pre-test odds × LR). The diagnostic odds ratio is (TP × TN) ÷ (FP × FN), and accuracy is (TP + TN) ÷ total.

With a custom prevalence p, predictive values come from Bayes’ theorem: PPV = Sens·p ÷ [Sens·p + (1 − Spec)(1 − p)] and NPV = Spec(1 − p) ÷ [Spec(1 − p) + (1 − Sens)p]. Otherwise prevalence is taken from the table itself, (TP + FN) ÷ total.

TP, FP
True and false positives
FN, TN
False and true negatives
p
Prevalence or pre-test probability
LR
Likelihood ratio

Worked examples

Validation study of 1,000 patients

Sensitivity is 90 ÷ 100 = 90% and specificity 870 ÷ 900 = 96.7%. Of 120 positive tests, 90 are true (PPV 75%). LR+ = 0.90 ÷ 0.0333 = 27 and LR− = 0.10 ÷ 0.967 = 0.10.

Same test used for screening at 1% prevalence

Sensitivity and specificity do not change, but at 1% prevalence PPV falls to 0.009 ÷ (0.009 + 0.033) ≈ 21.4% — about four in five positives are false — while NPV rises to 99.9%.

Symmetric 90% test

With 50 diseased and 150 healthy people, sensitivity and specificity are both 90%. LR+ = 0.9 ÷ 0.1 = 9 and LR− = 0.1 ÷ 0.9 = 0.11; at 25% prevalence the PPV is 45 ÷ 60 = 75%.

Frequently asked questions

What is the difference between sensitivity and PPV?+

Sensitivity is the probability that a person with the disease tests positive. PPV is the probability that a person who tests positive actually has the disease. Sensitivity is a property of the test; PPV also depends on how common the disease is.

Why does PPV fall when prevalence is low?+

When a condition is rare, even a small false-positive rate applied to the large healthy group produces more false positives than there are true positives. That is why screening tests in low-prevalence populations often need a confirmatory test.

What is a good likelihood ratio?+

As a rule of thumb, LR+ above 10 or LR− below 0.1 produce large, often conclusive changes in probability; 5–10 and 0.1–0.2 moderate changes; 2–5 and 0.2–0.5 small changes; and values near 1 change little.

What do SnNout and SpPin mean?+

They are memory aids: with a highly Sensitive test, a Negative result helps rule the condition out (SnNout); with a highly Specific test, a Positive result helps rule it in (SpPin). They work best with very high values.

How do I use a likelihood ratio at the bedside?+

Convert the pre-test probability to odds (p ÷ (1 − p)), multiply by the likelihood ratio, then convert back (odds ÷ (1 + odds)). For example, 20% pre-test probability with LR+ 9 gives odds 0.25 × 9 = 2.25, or about 69%.

For healthcare professionals and education only. This calculator implements a published formula or score but is not a diagnosis and does not replace clinical judgment. Verify inputs and results against the original source before using them in patient care.

Related tools