2×2 Test Accuracy

Turns a 2×2 table into sensitivity, specificity and predictive values, each with a confidence interval.Enter the four counts in the 2×2 table below.

This tool describes how a test performed across a set of samples. Do not use it to decide anything about an individual patient.

The 2×2 table

Fill all four cells to get results. The margins fill themselves in.

Rows are the result of the test being evaluated, columns are the reference standard. Each of the four inner cells holds a count.
Test result against conditionCondition presentCondition absentTotal
Test positiveTrue positive (a)False positive (c)
Test negativeFalse negative (b)True negative (d)
Total
%

Left empty, it is read off the table. Fill it in when the samples were not collected in the proportion the population has.

How this is worked out

The figures themselves are all standard arithmetic. What differs between rows is how the confidence interval is arrived at, and the Method column says which one applied to which row rather than leaving you to look it up.

A row with an empty interval is not a fault. One of three words appears there — “no denominator” means the quantity is not defined because there was nothing to divide by, “supplied value” means the prevalence was typed in and so carries no sampling error, and “not estimable” means the figure sits at 0 or at infinity, where the log and logit scales have no room.

A cell holds up to 10,000,000. That is a limit of the routine this tool uses rather than of the exact method itself — on tables far larger than the cap its interval was found to drift without complaining, so a larger table is refused rather than answered wrongly. Within the allowed range the values were checked against an independent calculation.

  • Sensitivity, specificity, prevalence and accuracy — the exact (Clopper-Pearson) interval. All four are proportions counted straight off the table, which is the situation the exact method is for.
  • Positive and negative predictive value — the logit method. Its variance carries no prevalence term, which is what lets a supplied prevalence produce an interval at all. When the value reaches exactly 0% or 100% the logit becomes infinite and the exact interval on the same count takes over.
  • Positive and negative likelihood ratio — the log scale, using the same two variances as the predictive values.
  • With a supplied prevalence, accuracy becomes a weighted average of sensitivity and specificity. It is no longer a count out of a total, so the exact method has nothing to work on and no interval is shown.

Common questions

References

Where the reference values and the confidence-interval methods come from. Sensitivity, specificity and the other measures are proportions counted straight from the table and are not cited.

  1. MedCalc Software Ltd. Diagnostic test evaluation calculator (MedCalc Statistical Software). Output obtained by the requester for the same 2×2 table, captured 2026-07-30.https://www.medcalc.org/calc/diagnostic_test.phpThe reference values — eight measures and their 95 % confidence intervals for one 2×2 table (93, 0, 2, 645), to two decimals. The 1.96 interval coefficient was fixed as the value that reproduces this output
  2. Clopper CJ, Pearson ES. (1934) The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika 26(4):404–413.doi:10.1093/biomet/26.4.404The exact confidence interval used for sensitivity, specificity, prevalence and accuracy

The logit and log intervals for the predictive values and likelihood ratios are the standard delta-method intervals and are not separately cited.

Often used together