Sensitivity & specificity calculator

Calculates sensitivity, specificity, predictive values, likelihood ratios and kappa from a 2×2 table or per-sample results, and compares two tests with McNemar's test.

Last updated

Data

Input method

Assign variables

Glossary

    Downloading results is a member feature

    Sign up for free to download results as Excel, CSV and reports. The values you have entered can be loaded on this screen right after you sign up.

    How to use

    1. Per-sample data: enter one sample per row with the reference (true status) and the test result. Positive / Negative, 1 / 0, + / −, Pos / Neg and Detected / Not detected are recognized.
    2. If two tests (e.g. your kit and a comparator kit) were run on the same samples, also assign the test B column. The tool compares the two tests' sensitivity and specificity as paired data (McNemar's test).
    3. If you only have counts, use Enter a 2×2 table and type in TP, FP, FN and TN.
    4. PPV and NPV depend on the proportion of positives in your sample. If you know the prevalence in the real-world setting, enter it under "Set prevalence manually" to recalculate.
    5. Press Run analysis; members can save the results with Export to Excel.

    Reading a 2×2 table

    True positive True negative
    Test positive TP (true positive) FP (false positive)
    Test negative FN (false negative) TN (true negative)

    Interpreting the results

    Sensitivity = TP ÷ (TP + FN): the ability not to miss true positives. Specificity = TN ÷ (TN + FP): the ability to call true negatives negative.

    When the reference is another approved product (comparator method) rather than a confirmed diagnosis, the same calculations are called positive percent agreement (PPA), negative percent agreement (NPA) and overall percent agreement (OPA). The results table shows both names.

    Judge performance by the lower limit of the 95% confidence interval rather than the point estimate. For example, if the target is "sensitivity of at least 95%", check whether the lower confidence limit exceeds that threshold.

    Cohen's kappa is agreement beyond what would be expected by chance. Values of 0.81 or more indicate almost perfect agreement, 0.61–0.80 substantial, 0.41–0.60 moderate, 0.21–0.40 fair and 0.20 or less slight agreement.

    Comparing two tests: McNemar's test looks only at samples where the two tests disagree. P ≥ 0.05 means there is no evidence that the two tests' sensitivities (or specificities) differ. That does not prove they are "the same"; to claim equivalence, also check whether the 95% confidence interval of the difference lies within a pre-specified acceptable range.

    Notes on use

    Values you enter are calculated in your browser. Only settings a member chooses to save are stored in their account. This is a reference calculator; confirm results used for regulatory submissions or quality records with internally validated software or procedures.

    References

    • McNemar Q. Note on the sampling error of the difference between correlated proportions or percentages. Psychometrika. 1947;12(2):153-157.
    • Cohen J. A coefficient of agreement for nominal scales. Educational and Psychological Measurement. 1960;20(1):37-46.
    • Clopper CJ, Pearson ES. The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika. 1934;26(4):404-413.

    Frequently asked questions

    What is the difference between sensitivity and specificity?

    Sensitivity is the proportion of true positives correctly called positive, and specificity is the proportion of true negatives correctly called negative. Low sensitivity means more false negatives; low specificity means more false positives.

    Why does the positive predictive value depend on prevalence?

    Even for the same test, when prevalence is low, false positives make up a larger share of positive results. This tool lets you set the prevalence and recalculate the predictive values.

    Why use McNemar's test to compare two tests?

    Because the data are paired: the same samples were measured with both tests. McNemar's test compares the two tests using only the samples on which they disagree.

    Comments

    Loading.