What Is Specificity?
Specificity, also called the true negative rate, measures how well a test or classifier correctly identifies negative cases. It answers the question: "Of all the subjects who truly do not have the condition, what fraction did the test correctly label as negative?" Specificity is a core metric in medical diagnostics, epidemiology, and machine-learning classification, complementing sensitivity (the true positive rate).
How to Use This Calculator
Enter two counts from your confusion matrix: the number of True Negatives (TN) — negative cases correctly identified — and the number of False Positives (FP) — negative cases incorrectly flagged as positive. The calculator returns specificity both as a decimal proportion and as a percentage.
The Formula Explained
$$\text{Specificity} = \frac{\text{TN}}{\text{TN} + \text{FP}} \times 100\%$$ The denominator \(\text{TN} + \text{FP}\) is the total number of actual negative cases. A specificity of 1.0 (100%) means the test never produced a false positive. A lower value means more healthy or negative subjects were incorrectly flagged.
Worked Example
Suppose a screening test is given to 100 healthy people. It correctly clears 80 of them (TN = 80) but wrongly flags 20 as positive (FP = 20). $$\text{Specificity} = \frac{80}{80 + 20} = \frac{80}{100} = 0.80$$ or 80%. So the test correctly identifies 80% of truly negative individuals.
FAQ
What is a good specificity value? Higher is better; values close to 1.0 (100%) indicate few false alarms. The acceptable threshold depends on the cost of false positives in your application.
How is specificity different from sensitivity? Specificity measures correct identification of negatives (TN rate), while sensitivity measures correct identification of positives (TP rate). Together they describe a test's overall accuracy.
What if TN and FP are both zero? Specificity is undefined because there are no actual negative cases; the calculator returns 0 to avoid division by zero.