F1 Score & Confusion Matrix Calculator

From a confusion matrix (TP, FP, FN, TN) calculate precision, recall, F1 score, accuracy, specificity and the Matthews correlation coefficient.

Results

Enter your details and click Calculate to see your results.
About This Calculator

Precision = TP/(TP + FP); recall = TP/(TP + FN); F1 = 2·P·R/(P + R), the harmonic mean of the two.

Example

Example: TP 80, FP 20, FN 10, TN 90 → F1 = 0.84210526.

Assumptions

Binary classification.

Frequently Asked Questions

When is F1 better than accuracy?

When classes are imbalanced — accuracy can look high while the model misses the rare class.

Related Calculators

About the Author

Imran Hossain
Imran Hossain

Professional SEO, Digital Marketer Specialist

I am a Certified Google Ads Expert And Professional SEO, Digital Marketing Specialist

View full profile