Math · Machine learning · ROC and AUC

AUC ROC calculator.

Paste the false positive rate and true positive rate at each threshold and get the area under the ROC curve by the trapezoidal rule. The (0,0) and (1,1) corners are added if missing.

For the ROC points (0,0), (0,0.5), (0.5,0.5), (0.5,1) and (1,1) — the scikit-learn auc documentation example — the area under the curve is 0.75.

AUC = Σ (FPRi − FPRi−1) · (TPRi + TPRi−1) / 2Opened sources 15 October 2026

Advertisement

Inputs

False positive rate first, then true positive rate, both from 0 to 1. Order does not matter; points are sorted by FPR.

Your result

Fill the form and press Calculate.

How it is calculated

An ROC curve plots the true positive rate (TPR = TP/(TP+FN), also recall) against the false positive rate (FPR = FP/(FP+TN)) as the decision threshold moves. scikit-learn's auc function computes the area under any curve "using the trapezoidal rule" and requires the x coordinates to be monotonic; its documented example, fpr = [0, 0, 0.5, 0.5, 1] and tpr = [0, 0.5, 0.5, 1, 1], returns 0.75. This page applies the same rule: after sorting by FPR, each segment adds (ΔFPR) × (TPRleft + TPRright)/2.

Worked example

Points (0,0), (0,0.5), (0.5,0.5), (0.5,1), (1,1): the vertical steps add 0; the segment from FPR 0 to 0.5 at height 0.5 adds 0.25; the segment from 0.5 to 1 at height 1 adds 0.5. Total = 0.75. For one interior point such as (0.3, 0.6), the curve (0,0) → (0.3,0.6) → (1,1) has area 0.3×0.3 + 0.7×0.8 = 0.65.

What AUC means and does not mean

An AUC of 0.5 corresponds to the diagonal (no better than random ranking), 1.0 to a perfect ranking, and below 0.5 to an inverted one. Connecting only a few operating points with straight lines is a coarse approximation of the true curve, and different interpolation (for example the step-wise treatment of tied scores) can shift the area slightly; use the full threshold sweep when you can. AUC summarises ranking quality over all thresholds and says nothing about calibration or the best threshold for your costs.

Sources, opened 15 October 2026: scikit-learn auc; scikit-learn User Guide, Metrics and scoring.

Frequently asked questions

How do you calculate AUC from ROC points?

Sort the points by false positive rate, add (0,0) and (1,1) if they are missing, then sum the trapezoids: ΔFPR times the average of the two TPR values for each segment.

What is a good AUC?

0.5 is random ranking and 1.0 is perfect. What counts as good depends on the problem and the baseline; compare against a simple model on the same data.

Do I need to enter (0,0) and (1,1)?

No. They are added automatically if absent, because every ROC curve starts at (0,0) (nothing predicted positive) and ends at (1,1) (everything predicted positive).

Can AUC be below 0.5?

Yes. It means the scores rank positives below negatives on average. Flipping the sign of the scores would turn AUC into 1 minus the value.

Does this work from raw scores and labels?

This page takes ROC points you already have. To get them, compute TPR and FPR at each threshold, for example with scikit-learn roc_curve, and paste them in.

Learning and planning aid

Results are computed in your browser from the numbers you enter and the formulas described above. Check them against your own evaluation code before relying on them in a paper or a production decision.

Advertisement
Advertisement