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.
True positive rate — proportion of positives correctly detected
85%
accuracyCorrect (TP + TN)
85%
Incorrect (FP + FN)
15%
- 1
Total actual positives (TP + FN)
80 + 20 = 100 - 2
Sensitivity = TP ÷ (TP + FN)
80 ÷ 100 = 80Proportion of real positives correctly detected by the test.
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
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
TG we-Calculate Editorial Team. (2026). Sensitivity and Specificity Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/sensitivity-and-specificity-calculator
TG we-Calculate Editorial Team. "Sensitivity and Specificity Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/sensitivity-and-specificity-calculator.
TG we-Calculate Editorial Team, "Sensitivity and Specificity Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/sensitivity-and-specificity-calculator
@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?
