Intermediate

Sensitivity and Specificity Calculator

Enter the four cells of a 2×2 confusion matrix (TP, FP, FN, TN) and instantly compute sensitivity, specificity, positive and negative predictive values, accuracy, F1, likelihood ratios, and Youden's J — all the key metrics for evaluating a diagnostic test or classifier.
Disease present, test positive
Disease absent, test positive
Disease present, test negative
Disease absent, test negative
Sensitivity
80%

True positive rate — proportion of positives correctly detected

Specificity
90 %
Accuracy
85 %
PPV (precision)
88.89 %
NPV
81.82 %
F1 score
84.21 %
Youden's J
0.7
LR+ (positive likelihood ratio)
8
LR− (negative likelihood ratio)
0.22
40%
5%
10%
45%
TP
FP
FN
TN
Confusion matrix breakdown: TP · FP · FN · TN

85%

accuracy

Correct (TP + TN)

85%

Incorrect (FP + FN)

15%

Step by step
  1. 1

    Total actual positives (TP + FN)

    80 + 20 = 100
  2. 2

    Sensitivity = TP ÷ (TP + FN)

    80 ÷ 100 = 80
    Proportion of real positives correctly detected by the test.
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

From four confusion-matrix cells (TP, FP, FN, TN): sensitivity = TP/(TP+FN), specificity = TN/(TN+FP), PPV = TP/(TP+FP), NPV = TN/(TN+FN), accuracy = (TP+TN)/total. Also computes F1, likelihood ratios (LR+, LR−) and Youden's J. PPV/NPV depend on disease prevalence in the tested cohort.

Formula
Sensitivity = TP/(TP+FN) • Specificity = TN/(TN+FP) • PPV = TP/(TP+FP) • NPV = TN/(TN+FN)
How this is calculated

A 2×2 confusion matrix divides the outcomes of a binary test into four cells: true positives (TP — correctly flagged positive), false positives (FP — wrongly flagged positive), false negatives (FN — missed positive), and true negatives (TN — correctly cleared). Every diagnostic performance metric derives from these four numbers.

Sensitivity (= TP/(TP+FN), also called recall or true positive rate) answers "of all actual positives, how many did the test find?" Specificity (= TN/(TN+FP), true negative rate) answers "of all actual negatives, how many did the test rule out?" PPV (positive predictive value, = TP/(TP+FP)) answers "if the test is positive, how likely is disease?" and NPV (negative predictive value, = TN/(TN+FN)) answers the reverse. Accuracy is the fraction of all cases classified correctly.

Likelihood ratios (LR+ = sensitivity/(1−specificity), LR− = (1−sensitivity)/specificity) summarise diagnostic usefulness independent of prevalence. Youden's J = sensitivity + specificity − 1 is a single number that ranges from 0 (no better than chance) to 1 (perfect), useful for optimising a cut-off threshold. All metrics assume fixed prevalence matching the test cohort — PPV and NPV change if the tool is used in a population with different disease prevalence.

Frequently asked questions

A test with high sensitivity catches almost all true positives but also produces many false alarms (low specificity). It is good for ruling out disease (a negative result is reliable) but a positive result must be confirmed by a more specific test.

PPV and NPV depend on the proportion of positives in the tested population. A test with 95% sensitivity and 95% specificity applied to a disease with 1% prevalence gives a PPV of only ~16% — most "positive" results are false alarms. Sensitivity and specificity themselves are prevalence-independent.

Youden's J = sensitivity + specificity − 1. It ranges from 0 to 1 and captures the overall discriminative power of a test in one number. It is commonly used to select the optimal decision threshold on an ROC curve — the threshold that maximises J.

Also known as

sensitivity specificity calculator
confusion matrix calculator
ppv npv calculator
diagnostic test accuracy calculator
true positive false positive rate
likelihood ratio calculator
youden j statistic
f1 score diagnostic

APA

TG we-Calculate Editorial Team. (2026). Sensitivity and Specificity Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/sensitivity-and-specificity-calculator

Chicago

TG we-Calculate Editorial Team. "Sensitivity and Specificity Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/sensitivity-and-specificity-calculator.

IEEE

TG we-Calculate Editorial Team, "Sensitivity and Specificity Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/sensitivity-and-specificity-calculator

BibTeX

@misc{wecalculate_sensitivity_and_specificity_calculator, title = {Sensitivity and Specificity Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/sensitivity-and-specificity-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?