Skip to main content

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.

✓ 8 classification metrics ✓ Visual confusion matrix ✓ Imbalance detection

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.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

IP CIDR Calculator IPv4 Subnet Calculator Age Calculator LLM Context Window Calculator Kubernetes Resource Calculator Test Coverage Calculator API Rate Limit Calculator VLSM Calculator Rate Limit Calculator Kubernetes Resource Quota Calculator Semver Calculator AI Prompt Cost Calculator CSS Specificity Calculator Semantic Version Bumper AI Rate Limit Calculator LLM Prompt Caching Calculator CI/CD Pipeline Cost Estimator Blockchain Transaction Fee Calculator AI Token Cost Calculator Aspect Ratio Calculator chmod Calculator LLM Cost Calculator Kubernetes Resource Estimator Prompt Token Estimator Lighthouse Score Simulator Image Aspect Ratio Calculator Core Web Vitals Calculator Image Compression Estimator OpenAI Token Counter LLM Prompt Cost Calculator AI Agent Memory Planner AI Agent Run Cost Tracker RAG Chunking Calculator Smart Contract Gas Estimator AWS Cost Estimator AWS Lambda Cost Calculator Web Vitals Budget Planner Bundle Size Impact Calculator Game Loop Calculator Token Context Calculator TanStack Query Config Builder Bundle Size Budget Calculator Infrastructure Cost Calculator Core Web Vitals Guide Image Optimizer Checklist CSS Unit Converter Number Base Converter Tech Salary Calculator Word Counter & Text Statistics HMAC Generator Web Vitals Scorer OpenTelemetry Config Generator WCAG Contrast Checker Cron Expression Tester K8s Resource Limits Calculator LLM Token Counter Bundle Size Estimator Vector Embedding Visualizer NPM Bundle Size Estimator Cron Expression Explainer SHA-256 File Checksum Calculator AI Pipeline DAG Builder Solana Program ID Generator Percentage Calculator Date Duration Calculator Bandwidth Calculator Kubernetes Resource Calculator Kubernetes Resource Request Calculator AI Embeddings Dimension Explorer Accessibility Color Contrast Checker Sprite Sheet Coordinate Generator LLM Benchmark Calculator AI Prompt Token Estimator RAG Chunking Calculator Embedding Similarity Calculator Mobile Safe Area Calculator Core Web Vitals Budget Calculator Image Optimization Calculator Password Strength Analyzer Secret Entropy Checker Redis TTL Calculator

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$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.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →