Sensitivity and Specificity Calculator

Quick answer

The sensitivity and specificity calculator evaluates a diagnostic test from its true and false positives and negatives. It gives sensitivity, specificity, likelihood ratios, positive and negative predictive values, accuracy, F1, Youden’s index and the diagnostic odds ratio, at the table’s prevalence or one you enter.

Sensitivity (recall, true positive rate)
90 %
Specificity (true negative rate)
95.5556 %
Prevalence used
10 %
Positive predictive value (PPV, precision)
69.2308 %
Negative predictive value (NPV)
98.8506 %
Positive likelihood ratio (LR+)
20.25
Negative likelihood ratio (LR−)
0.1047
Accuracy
95 %
F1 score
0.7826
Youden’s index (J)
0.8556
Diagnostic odds ratio
193.5

Sensitivity and specificity are the two basic measures of a diagnostic test. Sensitivity is the share of people with the condition whom the test correctly flags (the true positive rate); specificity is the share of people without it whom the test correctly clears (the true negative rate). Both are properties of the test itself and do not depend on how common the condition is.

Patients and doctors, however, need predictive values: given a positive result, how likely is the condition (PPV), and given a negative, how likely is it absent (NPV)? These do depend on prevalence. By default the calculator uses the prevalence found in your table, which is right when the table is a random sample of the population. If the test was validated on a selected group (for example equal numbers of cases and controls), enter the real-world prevalence instead and the predictive values and accuracy are recalculated.

Likelihood ratios summarise the test in a prevalence-free way and feed directly into post-test probability calculations. Youden’s index (sensitivity + specificity − 1) and the diagnostic odds ratio give single-number summaries for comparing tests.

How to use the Sensitivity and Specificity Calculator

  1. True positives (TP)
  2. False positives (FP)
  3. False negatives (FN)
  4. True negatives (TN)
  5. Prevalence for predictive values
  6. Population prevalence

Results update as you type, and everything is calculated in your browser.

How it works

Sensitivity and specificity come straight from the table. Predictive values are computed with Bayes’ theorem from sensitivity, specificity and the prevalence chosen, which reproduces TP/(TP + FP) and TN/(TN + FN) when the table’s own prevalence is used.

Worked example

A test on 1,000 people gives TP = 90, FP = 40, FN = 10, TN = 860. Sensitivity = 90 ÷ 100 = 90%; specificity = 860 ÷ 900 = 95.56%. LR+ = 0.9 ÷ 0.0444 = 20.25 and LR− = 0.1 ÷ 0.9556 = 0.1047, so the diagnostic odds ratio is 193.5. At the table’s 10% prevalence PPV = 90 ÷ 130 = 69.23% and NPV = 860 ÷ 870 = 98.85%; accuracy is 95%. If the real prevalence is 5%, PPV falls to 51.59%.

The 2 × 2 table

Condition present Condition absent
Test positive True positive (TP) False positive (FP)
Test negative False negative (FN) True negative (TN)
Rate Sensitivity = TP/(TP + FN) Specificity = TN/(TN + FP)

Inputs explained

Field What to enter
True positives (TP) A number
False positives (FP) A number
False negatives (FN) A number
True negatives (TN) A number
Prevalence for predictive values Choose one: Use the prevalence in my table, Enter the population prevalence
Population prevalence In %

What each result means

  • Sensitivity (recall, true positive rate) = [True positives (TP)]÷([True positives (TP)] + [False negatives (FN)])×100
  • Specificity (true negative rate) = [True negatives (TN)]÷([True negatives (TN)] + [False positives (FP)])×100
  • Positive predictive value (PPV, precision) = [Sensitivity (recall, true positive rate)]×[Prevalence used]÷([Sensitivity (recall, true positive rate)]×[Prevalence used] + (100 – [Specificity (true negative rate)])×(100 – [Prevalence used]))×100
  • Negative predictive value (NPV) = [Specificity (true negative rate)]×(100 – [Prevalence used])÷([Specificity (true negative rate)]×(100 – [Prevalence used]) + (100 – [Sensitivity (recall, true positive rate)])×[Prevalence used])×100
  • Positive likelihood ratio (LR+) = [Sensitivity (recall, true positive rate)]÷(100 – [Specificity (true negative rate)])
  • Negative likelihood ratio (LR−) = (100 – [Sensitivity (recall, true positive rate)])÷[Specificity (true negative rate)]
  • Accuracy = ([Sensitivity (recall, true positive rate)]×[Prevalence used] + [Specificity (true negative rate)]×(100 – [Prevalence used]))÷100
  • F1 score = 2×[Positive predictive value (PPV, precision)]×[Sensitivity (recall, true positive rate)]÷([Positive predictive value (PPV, precision)] + [Sensitivity (recall, true positive rate)])÷100
  • Youden’s index (J) = ([Sensitivity (recall, true positive rate)] + [Specificity (true negative rate)])÷100 – 1
  • Diagnostic odds ratio = [Positive likelihood ratio (LR+)]÷[Negative likelihood ratio (LR−)]

Formula

Sensitivity = TP ÷ (TP + FN) · Specificity = TN ÷ (TN + FP) LR+ = Se ÷ (1 − Sp) · LR− = (1 − Se) ÷ Sp PPV = Se × Prev ÷ [Se × Prev + (1 − Sp)(1 − Prev)] · NPV = Sp(1 − Prev) ÷ [Sp(1 − Prev) + (1 − Se)Prev]

Worked example

Inputs: True positives (TP): 90; False positives (FP): 40; False negatives (FN): 10; True negatives (TN): 860; Prevalence for predictive values: Use the prevalence in my table.
Results: Sensitivity (recall, true positive rate) = 90 %; Specificity (true negative rate) = 95.5556 %; Prevalence used = 10 %; Positive predictive value (PPV, precision) = 69.2308 %; Negative predictive value (NPV) = 98.8506 %; Positive likelihood ratio (LR+) = 20.25; Negative likelihood ratio (LR−) = 0.1047; Accuracy = 95 %; F1 score = 0.7826; Youden’s index (J) = 0.8556; Diagnostic odds ratio = 193.5.

Key terms

Sensitivity
TP ÷ (TP + FN), the true positive rate.
Specificity
TN ÷ (TN + FP), the true negative rate.
Positive predictive value
The probability of the condition after a positive result.
Negative predictive value
The probability of no condition after a negative result.
Likelihood ratio
How much a result changes the odds of the condition.

Frequently asked questions

What is the difference between sensitivity and specificity?

Sensitivity is the share of sick people who test positive; specificity is the share of healthy people who test negative.

Why is PPV low for rare diseases?

Even a small false-positive rate produces many false positives when most people are healthy. With 90% sensitivity and 95.56% specificity, PPV is 69.2% at 10% prevalence but 51.6% at 5%.

What is "SnNout" and "SpPin"?

A highly Sensitive test, when Negative, rules a condition out; a highly Specific test, when Positive, rules it in.

Do sensitivity and specificity depend on prevalence?

Not in principle: they are conditional on true status. Predictive values and accuracy do depend on prevalence.

What is Youden’s index?

Sensitivity + specificity − 1. It ranges from 0 (useless test) to 1 (perfect) and is used to pick the best cut-off on an ROC curve.

What is the F1 score?

The harmonic mean of precision (PPV) and recall (sensitivity), common in machine learning.

What does a likelihood ratio of 20 mean?

A positive result is 20 times more likely in someone with the condition than without it, which increases the odds twentyfold.

Sources

  1. CDC: Sensitivity, specificity and predictive values (Principles of Epidemiology)
  2. NCBI Bookshelf: Diagnostic testing accuracy: sensitivity, specificity, predictive values and likelihood ratios
  3. scikit-learn: Model evaluation: classification metrics

Cite this calculator

Speedy Calculator. (2026). Sensitivity and Specificity Calculator. Speedy Calculator. https://speedycalculator.com/calculators/statistics/sensitivity-specificity/