Confusion matrix calculator
Build a confusion matrix and precision, recall and F1 from actual vs. predicted labels.
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.