Skip to calculator

Specificity Calculator

Calculate specificity from confusion matrices, labels, or probabilities, compare thresholds and classes, inspect related metrics, then export clear machine learning evaluation results instantly online.

Calculation Result

Example result uses TN = 90 and FP = 10.

Good
Specificity / True Negative Rate 90.0000% 0.9000
False Positive Rate 10.0000% FPR = 1 − specificity
True Negatives 90.0000 Correct negative rejections
False Positives 10.0000 Negative cases predicted positive
Sensitivity / Recall Undefined Positive-class detection rate
Accuracy 90.0000% Overall correct predictions
Balanced Accuracy Undefined Mean sensitivity and specificity
Youden’s J Undefined Sensitivity + specificity − 1
Formula: Specificity = TN ÷ (TN + FP)
Specificity = 90.0000 ÷ (90.0000 + 10.0000) = 0.9000

Good: The model controls false positives well.

Specificity Inputs

Choose a mode. The calculator validates values and preserves submitted data.

Actual negatives predicted negative.
Actual negatives predicted positive.
Other labels become negative.

Threshold Analysis

Compare thresholds, inspect the sensitivity-specificity trade-off, and locate the highest Youden’s J value.

Run analysis to find a suggested threshold.
ThresholdSpecificitySensitivityFPRYouden’s JTNFP

Multiclass One-vs-Rest Specificity

Build a square confusion matrix. Each class becomes positive while all remaining classes become negative.

ClassTNFPTPFNSpecificityWeight
Macro AverageEqual
Weighted AverageSupport
Micro AggregatePooled one-vs-rest counts

Micro averaging in multiclass one-vs-rest pools duplicated negative decisions. Interpret it with care.

Batch Model Comparison

Paste one model per line using Model, TN, FP, TP, FN. TP and FN may be zero.

ModelSpecificityFPRSensitivityBalanced AccuracyYouden’s J

Formula Used

Specificity = True Negatives ÷ (True Negatives + False Positives)

Specificity measures correct rejection of actual negative cases. It is also called the true negative rate. Higher values indicate fewer false positive decisions.

How to Use

  1. Select the calculation mode matching your available data.
  2. Enter confusion counts, paired labels, or probabilities.
  3. Choose precision and submit the main calculator.
  4. Review specificity, related metrics, formula steps, and interpretation.
  5. Use threshold, multiclass, or batch tools when needed.
  6. Copy, print, or export the completed analysis.

Example Data

MeasureValueMeaning
True Negatives90Ninety negative cases were rejected correctly.
False Positives10Ten negative cases were classified positive.
Specificity90%The model correctly rejects nine of ten negatives.
False Positive Rate10%One of ten negatives becomes a false alarm.

Metric Guide

MetricFormulaPurpose
SpecificityTN / (TN + FP)Measures negative-class rejection.
SensitivityTP / (TP + FN)Measures positive-class detection.
PrecisionTP / (TP + FP)Measures positive prediction reliability.
Negative Predictive ValueTN / (TN + FN)Measures negative prediction reliability.
Balanced Accuracy(Sensitivity + Specificity) / 2Balances both classes.
Youden’s JSensitivity + Specificity − 1Supports threshold selection.
MCCCorrelation from all four countsSummarizes binary classification quality.

Export Preview

Specificity Calculator
Specificity: 90.0000%TN: 90.0000FP: 10.0000

Frequently Asked Questions

What does specificity measure?

Specificity measures how often actual negatives are predicted negative. It focuses only on negative cases. Higher specificity means fewer false alarms.

Is specificity the same as precision?

No. Specificity starts with actual negative cases. Precision starts with predicted positive cases.

What is a good specificity score?

The required score depends on application risk. Some screening systems accept lower specificity. High-cost false alarms usually require stronger specificity.

Can specificity equal one hundred percent?

Yes. This happens when false positives equal zero. Actual negative cases must still exist.

Why is specificity undefined sometimes?

Specificity needs actual negative observations. TN plus FP must exceed zero. Otherwise, the denominator becomes zero.

How does threshold affect specificity?

A higher positive threshold usually increases specificity. Fewer cases receive positive predictions. Sensitivity may decrease at the same time.

How is multiclass specificity calculated?

Each class is compared against all remaining classes. This creates one-vs-rest counts. The calculator then reports per-class specificity.

Should I use macro or weighted averaging?

Macro averaging treats every class equally. Weighted averaging reflects class support. Use both when class imbalance matters.

Can weighted sample counts be entered?

Yes. Decimal counts are accepted. They can represent weighted observations or aggregated sample mass.

Related Calculators

Confusion Matrix CalculatorClassification Accuracy CalculatorRecall CalculatorSensitivity CalculatorFalse Positive Rate CalculatorFalse Negative Rate CalculatorMatthews Correlation Coefficient CalculatorBalanced Accuracy CalculatorLog Loss CalculatorBinary Cross-Entropy Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.