The test’s properties, and the population’s, kept apart.
The test, and the population it is used in
A test that is 99% right in both directions. Half of its positives are still wrong, because the condition is rare.
10000 tested · prevalence in this sample 1.0000%
Sensitivity 99.0000%, specificity 99.0000%
Positive predictive value here is 50.0000% — which describes this sample's prevalence, not the test. Change the prevalence below and watch it move while sensitivity and specificity stand still.
Sensitivity
99.0000%
of the sick, found
Specificity
99.0000%
of the well, cleared
PPV, this sample
50.0000%
of positives, truly sick
NPV, this sample
99.9898%
of negatives, truly well
Likelihood ratio +
99.0000
prevalence-free
Likelihood ratio −
0.01010
prevalence-free
Youden's J
0.98000
sens + spec − 1
Matthews (MCC)
0.69993
honest on imbalance
Accuracy
99.0000%
overall correct
Balanced accuracy
99.0000%
mean of sens and spec
F1 score
0.66443
ignores true negatives
False positive rate
1.0000%
1 − specificity
The same test, somewhere else
PPV at this prevalence
50.0000%
most positives are wrong
NPV at this prevalence
99.9898%
a negative rules out
Sensitivity
99.0000%
unchanged — it is the test
Specificity
99.0000%
unchanged — it is the test
Only two of these four numbers moved. Sensitivity and specificity are measured on people whose true status is already known, so they cannot depend on how common the condition is. Predictive values divide by the mix of sick and well in front of you, and that mix is a property of where you are standing.
Points are PPV; the dashed line is NPV. They move in opposite directions, and the steepest part of the PPV curve is at low prevalence — exactly where screening programmes operate, and exactly where a small change in the assumed prevalence changes the meaning of a result the most.
Likelihood ratios are the numbers that travel. LR+ = sensitivity ÷ (1 − specificity) and LR− = (1 − sensitivity) ÷ specificity contain no prevalence at all, so they can be carried from the study population to yours and applied to your own pre-test probability. An LR+ above 10 moves a diagnosis decisively; below 2 it barely moves it. Here LR+ is 99.0000.
What this tool shows
A 99%-sensitive, 99%-specific test has a positive predictive value of 50% at a prevalence of 1% and 9% at 0.1%. Sensitivity and specificity belong to the test; predictive values belong to the test AND the population it is used in. The tool computes both from a 2×2 table, then re-derives the predictive values across the whole prevalence range so the dependence is a curve rather than a caveat.
Sensitivity, specificity, PPV and NPV from a 2×2 table
Predictive values recomputed at any prevalence you name
Positive and negative likelihood ratios, which carry between populations
Youden’s J, balanced accuracy, F1 and the Matthews correlation coefficient
A warning when accuracy is being flattered by class imbalance
The PPV and NPV curves across the full prevalence range
PPV by prevalence Base-rate flagged Likelihood ratios MCC and Youden
PPV is a property of the population, not the test.
Updated 12 September 2026 · Works in any browser, no installation
Sensitivity is the fraction of the sick the test finds; specificity is the fraction of the well it clears. Both are measured on people whose true status is already known, so neither depends on how common the condition is. Predictive values ask the reverse question — given a result, what is the chance it is right — and that is a conditional probability in the other direction, which the prevalence controls.
At a glance
Formula shown
Sensitivity = TP/(TP+FN); specificity = TN/(TN+FP). PPV = TP/(TP+FP); NPV = TN/(TN+FN). At an arbitrary prevalence π: PPV = sens·π / (sens·π + (1−spec)(1−π)), which is Bayes’ theorem written out. LR+ = sens/(1−spec) and LR− = (1−sens)/spec contain no prevalence, so they transfer between populations. Youden’s J = sens + spec − 1. MCC = (TP·TN − FP·FN)/√((TP+FP)(TP+FN)(TN+FP)(TN+FN)).
Scenario support
Screening programme design, interpreting a diagnostic or antigen test, evaluating a classifier on imbalanced data, choosing a decision threshold, comparing a rule-in test against a rule-out test, and reading a validation study.
Educational estimate
Planning support from the values you enter — not professional advice.
Why a 99% test can be wrong half the time
Take a test that is 99% sensitive and 99% specific — better than most tests in routine use. Apply it to 10,000 people where 1% have the condition.
100 people are sick; the test finds 99 of them. 9,900 people are well; the test wrongly flags 1% of them, which is 99 people.
So there are 198 positive results and 99 of them are wrong. The positive predictive value is exactly 50%. A positive result from an excellent test is a coin flip, and nothing is broken.
The arithmetic is just the group sizes. A 1% error rate applied to 9,900 well people produces about as many false positives as a 99% detection rate applied to 100 sick ones. When the well outnumber the sick a hundred to one, a small false-positive rate is not small in absolute terms.
Drop the prevalence to 0.1% and the PPV falls to 9.02%. Nine in ten positives are now wrong. Raise it to 50% and the PPV is 99%. Same test, same instrument, same cut-off.
This is why screening an unselected population is a different problem from confirming a suspicion. A test that performs well in a clinic where a third of patients have the condition can be useless as a mass screen, and the validation study will not say so — because it was run at the clinic’s prevalence.
Four numbers, two of which move
The tool prints sensitivity, specificity, PPV and NPV together, then lets you change the prevalence and watch which ones move. Only two do.
Sensitivity and specificity are measured DOWN the columns of the 2×2 table — among the sick, and among the well. Those groups are defined by the true status, which the test cannot influence, so the proportions are properties of the instrument.
Predictive values are measured ACROSS the rows — among those who tested positive, and among those who tested negative. Those groups are mixtures, and the mixture depends entirely on how many sick and well people were fed in.
That is the whole distinction, and it is the same reversal as P(A|B) against P(B|A). Sensitivity is P(positive | sick); PPV is P(sick | positive). Bayes’ theorem converts one into the other, and prevalence is the term it needs.
So a study reporting only sensitivity and specificity has told you about the test and left you to work out what a result means in your setting. That is the correct division of labour, and it is routinely read as if the study had answered the second question too.
Likelihood ratios are the numbers that travel
If predictive values do not transfer between populations and sensitivity alone does not answer the clinical question, something has to bridge them. Likelihood ratios do.
LR+ = sensitivity ÷ (1 − specificity). It is the factor by which a positive result multiplies the ODDS of the condition, and it contains no prevalence term at all — so it can be carried from the study population to yours.
LR− = (1 − sensitivity) ÷ specificity does the same for a negative result. Both are verified in the suite to be unchanged when the same test is applied at five different prevalences.
The rough scale is worth memorising. An LR+ above 10 moves a diagnosis decisively; 5 to 10 moderately; 2 to 5 slightly; below 2 barely at all. For LR−, below 0.1 rules out decisively and above 0.5 barely helps.
Using them means working in odds, not probabilities. Convert your pre-test probability to odds, multiply by the likelihood ratio, convert back. The tool does this for you in the prevalence panel, which is the same calculation with the conversion hidden.
And a test with an LR+ near 1 adds nothing whatever its sensitivity looks like. A test that is 99% sensitive and 50% specific has an LR+ of 1.98 — it barely moves a diagnosis, despite the impressive-sounding first number.
Accuracy is the measure a useless test can win
A single headline number for a classifier is always tempting and accuracy is the worst candidate for the job.
At 1% prevalence, a test that always answers “negative” is 99% accurate. It detects nothing. Its sensitivity is zero, its PPV is undefined, and its accuracy beats most real tests.
Balanced accuracy refuses that. It averages sensitivity and specificity, so the always-negative test scores exactly 50% — which is what a coin scores, correctly.
Youden’s J is the same idea shifted: sensitivity + specificity − 1, so 0 is worthless and 1 is perfect. It is also the quantity maximised when choosing a threshold from an ROC curve, which makes it the natural summary when a cut-off is being selected.
The Matthews correlation coefficient is the strictest. It uses all four cells and runs from −1 to 1, and it cannot be fooled by any single cell being large. The always-negative test scores 0 on it.
F1 has its own blind spot, in the opposite direction. It ignores true negatives entirely, which makes it useful when the negative class is uninteresting — information retrieval — and misleading when correctly clearing well people is the point of the test.
The tool flags the combination that gives it away: high accuracy with a low Youden’s J means the number is describing your class imbalance rather than your test.
Rule in or rule out: the threshold decides which
Sensitivity and specificity trade against each other along a threshold, and which end you want depends on what a wrong answer costs.
A sensitive test is a rule-out test. It catches nearly everyone who has the condition, at the price of flagging many who do not, so a NEGATIVE result is informative and a positive one needs confirming. Screening tests are built this way deliberately.
A specific test is a rule-in test. It is rarely wrong when positive and misses a lot, so a POSITIVE result confirms and a negative one settles nothing. Confirmatory tests are built this way.
The two presets in the tool show both with the same total sample, and the difference in what each result means is larger than the difference in the headline percentages.
Moving the threshold moves both at once and in opposite directions. That trade-off traced out is the ROC curve, and the area under it summarises the test across every threshold rather than at the one chosen — useful for comparing tests, useless for deciding what to do with a particular result.
The right threshold is a decision about costs, not a statistic. Maximising Youden’s J weights a false positive and a false negative equally, which is almost never true in practice. Where the two errors have different consequences, the optimum moves and no calculator can find it for you.
Reporting a diagnostic evaluation
Five things, and the first two travel while the others do not.
Report sensitivity and specificity with confidence intervals. They are proportions from finite samples, and a sensitivity of 95% from 20 positive cases is much less certain than the same figure from 2,000. Use a Wilson interval, not a Wald one.
Report the likelihood ratios. They are what a reader in a different setting can actually use, and they are omitted far more often than they are included.
Report predictive values WITH the prevalence they came from. A PPV without its prevalence is a number about your sample that reads as a number about the test.
Say how the true status was established. Every figure here depends on a reference standard, and if that standard is itself imperfect the sensitivity and specificity are biased in ways no interval reflects.
And say where the sample came from. A test validated on obvious cases and healthy controls will look far better than it performs on the ambiguous patients it is meant to help — spectrum bias, and it is not visible anywhere in the 2×2 table.
Method. Predictive values at an arbitrary prevalence are computed from Bayes’ theorem rather than rescaled from the observed table, so the sample’s own prevalence never leaks into the answer. The suite pins the headline figures exactly — a 99%/99% test gives a PPV of exactly 50% at 1% prevalence and 9.02% at 0.1% — and verifies as properties that PPV rises monotonically with prevalence across 199 points while NPV falls, and that both likelihood ratios are unchanged when the same test is applied at five different prevalences. The accuracy trap is asserted numerically: a test that never returns positive scores 99% accuracy at 1% prevalence with a sensitivity, a Youden’s J and an F1 of exactly zero. That engine is verified on every change against 75 assertions. The count and the per-case breakdown are published on the formula verification page.
Related calculators
Where this goes next:
Conditional ProbabilityPrints P(A|B) and P(B|A) together, because they are different numbers — on the worked example one is 100 times the other — and checks that your three probabilities describe a world that can exist.
Bayes' TheoremPosterior probability from a prior, sensitivity and specificity — plus the true and false positives per 100,000, because a 99% accurate test for a 1-in-10,000 condition is right 0.98% of the time and the percentage alone does not make that believable.
Wilson Score IntervalWilson, Wald, Agresti-Coull and Clopper-Pearson on one set of counts, with the EXACT coverage each delivers at your sample size — a "95%" Wald interval covers the truth 80.85% of the time at n = 30, p = 0.1.
Odds RatioOdds ratio, relative risk, risk difference and number needed to treat from one 2x2 table — because an odds ratio of 6.00 can describe a relative risk of 1.50.
Relative RiskRisk ratio and odds ratio from one table with the divergence between them plotted: they agree to half a percent at a 1% baseline, and at an 80% baseline the odds ratio is exactly half the risk ratio.
Fisher's Exact TestThe exact p for a 2×2 table under all three two-sided conventions, because they disagree — 0.0406 against 0.0699 on the built-in table, across the 5% line — plus the test's actual size by enumeration, which is 2.30% at a nominal 5%.
An educational tool, not clinical guidance. Every figure here assumes the reference standard used to classify true status was itself correct, and assumes the evaluated sample resembles the population the test will be used in — neither assumption is visible in a 2×2 table, and both fail routinely.
Published sensitivity, specificity, PPV, NPV, likelihood ratios, Youden's J, balanced accuracy, F1 and MCC from a 2x2 table - with the predictive values recomputed across the whole prevalence range rather than left as a caveat.
A 99%-sensitive, 99%-specific test has a positive predictive value of exactly 50% at 1% prevalence and 9.02% at 0.1%. The test did not change; the population did.
Verified as properties that PPV rises monotonically with prevalence across 199 points while NPV falls, and that both likelihood ratios are unchanged when the same test is applied at five different prevalences - which is what makes them the numbers that travel.
The accuracy trap is asserted numerically: a test that never returns positive scores 99% accuracy at 1% prevalence with a sensitivity, a Youden's J and an F1 of exactly zero. The tool flags high accuracy paired with a low J.
Predictive values at an arbitrary prevalence are computed from Bayes' theorem rather than rescaled from the observed table, so the sample's own prevalence never leaks into the answer.
Add this calculator to your site
Responsive embed — and private: nothing your visitors type leaves their browser.