Category

Sensitivity and Specificity Calculator — PPV, NPV, Accuracy & Likelihood Ratios

Calculate sensitivity, specificity, accuracy, PPV, NPV, and positive/negative likelihood ratios from a 2x2 diagnostic table. Enter true positives, true negatives, false positives, and false negatives to evaluate any medical test.

0 calculations

Calculation Parameters

Fill the 2×2 table: enter the four counts from your test results.

Enter Parameters

Fill in the form on the left and click "Calculate"

How to Use the Sensitivity and Specificity Calculator

Our sensitivity and specificity calculator is the quickest way to compute all the data needed for medical research statistics and diagnostic test evaluation. With this online tool you can instantly compute sensitivity, specificity, accuracy, PPV, NPV, and both the positive and negative likelihood ratios from a single 2×2 contingency table.

Calculating sensitivity, specificity, PPV, and NPV requires the same four pieces of information:

  • True positive cases (TP) ✅✅ — the number of people with the disease who tested positive.
  • True negative cases (TN) ❌❌ — the number of people without the disease who tested negative.
  • False positive cases (FP) ❌✅ — the number of people without the disease who tested positive.
  • False negative cases (FN) ✅❌ — the number of people with the disease who tested negative.

2×2 Table for Sensitivity and Specificity

The 2×2 table is an easy, visual way to understand all the variables at once:

Tested positive Tested negative Total
Has the disease TP (true positive) FN (false negative) TP + FN
No disease FP (false positive) TN (true negative) FP + TN

TP + FN = total number of people with the disease; TN + FP = total number of people without the disease.

How Do I Calculate Sensitivity?

Sensitivity is the proportion of people with the disease who tested positive, compared with the total number of people who actually have the disease. It answers: "If someone is sick, how likely is the test to catch it?" A highly sensitive test rarely misses true cases.

Formula: Sensitivity = TP / (TP + FN)

How Do I Calculate Specificity?

Specificity is the proportion of healthy people who tested negative, compared with the total number of people who do not have the disease. It answers: "If someone is healthy, how likely is the test to clear them?" A highly specific test rarely gives false alarms.

Formula: Specificity = TN / (TN + FP)

How Do I Calculate the Accuracy of a Test?

Accuracy is the proportion of all results (both positive and negative) that the test got right.

Formula: Accuracy = (TP + TN) / (TP + TN + FP + FN)

How to Calculate Positive Predictive Value? – PPV, NPV

Positive predictive value (PPV) is the probability that a person with a positive test result truly has the disease:

PPV = TP / (TP + FP)

Negative predictive value (NPV) is the probability that a person with a negative test result truly does not have the disease:

NPV = TN / (TN + FN)

Unlike sensitivity and specificity, PPV and NPV depend on the prevalence of the disease in the tested group.

How Do I Calculate Likelihood Ratio?

Likelihood ratios combine sensitivity and specificity into a single number that tells you how much a test result changes the odds of disease.

  • Positive likelihood ratio (LR+): LR+ = Sensitivity / (1 − Specificity) — the higher the value, the more a positive result rules the disease in.
  • Negative likelihood ratio (LR−): LR− = (1 − Sensitivity) / Specificity — the lower the value (closer to 0), the more a negative result rules the disease out.

Worked Example

Suppose a screening test is run on 200 people. The results are TP = 90, FN = 10, FP = 15, TN = 85.

Sensitivity = 90 / (90 + 10)  = 90.00%
Specificity = 85 / (85 + 15)  = 85.00%
Accuracy    = (90 + 85) / 200 = 87.50%
PPV         = 90 / (90 + 15)  = 85.71%
NPV         = 85 / (85 + 10)  = 89.47%
LR+         = 0.90 / (1 − 0.85) = 6.00
LR−         = (1 − 0.90) / 0.85 = 0.12

FAQs

What is the difference between sensitivity and specificity? Sensitivity measures how well a test identifies people who have the condition (few false negatives), while specificity measures how well it identifies people who don't (few false positives).

Can a test be 100% sensitive and 100% specific? In theory yes, but in practice there is almost always a trade-off — increasing sensitivity usually lowers specificity and vice versa.

Why do PPV and NPV change with prevalence? Because they describe the population being tested, not the test itself. The rarer the disease, the lower the PPV, even for an excellent test.

Related Calculators

Calculation History

Loading...