Positive Predictive Value Calculator
Enter the confusion-matrix counts to compute PPV and related metrics.
Result
How it is calculated
Enter the four counts of a 2×2 table: TP, FP, FN and TN. The tool returns PPV = TP ÷ (TP + FP), NPV = TN ÷ (TN + FN), sensitivity = TP ÷ (TP + FN) and specificity = TN ÷ (TN + FP), each as a percentage. The inputs are numbers of people or cases, not rates, and none may be negative. If there are no positive results at all (TP + FP = 0) there is no output, because PPV is undefined. For the other three measures, an empty denominator is shown as 0.00% rather than an error, so a 0.00% there may mean no data in that row or column, not a truly poor test.
Worked example
Screening 1,000 people, 50 actually have the condition. The test finds 45 of them (TP = 45, FN = 5) and wrongly flags 15 of the 950 healthy people (FP = 15, TN = 935). PPV = 45 ÷ (45 + 15) = 75.00%. NPV = 935 ÷ 940 = 99.47%. Sensitivity = 45 ÷ 50 = 90.00%. Specificity = 935 ÷ 950 = 98.42%. Even with a specificity of about 98%, one in four positive results here is a false alarm, because the condition is rare in this group.
Common mistakes
- Reusing PPV from one population for another. PPV and NPV depend on how common the condition is, so a value from a hospital clinic does not carry over to general screening; enter counts from the group you care about.
- Swapping FP and FN. This changes PPV into something close to NPV and makes a cautious test look reckless, or the other way around.
- Entering percentages instead of counts. Counts of 90, 10, 80 and 20 are treated as 200 people, which fixes the prevalence at 50% and gives a misleadingly high PPV.
- Reading 0.00% in NPV, sensitivity or specificity as a failed test. It can simply mean that the row or column had no cases to calculate from.
About this calculator
From a 2×2 confusion matrix of true positives (TP), false positives (FP), true negatives (TN) and false negatives (FN), this calculator derives four core diagnostic metrics: positive predictive value PPV = TP/(TP+FP) — the chance a positive result is really positive; negative predictive value NPV = TN/(TN+FN); sensitivity (recall) = TP/(TP+FN); and specificity = TN/(TN+FP).
Unlike sensitivity and specificity, PPV and NPV shift with how common the condition is in the population being tested, which is exactly why they matter in practice. Clinicians and epidemiologists use PPV to judge how much to trust a positive screening result in a given patient population, while data scientists use the same 2×2 breakdown to evaluate a binary classifier's precision and decide whether it's reliable enough to deploy, especially on imbalanced datasets.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
No calculators found
Comments (0)