SOLVETUTORMATH SOLVER

Instrument MI-07-173 · Statistics

Specificity Calculator

Enter true negatives and false positives and this instrument reads out specificity — the share of actual negative cases a test or classifier correctly clears.

Instrument MI-07-173
Sheet 1 OF 1
Rev A
Verified
Type 07 — Classification Metrics SER. 2026-07173

Specificity (true negative rate)

0.750000

specificity = TN / (TN+FP)

The working Every figure verified twice
  1. spec = 30 ⁄ (30 + 10) = 0.750000
Worksheet log
  1. No entries yet — change an input to log a scenario.

How this instrument works

Specificity, also called the true negative rate, measures how well a test or classifier correctly clears cases that are actually negative. Out of everyone who genuinely does not have the condition or does not belong to the target class, specificity is the fraction the test correctly calls negative. It only looks at the confusion-matrix row that starts with a real negative: true negatives (TN), correctly cleared, and false positives (FP), wrongly flagged.

A test with high specificity rarely raises a false alarm on someone who is genuinely negative — which matters most wherever a false positive carries a real cost: unnecessary follow-up procedures, wasted investigation time, or needless anxiety in a medical context. A confirmatory test used after an initial positive screen is typically chosen for high specificity, so that only genuine cases proceed to the next, more invasive or expensive step.

Specificity says nothing about how many actual positive cases the test catches — a test that calls everyone negative scores a perfect specificity of 1.0 while missing every real positive case entirely. That's the complementary half of the picture, sensitivity, which this site covers as a companion instrument built on the same TP/FP/TN/FN inputs.

Specificity=TNTN+FP\text{Specificity} = \dfrac{TN}{TN + FP}
TN — true negatives (correctly cleared actual negatives) · FP — false positives (actual negatives wrongly flagged) · specificity is the share of all actual negatives (TN+FP) that were correctly cleared.
  • Enter the count of correctly flagged positive cases into True positives (TP) — kept alongside the other cells for a complete matrix.
  • Enter the count of negative cases wrongly flagged as positive into False positives (FP).
  • Enter the count of correctly cleared negative cases into True negatives (TN).
  • Enter the count of actual positive cases the test missed into False negatives (FN) — likewise recorded for completeness.
  • Read Specificity — the share of all actual negatives (TN + FP) that were correctly cleared.
  • TN and FP must not both be zero — with no actual negative cases in the data, specificity has nothing to measure and the instrument will prompt you to check the counts.

Worked example — 40 actual negative cases in a test set

Enter TN = 30 and FP = 10 (with TP = 50 and FN = 5 filled in for a complete matrix). The test set contains TN + FP = 30 + 10 = 40 actual negative cases in total, and 30 of them were correctly cleared. Specificity reads 0.75 — the test correctly clears 75% of everyone who is truly negative.

The 10 false positives are the cases specificity is built to expose: real negatives the test wrongly flagged. Note how the same 95-case matrix (from the sensitivity worked example on this site) yields a different figure here, because sensitivity and specificity each look at a different row of the confusion matrix and answer a different question.

Questions

What's the difference between specificity and sensitivity?

Specificity measures how well a test correctly clears actual negatives (TN / (TN+FP)) — it's about avoiding false positives. Sensitivity measures how well a test catches actual positives (TP / (TP+FN)) — it's about avoiding false negatives. The two are computed from different rows of the same confusion matrix and can move independently: a test can be very specific but not very sensitive, or the reverse. This site's sensitivity instrument computes the companion figure from the same four inputs.

Why does specificity matter for confirmatory testing?

A confirmatory test is usually run after an initial screen has already flagged someone as positive, so the population being tested at that stage already has a higher share of real positives. A confirmatory test with low specificity would generate a lot of second-round false alarms on people the first screen wrongly flagged, so confirmatory tests are typically chosen or tuned to maximise specificity, accepting a somewhat lower sensitivity in exchange.

Can specificity be 100% without the test being perfect?

Yes. Specificity only looks at how the test performs on actual negative cases — it reaches 1.0 (100%) whenever every true negative is correctly cleared, with zero false positives. It says nothing about false negatives, so a test that calls every case negative, including all the true positives, would also score a perfect 100% specificity while missing every real case. Always check sensitivity alongside it.

Is specificity the same thing as the true negative rate?

Yes, those are two names for the identical quantity: TN / (TN + FP), the share of actual negatives a test correctly identifies as negative. 'Specificity' is the term most commonly used in medicine and diagnostic testing; 'true negative rate' is the equivalent, more literal name used interchangeably in statistics.

What if I don't know the false positive count?

You need it — specificity is undefined without knowing how many actual negatives the test wrongly flagged. If you only know how many positive results the test produced, you're missing the FP count needed here; you'll need the ground-truth outcome for every case in the actual-negative group to build a complete confusion matrix.

References