Skip to content
100% local

Confusion matrix calculator

Build a confusion matrix and precision, recall and F1 from actual vs. predicted labels.

Input
Output

Confusion matrix calculator

Paste a list of actual and predicted labels and this tool builds the confusion matrix behind them, then derives precision, recall, F1 score and support for every class, plus overall accuracy and macro and weighted averages. It is built for anyone checking a classifier's output by hand: a quick sanity check on a model's predictions, a spreadsheet export from an evaluation run, or a manual review where a human labeled a small batch and you want to compare it against the machine's guesses.

Each line of input is one comparison — the actual value first, then the predicted value, separated by a comma, tab or space ("cat, cat" or "cat cat"). Turn on word mode instead when your data is a single stream of alternating actual/predicted tokens rather than one pair per line. Case-sensitive labels treats "Cat" and "cat" as different classes; leave it off to fold them together. Ignore diacritics normalizes accented letters, useful when the same label was typed two different ways. Sort classes by label or by how often each one appears (support), and set a limit to focus the matrix and metrics table on the most relevant classes when there are many.

Malformed lines — a line with only one token, or an odd token left over in word mode — are skipped and counted separately rather than silently miscounted, and the live tally reports how many pairs were skipped. Input up to several megabytes is handled without freezing the page; anything larger returns a clear message asking you to split it into smaller batches.

Everything runs locally in your browser — labels and predictions are never uploaded anywhere, which makes this safe to use with proprietary model output or unpublished research data. Toggle CSV export to get a plain-text CSV version of the matrix and metrics ready to paste into a spreadsheet, or keep the readable table view. Copy the result, download it as a .txt file, or send it to another tool's input to keep working.

FAQ

What format does the input need to be in?
One comparison per line, actual value first and predicted value second, separated by a comma, tab or space — for example "cat,dog". Switch to word mode if your data is one long stream of alternating actual and predicted tokens instead of separate lines.
How is accuracy different from precision and recall?
Accuracy is the share of all comparisons that matched exactly. Precision and recall are computed per class: precision is how many predictions of a class were correct, and recall is how many actual instances of that class were caught.
What does the limit option do?
It caps how many classes appear in the matrix and metrics table, keeping the ones chosen by the sort order (alphabetical or most common first). Comparisons involving a dropped class are excluded from the totals so the numbers stay consistent.
Can I export the result as CSV?
Yes. Turn on "Export as CSV" to get the confusion matrix and the per-class metrics formatted as CSV, ready to paste into a spreadsheet, instead of the readable table.
Is my data uploaded anywhere?
No. The confusion matrix and every metric are calculated entirely in your browser — your labels and predictions never leave your device.