ROC / AUC Calculator
An ROC curve traces the trade-off between the true-positive and false-positive rates as you sweep a classifier's threshold; the AUC summarizes overall discrimination in a single number. Paste outcomes plus predicted scores to get the curve, the AUC with a DeLong confidence interval, three optimal thresholds (Youden, F1, cost-weighted), and a calibration check. Everything runs in your browser.
New to ROC and AUC? Read the 4-min primer
What ROC and AUC mean. A binary classifier produces a score for each case. As you sweep the decision threshold from high to low, you trade specificity for sensitivity. The ROC curve plots the true-positive rate (sensitivity) against the false-positive rate (1 - specificity) at every threshold. AUC is the area under that curve and equals the probability that a randomly drawn positive case scores higher than a randomly drawn negative one. AUC of 0.5 is random; 1.0 is perfect; 0 is perfectly wrong.
How to read the curve and the threshold. The top-left corner is perfect. The diagonal is random. A curve that hugs the top-left has good discrimination. Each point on the curve corresponds to a specific threshold; sliding the threshold trades false alarms for misses. The threshold marker on the curve shows where you currently sit, and the confusion matrix updates so you can see exactly how many TPs, FPs, FNs, and TNs that threshold produces.
Picking the right optimum. Youden's J maximises sensitivity + specificity - 1, which is the same as the point on the curve farthest above the diagonal. F1 maximises 2 P R / (P + R), which weighs precision and recall equally and is preferred when classes are balanced and you want a single score. Cost-weighted minimises FP cost_FP + FN cost_FN, which is the right answer when you can put a number on a missed positive vs. a false alarm. They usually disagree, and that disagreement is information about your problem.
When ROC is the wrong tool. On heavily imbalanced data (positives below 5%), ROC flatters you because changes in FP count barely move the FPR; report a precision-recall curve too. For multi-class problems, ROC is one-vs-rest per class plus a macro average; this tool is binary v1. For survival outcomes use time-dependent ROC. And ROC measures discrimination only; a model can have AUC of 0.9 yet emit miscalibrated probabilities that overstate confidence. The Brier score and reliability bins below catch that.
Try a real-world example to load:
A cleanly separated screening problem. AUC near 0.89.
I want to evaluate a binary classifier and report its AUC with a 95▾% confidence interval.
–
paste data on the left
Paste outcomes (0/1) and predicted scores to see what the AUC means for your data.
Inference
We swept the threshold across all values to compute sensitivity and specificity at every cutoff, summarized as the area under the ROC curve.
How this is computed
✓ No data leaves your browser
✓ Verified against R's pROC package
✓ Free, no sign-up
Calibration: is the probability trustworthy?
AUC measures ranking, not whether a predicted 0.8 really means an 80% event rate. The Brier score and reliability bins catch a well-ranking but overconfident model.
ROC anatomy and the DeLong interval
pROC::ci.auc(method="delong") returns; a logit-scale interval is a different, materially wider estimate.When this is the wrong tool
- If you have…
- Use instead
- Multi-class outcomes (3+ classes)
- This v1 is binary. Compute one-vs-rest ROC per class plus a macro-averaged AUC manually, or pick a one-vs-rest tool. Multi-class is on the roadmap.
- Survival outcomes (time-to-event)
- Use time-dependent ROC (survivalROC, timeROC). The ROC curve becomes a function of horizon t. See the survival analysis tutorial.
- Heavy class imbalance (positives < 5%)
- ROC is misleading because the FPR axis barely moves. Report a precision-recall curve and PR-AUC instead; they show the precision degradation that ROC hides.
- Only a single confusion matrix
- You cannot reconstruct an ROC from one threshold. Use the confusion matrix interpreter for accuracy / precision / recall / MCC at that one threshold.
- Probabilities matter, not ranking
- AUC is invariant under monotonic transforms; a model can have AUC of 0.95 and be wildly miscalibrated. Always look at the Brier score and the reliability diagram above.
Frequently asked questions
What does AUC actually measure?
AUC (area under the ROC curve) is the probability that a randomly chosen positive example has a higher predicted score than a randomly chosen negative example. AUC = 0.5 is random; 1.0 is perfect; 0.7-0.8 is fair, 0.8-0.9 is good. It is threshold-independent: it summarizes performance across every possible cutoff.
How do I choose a classification threshold from an ROC curve?
Pick the threshold that matches your cost function. Equal-cost errors: use Youden's J (max sensitivity + specificity - 1). Asymmetric costs: shift toward fewer false negatives (cancer screening) or fewer false positives (spam filter). This tool shows the Youden, F1 and cost-weighted optima and lets you set any false-negative to false-positive cost ratio.
When does a high AUC not mean a good classifier?
AUC can mislead on imbalanced data: a model may rank well yet still misclassify the minority class at any usable threshold, so also read the precision-recall curve. AUC also ignores calibration: two models with the same AUC can give very different probabilities. Check the Brier score and reliability bins.
What is the DeLong confidence interval, and why not a bootstrap?
DeLong, DeLong & Clarke-Pearson (1988) derive the AUC's variance analytically from its structural components, so the interval is exact and deterministic - it is pROC's default. This tool reports that interval on the AUC scale, clamped to [0, 1]. A browser cannot reproduce pROC's stratified resampling seed-for-seed, so we skip bootstrap here; run ci.auc(method="bootstrap") in R if you need it.
Does my data get uploaded anywhere?
No. Everything runs in your browser with JavaScript. Your pasted outcomes and scores never leave your device, and every displayed number is computed locally and checked against R's pROC package.
Go deeper
Numerical accuracy: AUC is the Mann-Whitney U with mid-rank ties; the DeLong interval is built on the AUC scale and clamped to [0, 1] (exactly what pROC::ci.auc(method="delong") returns, not a logit interval). Optimal thresholds use pROC's midpoint grid. Verified against pROC::auc(), pROC::var(), pROC::ci.auc() and pROC::coords() to 1e-9.