Specificity Calculator

Enter your true positives (TP), false negatives (FN), false positives (FP), and true negatives (TN) from a diagnostic test to calculate specificity, sensitivity, accuracy, PPV, NPV, and likelihood ratios. You can also supply a disease prevalence (%) to get adjusted predictive values. All key statistics appear at once — no extra steps needed.

People with the disease who tested positive.

People with the disease who tested negative.

People without the disease who tested positive.

People without the disease who tested negative.

%

If your sample doesn't reflect real-world prevalence, enter it here to adjust PPV and NPV.

Results

Specificity

--

Sensitivity

--

Accuracy

--

Positive Predictive Value (PPV)

--

Negative Predictive Value (NPV)

--

Positive Likelihood Ratio (LR+)

--

Negative Likelihood Ratio (LR−)

--

Test Result Breakdown

Frequently Asked Questions

What is specificity in a diagnostic test?

Specificity is the proportion of people without a disease who correctly test negative. It is calculated as TN / (TN + FP). A highly specific test has few false positives, making it useful for ruling in a disease when it returns a positive result.

How do I calculate specificity?

Use the formula: Specificity = TN / (FP + TN), where TN is true negatives and FP is false positives. Multiply by 100 to express it as a percentage. For example, if 180 healthy people test negative and 20 test positive, specificity = 180 / (20 + 180) = 90%.

How do I calculate sensitivity?

Sensitivity = TP / (TP + FN), where TP is true positives and FN is false negatives. It measures how well the test identifies people who actually have the disease. A highly sensitive test misses few true cases.

How do I calculate the accuracy of a test?

Accuracy = (TP + TN) / (TP + TN + FP + FN). It represents the overall proportion of correct results across all patients tested, both diseased and healthy. High accuracy is desirable but can be misleading when disease prevalence is very low.

What is PPV and NPV, and how are they calculated?

PPV (Positive Predictive Value) is the probability that a positive test result truly indicates disease: PPV = (Sensitivity × Prevalence) / [(Sensitivity × Prevalence) + ((1 − Specificity) × (1 − Prevalence))]. NPV (Negative Predictive Value) is the probability that a negative result truly rules out disease: NPV = (Specificity × (1 − Prevalence)) / [((1 − Sensitivity) × Prevalence) + (Specificity × (1 − Prevalence))]. Both depend heavily on disease prevalence.

How do I calculate the likelihood ratio?

The positive likelihood ratio LR+ = Sensitivity / (1 − Specificity). The negative likelihood ratio LR− = (1 − Sensitivity) / Specificity. LR+ > 10 or LR− < 0.1 are generally considered strong diagnostic indicators.

Why does prevalence affect PPV and NPV?

Even a highly accurate test produces many false positives when disease prevalence is very low, lowering PPV. Conversely, NPV is high when prevalence is low because most negative results are genuinely true negatives. Always interpret predictive values in the context of the actual prevalence in your population.

What is the difference between sensitivity and specificity?

Sensitivity measures how well a test detects true disease cases (true positive rate), while specificity measures how well it excludes healthy individuals (true negative rate). A highly sensitive test is best for screening to avoid missing cases; a highly specific test is best for confirming a diagnosis.

More Statistics Tools