Sensitivity And Specificity

Free online sensitivity and specificity calculator. Compute diagnostic test performance metrics including sensitivity, specificity, PPV, NPV, accuracy, and likelihood ratios from confusion matrix inputs with chart.

Calculate sensitivity and specificity of diagnostic tests

About This Calculator

The Sensitivity and Specificity Calculator is an essential tool for medical researchers, clinicians, epidemiologists, and data scientists who need to evaluate the performance of diagnostic tests. By entering the four values from a confusion matrix — true positives (TP), false negatives (FN), false positives (FP), and true negatives (TN) — you can instantly compute critical test performance metrics including sensitivity, specificity, positive predictive value (PPV), negative predictive value (NPV), accuracy, positive likelihood ratio (LR+), and negative likelihood ratio (LR−).

Methodology

Sensitivity (true positive rate) is calculated as TP / (TP + FN) and measures how well a test identifies actual positive cases. Specificity (true negative rate) is calculated as TN / (TN + FP) and measures how well a test identifies actual negative cases. PPV is TP / (TP + FP), representing the probability that a positive test truly indicates disease. NPV is TN / (TN + FN), representing the probability that a negative test truly indicates absence of disease. Accuracy is (TP + TN) / total, and likelihood ratios combine sensitivity and specificity to quantify how much a test result changes disease odds.

Regional Notes

Diagnostic test evaluation standards are globally consistent. The same formulas apply across India, the US, and the UK. However, disease prevalence — which affects PPV and NPV — varies by region and population. For example, tuberculosis screening in India may have different predictive values than in the US or UK due to differing prevalence rates. The confusion matrix method used here gives direct PPV and NPV that reflect the tested sample's prevalence. For prevalence-adjusted calculations, use the sensitivity and specificity values with Bayes' theorem.

Frequently Asked Questions

What is sensitivity in diagnostic testing?

Sensitivity, also called the true positive rate (TPR), measures the proportion of actual positives that are correctly identified by the test. It is calculated as TP / (TP + FN). A highly sensitive test rarely misses positive cases, making it useful for screening where missing a diagnosis could be harmful.

What is specificity in diagnostic testing?

Specificity, also called the true negative rate (TNR), measures the proportion of actual negatives that are correctly identified by the test. It is calculated as TN / (TN + FP). A highly specific test rarely produces false positives, making it useful for confirming a diagnosis after a positive screening result.

How do you calculate positive predictive value (PPV)?

PPV is the probability that a person with a positive test result actually has the disease. It is calculated as TP / (TP + FP). Unlike sensitivity and specificity, PPV depends on disease prevalence — a test with high sensitivity and specificity can have low PPV when the disease is rare.

What is the difference between sensitivity and PPV?

Sensitivity measures how well the test identifies diseased individuals (TP / (TP + FN)), while PPV measures how likely a positive test actually means disease (TP / (TP + FP)). Sensitivity is a property of the test itself, while PPV depends on disease prevalence in the population being tested.

What is a likelihood ratio in diagnostic testing?

A likelihood ratio (LR) tells us how much a test result changes the odds of having a disease. The positive likelihood ratio (LR+) = sensitivity / (1 - specificity) — higher values indicate a better positive test. The negative likelihood ratio (LR−) = (1 - sensitivity) / specificity — values closer to 0 indicate a better negative test. LR+ above 10 and LR− below 0.1 are considered strong evidence.

Can you calculate PPV and NPV without prevalence?

Yes, if you have the raw confusion matrix counts (TP, FN, FP, TN), PPV and NPV are calculated directly from those counts. However, those PPV and NPV values only apply to populations with the same disease prevalence as your sample. For different prevalence levels, you need Bayes' theorem to adjust PPV and NPV using the test's sensitivity and specificity.

How is accuracy calculated for a diagnostic test?

Accuracy is the proportion of all correct results among all test results. It is calculated as (TP + TN) / (TP + FN + FP + TN). While easy to interpret, accuracy can be misleading when classes are imbalanced — for example, a test that simply predicts everyone as negative would have high accuracy if the disease is rare but would miss all positive cases.

What is a good sensitivity and specificity for a diagnostic test?

In general, values above 90% are considered excellent, 80-90% good, and below 70% poor. Screening tests typically prioritize high sensitivity (99%+) to avoid missing cases, while confirmatory tests prioritize high specificity (99%+) to avoid false positives. The ideal balance depends on the clinical context and consequences of false results.