Sensitivity & Specificity Calculator
Sensitivity, specificity and accuracy of a test
Result
How it is calculated
Enter the four cells of the 2×2 table as counts of people: tp (diseased, test positive), fn (diseased, test negative), tn (healthy, test negative) and fp (healthy, test positive). Then:
sensitivity = TP / (TP + FN), specificity = TN / (TN + FP), accuracy = (TP + TN) / (TP + FN + TN + FP)
each shown as a percentage. The counts cannot be negative, and the tool needs at least one diseased person (TP + FN above zero) and at least one healthy person (TN + FP above zero); with only one group it shows nothing. Predictive values are not computed here, because they also depend on how common the condition is in the group tested.
Worked example
300 people were tested: 100 had the condition and 200 did not. The test found 90 of the 100 (TP = 90, FN = 10) and cleared 160 of the 200 (TN = 160, FP = 40).
- Sensitivity = 90 / 100 = 90.00%
- Specificity = 160 / 200 = 80.00%
- Accuracy = (90 + 160) / 300 = 83.33%
The test misses 1 in 10 real cases and wrongly flags 1 in 5 healthy people.
Common mistakes
- Putting percentages or rates in the boxes: they need counts of people, and the percentages are calculated for you.
- Swapping false positives and false negatives, which swaps the sensitivity and specificity story.
- Reading accuracy as the whole picture: if almost everyone is healthy, a test can have high accuracy and still miss most of the sick.
- Treating sensitivity as the chance that a positive result is correct: that is the positive predictive value, which also depends on how common the condition is.
About this calculator
Every diagnostic test is judged against a 2×2 table of true positives, false positives, true negatives, and false negatives, and from those four counts come the metrics that define how good the test actually is: Sensitivity = TP / (TP + FN), the fraction of people who truly have the condition that the test correctly flags, and Specificity = TN / (TN + FP), the fraction of people without the condition the test correctly clears — with overall accuracy = (TP + TN) / total tested.
These two numbers matter for different reasons: high sensitivity is prioritized for screening tests where missing a real case (a false negative) is dangerous, while high specificity is prioritized when a false positive would trigger unnecessary invasive follow-up, which is why the same underlying test math is applied differently to a cancer screen versus a confirmatory diagnostic assay.
Epidemiologists and biostatisticians evaluating new diagnostic tools, laboratory professionals validating assay performance, and medical and public health students learning test-characteristic statistics all use this calculation as the standard first step in judging any diagnostic test's real-world usefulness.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
No calculators found
Comments (0)