How this instrument works
Sensitivity and specificity are the two headline measures of how well a diagnostic or classification test performs, and they answer two different questions. Sensitivity (also called the true positive rate or recall) asks: of everyone who actually has the condition, what fraction did the test correctly flag as positive? Specificity (the true negative rate) asks the mirror-image question: of everyone who does NOT have the condition, what fraction did the test correctly flag as negative?
Both are computed from the same 2x2 grid of outcomes — true positives (TP), false positives (FP), true negatives (TN), and false negatives (FN) — that any binary test produces once you know both the test result and the actual truth. Sensitivity = TP / (TP + FN), looking only at the row of people who are actually positive. Specificity = TN / (TN + FP), looking only at the row of people who are actually negative. Because each ratio only ever looks at one of those two rows, sensitivity and specificity are independent of how common the condition is in the population being tested — unlike measures such as accuracy or positive predictive value, which shift depending on prevalence.
This calculator reports both figures side by side from one shared set of TP/FP/TN/FN counts, computing the exact same two ratios this site's separately-shipped sensitivity and specificity calculators each compute on their own — this page exists as the single combined view for anyone who wants both numbers from one input pass rather than filling out two separate forms.
- Enter the count of correctly identified positive cases into True positives (TP).
- Enter the count of cases wrongly flagged positive into False positives (FP).
- Enter the count of correctly identified negative cases into True negatives (TN).
- Enter the count of cases wrongly flagged negative into False negatives (FN).
- Read Sensitivity (recall / true positive rate) — the share of actual positives the test correctly caught.
- Read Specificity (true negative rate) — the share of actual negatives the test correctly cleared.
Worked example — TP=50, FP=10, TN=30, FN=5
Enter 50 into True positives (TP), 10 into False positives (FP), 30 into True negatives (TN), and 5 into False negatives (FN). The instrument computes each ratio from its own row of the 2x2 table.
Sensitivity (recall / true positive rate) reads 0.909091 — of the 55 people who are actually positive (TP + FN = 50 + 5), the test correctly flagged 50, or about 91%. Specificity (true negative rate) reads 0.750000 — of the 40 people who are actually negative (TN + FP = 30 + 10), the test correctly cleared 30, or 75%. The test here is noticeably better at catching true positives than at ruling out true negatives.
Questions
What's the difference between sensitivity and specificity?
Sensitivity measures how well a test catches people who actually have the condition (a high-sensitivity test rarely misses real cases, minimizing false negatives). Specificity measures how well a test clears people who actually don't have the condition (a high-specificity test rarely raises a false alarm, minimizing false positives). A test can be strong in one and weak in the other — there's no rule that both have to move together.
Why do sensitivity and specificity use different denominators?
Because each one is scoped to a different group of actual truth. Sensitivity only looks at people who are truly positive (TP + FN is the whole group of actual positives), while specificity only looks at people who are truly negative (TN + FP is the whole group of actual negatives). Using the row of actual truth as the denominator — rather than the row of test results — is exactly what makes both measures unaffected by how common the condition is in the tested population.
How is this different from the confusion-matrix calculator?
This calculator computes the same underlying sensitivity and specificity ratios as this site's separate sensitivity and specificity calculators, bundled onto one page so both numbers come from a single set of TP/FP/TN/FN inputs. This site's confusion-matrix calculator takes the same four counts but reports a broader set of classification metrics — accuracy, precision, recall, and F1 score in addition to specificity — for anyone who needs the fuller picture rather than just these two.
Why does sensitivity plus specificity not need to add to 100%?
Because they're computed from entirely different groups (actual positives vs. actual negatives) with no arithmetic relationship forcing them to sum to any particular value. A test could have 95% sensitivity and 60% specificity, or 99% sensitivity and 99% specificity — the two numbers are independent measures of two different kinds of accuracy, not two halves of a single total.
Do sensitivity and specificity depend on how common the condition is?
No, and that's exactly what makes them useful for describing a test's intrinsic performance. Because each is calculated only within its own row of actual truth (all actual positives, or all actual negatives), the underlying prevalence of the condition in the tested group doesn't enter the formula. This is different from predictive values (like positive predictive value), which do shift with prevalence even when the test itself hasn't changed.