Sensitivity & Specificity Calculator
How it Works
01Enter 2×2 Table Values
Input TP, FP, FN, TN from your diagnostic test evaluation.
02Compute All Metrics
Sensitivity, specificity, PPV, NPV, and accuracy computed instantly.
03Get Likelihood Ratios
LR+ and LR− quantify diagnostic strength of positive and negative results.
04Youden's Index
J = Sensitivity + Specificity − 1 summarizes overall diagnostic performance.
Introduction
No other two metrics are more fundamental to evaluating a diagnostic test than sensitivity and specificity. Together, they characterize the complete discriminatory ability of a test across all possible outcome combinations. They are properties of the test itself — independent of disease prevalence — making them the gold standard for comparing tests across different populations.
This comprehensive calculator goes beyond simple sensitivity and specificity computation. It computes positive and negative predictive values (which depend on prevalence), positive and negative likelihood ratios (which quantify the diagnostic value of a test result), overall accuracy, and Youden's J index (sensitivity + specificity − 1), a single metric summarizing overall diagnostic performance.
The complete 2×2 table analysis is the foundation of evidence-based medicine, clinical trial analysis, machine learning classifier evaluation, and any binary classification problem. Whether you are evaluating a new COVID-19 test, validating a machine learning model, or assessing a quality control inspection procedure, this calculator provides the complete diagnostic picture.
All results include confidence intervals where applicable, helping you quantify the uncertainty in your estimates based on sample size.
The formula
Sensitivity = TP / (TP + FN)
Specificity = TN / (TN + FP)
PPV = TP / (TP + FP)
NPV = TN / (TN + FN)
Accuracy = (TP + TN) / (TP + FP + FN + TN)
Prevalence = (TP + FN) / Total
Likelihood Ratios:
LR+ = Sensitivity / (1 − Specificity)
LR− = (1 − Sensitivity) / Specificity
Youden's Index:
J = Sensitivity + Specificity − 1
Calculation In Practice
Tested 1,000 patients (500 confirmed positive, 500 confirmed negative):
Sensitivity = 475/500 = 0.950 (95%)
Specificity = 470/500 = 0.940 (94%)
PPV = 475/(475+30) = 93.1%
NPV = 470/(470+25) = 94.9%
Accuracy = (475+470)/1000 = 94.5%
LR+ = 0.95/(1−0.94) = 15.83
LR− = (1−0.95)/0.94 = 0.053
Youden's J = 0.95 + 0.94 − 1 = 0.89
Typical Use Cases
Clinical Diagnostic Test Validation
COVID-19 and Infectious Disease Tests
Machine Learning Model Evaluation
Quality Control Inspection Systems
Security Threat Detection
Technical Reference
Confidence Intervals (Wilson method recommended):
For proportions: use Wilson score or Clopper-Pearson exact method
Key Takeaways
Youden's index (J = Sensitivity + Specificity − 1) provides a single summary of overall test quality, ranging from 0 (no diagnostic value) to 1 (perfect). It is the most commonly used single metric for selecting the optimal classification threshold on an ROC curve.
For decision-making in clinical contexts, always pair these metrics with clinical consequences: what is the harm of a false negative? A false positive? This context determines the optimal sensitivity-specificity tradeoff for any diagnostic test or screening program.