Files never leave your device

Sensitivity and specificity calculator

Calculate sensitivity, specificity and predictive values from a 2×2 confusion table. Your inputs stay on your device.

Set up your task

Ready. Processing stays in this browser.

How to use Sensitivity and specificity calculator

Take four counts from a confusion table and calculate sensitivity, specificity and both predictive values. Use this for a public-health teaching exercise with a defined reference outcome.

  1. Enter True positives, False positives, True negatives, False negatives.
  2. Use the units shown beside the inputs and compare the first result with your own calculation.
  3. Check the substitution and read the assumptions below before applying the result to a different exercise.

Supported inputs and limits

Use whole counts from a learning dataset. Use a fixed definition of a positive test and a reference result. This tool does not assess individual medical risks.

How it works

Sensitivity = TP/(TP + FN). It uses the people or observations with a positive reference result. Specificity = TN/(TN + FP). It uses the reference-negative group. Multiplying each fraction by 100 expresses it as a percentage. Notice how both measures start from the reference classification.

Predictive values condition on the test result instead. Positive predictive value is TP/(TP + FP), and negative predictive value is TN/(TN + FN). With 80 true positives and 20 false negatives the sensitivity is 80%. With 90 true negatives and 10 false positives the specificity is 90%.

A group can have a zero count. If there were no reference positives, there is no denominator for sensitivity. The result is undefined in that sample, even though the other measures may be calculable. Similarly the choice of a rare outcome can make estimates unstable when there are few observations in the relevant group.

Changing test thresholds or changing who is included can affect the results. Predictive values are especially sensitive to the rate of the outcome in the population measured. Compare the four numbers with their underlying denominators. Individual test interpretation and confidence intervals are outside this teaching calculation.

Public health reference

Example

The pre-filled example starts with “Sensitivity: 80% (80 / 100)”.

True positives
80
False positives
10
True negatives
90
False negatives
20
Sensitivity: 80% (80 / 100)
Specificity: 90% (90 / 100)
Positive predictive value: 88.8888889% (80 / 90)
Negative predictive value: 81.8181818% (90 / 110)
Sensitivity uses the actual positives. Specificity uses the actual negatives.

Questions about Sensitivity and specificity calculator

What is a false positive?

A false positive is positive on the test and negative according to the reference.

Does high specificity mean every positive is correct?

No. The proportion of test positives that are reference positives is positive predictive value, which uses a different denominator.

Which values use the test result as the denominator?

Positive and negative predictive values group observations by the result of the test.

Related tools

Public health and other university calculators

Last updated