Confusion Matrix Calculator
Enter your binary classification results to instantly compute all key metrics: Accuracy, Precision, Recall, F1, Specificity, MCC, and Cohen's Kappa. Visual confusion matrix included.
Confusion Matrix Values
Frequently Asked Questions
What is a confusion matrix?▼
A confusion matrix is a table that summarizes the performance of a classification model by showing True Positives (TP), True Negatives (TN), False Positives (FP), and False Negatives (FN). It provides a complete picture of model performance beyond simple accuracy.
What is the difference between Precision and Recall?▼
Precision = TP/(TP+FP) — of all positive predictions, how many were actually positive. Recall = TP/(TP+FN) — of all actual positives, how many did the model find. High precision means fewer false alarms; high recall means fewer missed positives. The right balance depends on your use case.
When should I use F1 score instead of accuracy?▼
Use F1 when your dataset is imbalanced (e.g., 95% negative class). Accuracy on an imbalanced dataset can be misleading — a model predicting all negatives gets 95% accuracy but 0% recall. F1 balances precision and recall and is more meaningful for imbalanced classification problems.
What is Matthews Correlation Coefficient (MCC)?▼
MCC is a balanced metric that considers all four confusion matrix values. It ranges from -1 (perfect inverse prediction) to +1 (perfect prediction), with 0 being random. MCC is considered one of the best single-value metrics for binary classification, especially for imbalanced datasets.
What is Cohen's Kappa?▼
Cohen's Kappa measures agreement between predicted and actual labels while accounting for chance agreement. Values: <0 (worse than chance), 0-0.20 (slight), 0.21-0.40 (fair), 0.41-0.60 (moderate), 0.61-0.80 (substantial), 0.81-1.0 (near perfect). It's useful when comparing models on imbalanced datasets.
Related Products
on GumroadDeveloper Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →You Might Also Need
IP CIDR Calculator
Calculate IPv4 and IPv6 subnet details from CIDR notation. Get network address, broadcast, host range, subnet mask, wildcard mask, and binary representation.
Open free tool →
IPv4 Subnet Calculator
Calculate IPv4 subnet details from CIDR notation. Get network address, subnet mask, broadcast address, first/last host, and total usable hosts instantly. Free online tool.
Open free tool →
Age Calculator
Calculate exact age in years, months, and days from a birthdate. Shows total days/weeks lived, next birthday countdown, day of week born, Chinese zodiac, and Western zodiac sign.
Open free tool →
More Free Tools
Related Articles
DSPy: Building Self-Optimizing LLM Pipelines in 2026
DSPy 2026: build self-optimizing LLM pipelines with signatures, modules, and teleprompters. Real-world examples vs manual prompting for developers.
DuckDB vs PostgreSQL for Analytics: When to Choose Each 2026
DuckDB vs PostgreSQL 2026: OLAP vs OLTP, query performance on large datasets, Parquet/CSV support, and when to choose DuckDB for analytics workloads.
The Rust Ecosystem in 2026: Frameworks, Libraries, and Community
Explore the vibrant Rust ecosystem in 2026 covering web frameworks like Actix and Axum, async runtimes including Tokio, WebAssembly tools, database drivers, CLI libraries, game development with Bevy, and machine learning frameworks.
LLM Fine-tuning Complete Guide: When to Fine-tune vs RAG vs Prompting (2026)
A practical guide to LLM fine-tuning in 2026: when fine-tuning actually makes sense, step-by-step PEFT/LoRA and QLoRA walkthrough, OpenAI fine-tuning API, cost estimates, and how to evaluate if it worked.
LLM Fine-tuning Guide 2026: LoRA, QLoRA & PEFT for Production
Complete guide to LLM fine-tuning in 2026: LoRA vs QLoRA vs PEFT techniques, Hugging Face training, cost comparison with RAG, practical use cases, and production deployment of fine-tuned models.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →