Sensitivity and Specificity Calculator

Figran

Enter a 2×2 table to get diagnostic accuracy with confidence intervals and a Fagan nomogram.

  • PPV, NPV and likelihood ratios
  • Confidence intervals
  • Fagan nomogram
Input
Test 1

Results

MetricEstimate · 95% CI
Sensitivity90.00%
82.38% – 95.10%
Specificity85.00%
79.28% – 89.65%
Positive predictive value (PPV)75.00%
66.27% – 82.45%
Negative predictive value (NPV)94.44%
90.02% – 97.30%
Positive likelihood ratio (LR+)6.00
4.29 – 8.40
Negative likelihood ratio (LR−)0.12
0.07 – 0.21
Diagnostic odds ratio (DOR)51.00
23.85 – 109.04
Accuracy86.67%
82.29% – 90.30%
Youden J0.75
0.65 – 0.82
Prevalence33.33%
28.02% – 38.98%
Sensitivity, specificity, accuracy and study-based predictive values use the selected binomial interval. External-prevalence predictive values use Mercaldo logit intervals; external accuracy and Youden J combine bounds with a square-and-add approach. Likelihood ratios and DOR use log intervals. A dash means the estimate or interval is unavailable.

Diagnostic accuracy of Index test was assessed against the reference standard in 300 participants (TP 90, FP 30, FN 10, TN 170). Sensitivity was 90.00% (95% CI 82.38%–95.10%) and specificity was 85.00% (95% CI 79.28%–89.65%). PPV was 75.00% (95% CI 66.27%–82.45%) and NPV was 94.44% (95% CI 90.02%–97.30%) at a prevalence of 33.33%. LR+ was 6.00 (95% CI 4.29–8.40) and LR− was 0.12 (95% CI 0.07–0.21). Confidence intervals used the Clopper–Pearson method for sensitivity, specificity and predictive values, and the log method for likelihood ratios.

Chart
Sensitivity 90.00%Specificity 85.00%
Likelihood ratioPre-testLikelihood ratioPost-test0.1%0.1%1%1%5%5%10%10%30%30%50%50%70%70%90%90%95%95%99%99%99.9%99.9%0.0010.010.1110100100033.3%75.0%5.6%Positive test (LR+ 6.00)Negative test (LR− 0.12)

Sensitivity and specificity examples

Load a scenario and adjust the numbers for your study.

Likelihood ratioPre-testLikelihood ratioPost-test0.1%0.1%1%1%10%10%50%50%90%90%99%99%99.9%99.9%0.0010.010.1110100100033.3%65.8%2.6%Positive test (LR+ 3.84)Negative test (LR− 0.05)

High sensitivity

Explore a test designed to miss fewer cases.

100 disease-positive · 200 disease-negative

Likelihood ratioPre-testLikelihood ratioPost-test0.1%0.1%1%1%10%10%50%50%90%90%99%99%99.9%99.9%0.0010.010.1110100100033.3%94.1%9.3%Positive test (LR+ 32.00)Negative test (LR− 0.21)

High specificity

See how fewer false positives affect predictive values.

100 disease-positive · 200 disease-negative

PPV / NPV · Prevalence0%0%25%25%50%50%75%75%100%100%PrevalencePredictive valuePPV 10.91%NPV 99.76%Prevalence 2%

Low-prevalence screening

Compare predictive values across prevalence levels.

External prevalence: 2%

Expected per 1,000 people (counts rounded)Expected per 1,000 people (counts rounded)Disease +Disease −TotalPositive testNegative test1849616704280720Total2008001000280 positive results:184 have the disease (PPV 65.71%)720 negative results:704 do not have the disease (NPV 97.78%)

Reported sensitivity and specificity

Calculate predictive values from sensitivity and specificity without counts.

Sensitivity 92% · specificity 88% · prevalence 20%

Rapid test
Rapid test: Likelihood ratioRapid testPre-testLikelihood ratioPost-test0.1%0.1%1%1%10%10%50%50%90%90%99%99%99.9%99.9%0.0010.010.1110100100033.3%75.0%5.6%Positive test (LR+ 6.00)Negative test (LR− 0.12)
Lab assay
Lab assay: Likelihood ratioLab assayPre-testLikelihood ratioPost-test0.1%0.1%1%1%10%10%50%50%90%90%99%99%99.9%99.9%0.0010.010.1110100100033.3%84.2%9.8%Positive test (LR+ 10.67)Negative test (LR− 0.22)

Compare two tests

View estimates side by side and select a test for the chart.

Two tests · 300 observations each

Likelihood ratioPre-testLikelihood ratioPost-test0.1%0.1%1%1%10%10%50%50%90%90%99%99%99.9%99.9%0.0010.010.1110100100022.5%98.8%3.1%Positive test (LR+ 274.70)Negative test (LR− 0.11)

A zero cell

Inspect a table with no false positives.

0 false positives · 200 observations

How to calculate diagnostic accuracy

Enter your data, examine the estimates, and take the results with you.

  1. 1Enter your data

    Enter a 2×2 table or reported sensitivity and specificity.

  2. 2Set prevalence

    Use the study prevalence or enter an external estimate.

  3. 3Review results

    Read the confidence intervals and choose a chart.

  4. 4Download

    Download a figure or export the results table.

Sensitivity, specificity, PPV and NPV formulas

The reference standard identifies disease status; the test produces positive or negative results. Positive predictive value (PPV) is TP / (TP + FP). The specificity formula is TN / (TN + FP). Predictive values depend on prevalence as well as sensitivity and specificity.

TestDisease +Disease −
Positive testTPFP
Negative testFNTN
SensitivityTPTP + FN
SpecificityTNTN + FP
Positive predictive value (PPV)TPTP + FP
Negative predictive value (NPV)TNTN + FN
PPV from prevalencePPV=Se×pSe×p+(1−Sp)×(1−p)
NPV from prevalenceNPV=Sp×(1−p)(1−Se)×p+Sp×(1−p)
Positive likelihood ratio (LR+)LR+=Se1−Sp
Negative likelihood ratio (LR−)LR−=1−SeSp
Youden JJ=Se+Sp−1

References: Mercaldo et al. (2007) Newcombe (1998) Simel et al. (1991) STARD 2015

How to read a Fagan nomogram

Combine a pre-test probability with a likelihood ratio to find a post-test probability.

Likelihood ratioPre-testLikelihood ratioPost-test0.1%0.1%1%1%10%10%50%50%90%90%99%99%99.9%99.9%0.0010.010.1110100100033.3%75.0%5.6%Positive test (LR+ 6.00)Negative test (LR− 0.12)
123
  1. Start at the pre-test probability on the left.
  2. Follow a line through the likelihood ratio on the middle axis.
  3. Read the post-test probability on the right.

References: Fagan (1975)

Sensitivity and specificity FAQ

What are sensitivity and specificity?

Sensitivity is the proportion of people with disease who test positive; specificity is the proportion without disease who test negative.

How are PPV and NPV calculated?

PPV is the proportion of positive results with disease, and NPV is the proportion of negative results without disease.

Why does PPV change with prevalence?

When disease is less common, false positives can make up a larger share of positive results even if sensitivity and specificity stay fixed.

What are likelihood ratios?

Likelihood ratios compare the probability of a test result in people with and without disease; they update pre-test odds to post-test odds.

How do I use a Fagan nomogram?

Draw a straight line from pre-test probability through the likelihood ratio and read post-test probability where it meets the right axis.

Which confidence intervals are used?

Study-based proportions use Clopper–Pearson or Wilson intervals. External-prevalence predictive values use Mercaldo logit intervals, and likelihood ratios use log intervals.

What happens when a cell is zero?

A 0.5 correction is added to every cell for LR+ if TP or FP is zero, for LR− if FN or TN is zero, and for DOR if any cell is zero. Other estimates use the original counts.

Does this agree with MedCalc?

The point estimates and several intervals agree, but study-based predictive-value intervals use the selected binomial method here; MedCalc uses a fixed-prevalence logit method. External-prevalence accuracy intervals also use different methods.

Are my data uploaded?

No. Calculations and figure generation happen in your browser; the current draft is stored in this browser session.

Can this diagnose a patient?

No. This tool is for research and education and does not provide a diagnosis or medical advice.

Evaluate your test

Calculate diagnostic accuracy and create a figure for your research.

Evaluate your test