Skip to main content
Calcimator

ROC Curve Calculator

Calculate sensitivity, specificity, PPV, NPV, accuracy, F1 score, and approximate AUC from a confusion matrix (TP, FP, TN, FN).

About this calculator

This calculator derives ten diagnostic-test and classifier metrics — sensitivity, specificity, precision (PPV), NPV, accuracy, F1 score, an AUC approximation, Youden's J statistic, and both likelihood ratios — from a four-cell confusion matrix of True Positives, False Positives, True Negatives, and False Negatives. False Positives and True Negatives are genuinely, provably inert on Sensitivity: the formula, tp / (tp + fn), never references either one in code, so no amount of nudging them changes the Sensitivity output at all — this isn't a rounding coincidence, it's a direct consequence of which two variables appear in that line.

True Positives and False Negatives are the two inputs that do move Sensitivity, in opposite directions, with almost identically sized effects under a small nudge at the default confusion matrix — close enough that this calculator does not claim one single input dominates Sensitivity, since which of the two edges out the other can flip on tiny changes to the starting numbers. What the calculator does NOT surface by default: when False Positives is exactly 0 (perfect specificity), the Positive Likelihood Ratio formula produces a true mathematical Infinity internally, which the engine then silently displays as the flat number 9999 rather than any indication that the real value is unbounded.

Inputs

Results

Sensitivity (Recall / TPR)

0.85

Specificity (TNR)

0.95

F1 Score

0.87

Positive Predictive Value (Precision)0.89
Negative Predictive Value0.93
Accuracy0.92
AUC (single-point approx)0.9
Youden's J Statistic0.8
Positive Likelihood Ratio17
Negative Likelihood Ratio0.16
How to Use This Calculator
  1. Enter True Positives (TP), False Positives (FP), and True Negatives (TN).
  2. Set False Negatives (FN).
  3. Review Sensitivity (Recall / TPR), Specificity (TNR), and F1 Score.
  4. Use Positive Predictive Value (Precision) and Negative Predictive Value to inform your decision.
  5. Use the chart to visualize the results and explore different scenarios by adjusting inputs.

How the result changes with True Positives (TP)

True Positives (TP)Sensitivity (Recall / TPR)Specificity (TNR)F1 Score
430.740.950.77
640.810.950.84
1280.90.950.91
2130.930.950.94

What each input means

True Positives (TP)
Number of correctly identified positive cases.
False Positives (FP)
Number of negative cases incorrectly classified as positive (Type I error).
True Negatives (TN)
Number of correctly identified negative cases.
False Negatives (FN)
Number of positive cases incorrectly classified as negative (Type II error).

How this is calculated

Worked example, using the default values

  1. Identify Input Parameters
    4 parameters
    True Positives (TP) = 85, False Positives (FP) = 10, True Negatives (TN) = 190, False Negatives (FN) = 15 = 4 input(s) provided
  2. Calculate Sensitivity
    Sensitivity
    0.85 = 0.85
  3. Calculate Specificity
    Specificity
    0.95 = 0.95
  4. Calculate F1 Score
    F1 Score = f1
    0.8718 = 0.8718
  5. Calculate Positive Predictive Value
    Positive Predictive Value
    0.8947 = 0.8947
  6. Calculate Negative Predictive Value
    Negative Predictive Value
    0.9268 = 0.9268

Engine last updated . Checked against 2 independently-derived tests — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.

Frequently Asked Questions

Why do False Positives and True Negatives never move the Sensitivity value?

Sensitivity is computed directly as tp / (tp + fn) in the engine — a formula that simply never reads falsePositives or trueNegatives at all. Changing either one, by any amount, leaves Sensitivity completely unchanged, because the two variables that actually determine it are True Positives and False Negatives alone.

Which input matters more for Sensitivity: True Positives or False Negatives?

At the default confusion matrix, nudging either one by a small percentage moves Sensitivity by almost exactly the same amount, just in opposite directions — more True Positives raises it, more False Negatives lowers it. Because the two effects are so closely matched here, this calculator doesn't single out one as clearly dominant; which one edges out the other can flip with small changes to the starting counts.

What happens to the Positive Likelihood Ratio if there are zero False Positives?

Mathematically, a False Positive Rate of exactly 0 makes the likelihood ratio formula divide by zero, which the engine computes as true Infinity. Rather than showing that directly, it substitutes the flat number 9999 for display — a real diagnostic test with perfect specificity would show a genuinely unbounded ratio, not a specific finite number.

What does Youden's J Statistic actually measure here?

It's computed as Sensitivity plus Specificity minus 1, a single number that summarizes how far a test's combined true-positive and true-negative performance sits above what random guessing would achieve. A value of 0 means no better than chance, while the maximum of 1 means the test makes no classification errors in either direction.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Math & Statistics.