Sensitivity & Specificity Calculator

Find a test's sensitivity and specificity.

How it is calculated

You enter the four cells of a 2×2 table of counts: TP (true positives), FN (false negatives), TN (true negatives) and FP (false positives). The tool then calculates sensitivity = TP ÷ (TP + FN), specificity = TN ÷ (TN + FP) and accuracy = (TP + TN) ÷ (TP + FN + TN + FP), each multiplied by 100 and shown as a percentage with two decimals. The inputs are numbers of people or cases, not percentages. There is no result if a count is negative, if there are no actual positives (TP + FN = 0) or if there are no actual negatives (TN + FP = 0). The tool does not give predictive values; those depend on how common the condition is in the group tested.

Worked example

A screening test is checked on 300 people: 100 have the condition and 200 do not. The test flags 90 of the 100 (TP = 90, FN = 10) and correctly clears 160 of the 200 (TN = 160, FP = 40). Sensitivity = 90 ÷ 100 = 90.00%. Specificity = 160 ÷ 200 = 80.00%. Accuracy = (90 + 160) ÷ 300 = 83.33%. So the test misses 1 in 10 real cases and wrongly flags 1 in 5 healthy people.

Try this example →

Common mistakes

  • Putting the cells in the wrong places. Swapping FN and FP is the most common error, and it turns a test that misses cases into one that raises false alarms.
  • Typing percentages instead of counts. If you type 90, 10, 80 and 20 from a published sensitivity and specificity, the tool treats them as 200 people split evenly, so the accuracy is wrong whenever the real groups differ in size.
  • Reading accuracy as the whole story. When the condition is rare, a test can have high accuracy and still miss most real cases, so look at sensitivity and specificity separately.
  • Assuming sensitivity tells you the chance that a positive result is correct. That is the positive predictive value, which this tool does not calculate and which depends on prevalence.

Sources

About this calculator

This calculator finds a diagnostic test's sensitivity (the true positive rate, TP/(TP+FN) — the fraction of actually-positive cases the test correctly flags), specificity (the true negative rate, TN/(TN+FP) — the fraction of actually-negative cases it correctly clears), and overall accuracy from a 2×2 confusion matrix of true and predicted outcomes. High sensitivity means few real cases are missed; high specificity means few healthy people are falsely flagged — and the two typically trade off against each other depending on where a test's decision threshold is set.

Clinicians and epidemiologists use these figures to judge whether a screening test is reliable enough for a given disease's prevalence, medical device and lab-test manufacturers report them to regulators as part of validation, and public-health officials use them when deciding whether to roll out a mass-screening program. Data scientists building machine-learning classifiers use the exact same math — under the names recall and true-negative rate — to evaluate model performance, and biostatistics students use this calculator to work through confusion-matrix problems.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Accuracy can look excellent while sensitivity is useless. If a test finds none of 10 real cases and correctly clears 990 healthy people, accuracy is 99.00% but sensitivity is 0.00%, which is why you should read all three numbers together. Predictive values would also need how common the condition is, and this tool does not compute them. What kind of test or classifier are you evaluating?

Popular calculators

All Calculators