ThisCalculator

Everyday

Calculate True Positive and False Positive Rates

Updated · Standard formula, shown below

True positive rate 80.00 %
False positive rate
20.00 %
Result
Positive predictive value
80.00 %
Result
True positives
80 count
You entered

Calculate True Positive and False Positive Rates

This calculator works out true positives and false positives from a test’s results and the known outcomes. Enter the numbers of positive and negative test results, then get the true-positive rate and false-positive rate as percentages.

Formula

The true-positive rate (TPR), also called sensitivity or recall, is the number of true positives divided by all actual positives. The false-positive rate (FPR) is the number of false positives divided by all actual negatives:

  • TPR = TP ÷ (TP + FN) × 100%
  • FPR = FP ÷ (FP + TN) × 100%

Here, TP means true positives, FP means false positives, FN means false negatives, and TN means true negatives. Each input is a count, so all four must use the same counting unit and refer to the same group and evaluation period. The calculator also reports positive predictive value (PPV), which answers a different question: among positive test results, what share are true positives? Its formula is TP ÷ (TP + FP) × 100%.

Worked Example

Using the default counts, there are 80 true positives, 20 false positives, 20 false negatives, and 80 true negatives.

  1. Actual positives = TP + FN = 80 + 20 = 100.
  2. TPR = 80 ÷ 100 × 100% = 80.00%.
  3. Actual negatives = FP + TN = 20 + 80 = 100.
  4. FPR = 20 ÷ 100 × 100% = 20.00%.
  5. All positive results = TP + FP = 80 + 20 = 100, so PPV = 80 ÷ 100 × 100% = 80.00%.

What True and False Positives Mean

These terms compare a test’s result with a reference outcome, sometimes called the ground truth. A positive result says that the test detected the condition or category being checked. A true positive is a positive result when the reference outcome is positive; a false positive is a positive result when the reference outcome is negative.

The complete set of outcomes is often displayed as a confusion matrix:

  • True positive (TP): test says positive; reference says positive.
  • False positive (FP): test says positive; reference says negative.
  • False negative (FN): test says negative; reference says positive.
  • True negative (TN): test says negative; reference says negative.

For example, in a system that flags potentially unwanted messages, a correctly flagged unwanted message is a true positive. A legitimate message incorrectly flagged is a false positive. Which outcome counts as “positive” depends on the question being studied; it does not automatically mean good, bad, safe, or dangerous.

How to Interpret the Rates

A TPR of 80% means that the test identified 80 of every 100 actual positive cases in the evaluated group. The remaining 20% were false negatives. An FPR of 20% means that 20 of every 100 actual negative cases were incorrectly called positive. Its complement, specificity, is 1 − FPR, or 80% in this example.

These rates use different denominators. TPR is calculated among actual positives; FPR is calculated among actual negatives. They are not the percentage of all test results that are correct or incorrect. That overall proportion is accuracy: (TP + TN) ÷ (TP + FP + FN + TN). Accuracy can be misleading when one outcome is much more common than the other.

PPV is also not the same as TPR. PPV starts with positive test results and asks how many are correct; TPR starts with actual positive cases and asks how many the test catches. In the example, the rates happen to be equal, but that is not generally true.

When to Use These Measures

TPR and FPR help describe how a classifier or screening test performs at a particular decision threshold. They are useful when comparing systems, reviewing a chosen threshold, or explaining the two kinds of errors separately. A lower threshold often labels more cases positive: this may raise TPR, but it can also raise FPR. The best balance depends on the task and the consequences of each type of error.

For a fair comparison, use the same definition of positive, reference standard, population, and evaluation method. Report the underlying counts as well as percentages. A rate based on 8 of 10 cases can look identical to one based on 800 of 1,000, but the smaller sample is generally less informative and more sensitive to individual observations.

Common Errors and Limitations

  • Swapping denominators: TPR uses TP + FN, while FPR uses FP + TN. Do not divide both by the total number of observations.
  • Confusing false-positive rate with false discovery rate: FPR is FP ÷ (FP + TN). The false discovery rate is FP ÷ (TP + FP), or 1 − PPV.
  • Ignoring class prevalence: TPR and FPR alone do not tell you the chance that a positive result is correct. PPV depends on how common actual positives are in the group being assessed.
  • Using mismatched counts: All four counts should come from the same dataset and label definition. Comparing counts from different populations can produce meaningless rates.
  • Rounding too early: Keep full precision during calculations and round only the displayed percentage. The calculator shows two decimal places.
  • Dividing by zero: If there are no actual positives, TPR is undefined; if there are no actual negatives, FPR is undefined. If there are no positive results, PPV is undefined. A blank or unavailable rate is not zero.

These measures describe observed performance, not certainty about future cases. Results can change when the population, data quality, reference labels, or operating threshold changes. They also do not establish why errors occur or whether a particular threshold is appropriate.

Frequently Asked Questions

How do I calculate a true positive?
A true positive is a count, not a rate: count the cases where both the test and the reference outcome are positive. To calculate the true-positive rate, divide that count by all actual positives, TP + FN, and multiply by 100%.

What is the false-positive rate formula?
FPR = FP ÷ (FP + TN) × 100%. The denominator is all actual negatives, including those correctly identified as negative.

Is false-positive rate the same as false discovery rate?
No. FPR divides false positives by all actual negatives. False discovery rate divides false positives by all positive test results. The latter equals 1 − PPV.

Can I calculate these rates from accuracy alone?
No. Accuracy gives the share of all cases classified correctly, but it does not show how errors are divided between false positives and false negatives. You need the four confusion-matrix counts, or equivalent information.

Why can a positive result still be unlikely to be a true positive?
When actual positives are uncommon, even a modest FPR can produce many false positives relative to true positives. PPV depends on prevalence as well as TPR and FPR, so it can differ substantially between populations.

Related

Formula used
in tp | True positives | count | 80 | 0
in fp | False positives | count | 20 | 0
in fn | False negatives | count | 20 | 0
in tn | True negatives | count | 80 | 0
out tpr | True positive rate | % | tp / (tp + fn) * 100 | 2
out fpr | False positive rate | % | fp / (fp + tn) * 100 | 2
out ppv | Positive predictive value | % | tp / (tp + fp) * 100 | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.