Skip to content
ENExplore Calculators

F1 Score Calculator

Calculate the F1 score, the harmonic mean of precision and recall.

About F1 Score Calculator

The F1 score is the harmonic mean of precision and recall: F1 = 2 × (precision × recall) / (precision + recall). It's computed here directly from true positives (TP), false positives (FP), and false negatives (FN), where precision = TP / (TP + FP) measures how many predicted positives were correct, and recall = TP / (TP + FN) measures how many actual positives were found. The harmonic mean penalizes imbalance between precision and recall more than a simple average would, so F1 is high only when both metrics are reasonably strong — making it a popular single-number summary for classifiers, especially on imbalanced datasets.

Formula

F1 = 2 * (precision * recall) / (precision + recall)

P
Precision = TP / (TP + FP)
R
Recall = TP / (TP + FN)

Worked example

With the default values below, F1 Score Calculator returns F1 Score of 0.8421. Change any input above and every figure here is recalculated in your browser.

Inputs used

True Positives (TP)accepts 0–1,000,000,000
80
False Positives (FP)accepts 0–1,000,000,000
20
False Negatives (FN)accepts 0–1,000,000,000
10

Results

F1 Score
0.8421
Precision
0.80%
Recall
0.89%

Step by step

  1. 1Precision: TP / (TP + FP)= 0.8000
  2. 2Recall: TP / (TP + FN)= 0.8889
  3. 3F1 score: 2 × (precision × recall) / (precision + recall)= 0.8421

Assumptions and limits

  • The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 4 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Why use the harmonic mean instead of the arithmetic mean?

The harmonic mean is much more sensitive to low values, so a classifier with high precision but very low recall (or vice versa) gets a low F1 score, whereas an arithmetic mean would hide that imbalance.

When is F1 more useful than accuracy?

F1 is especially valuable on imbalanced datasets where accuracy can be misleadingly high just by predicting the majority class; F1 forces a balance between catching positives (recall) and avoiding false alarms (precision).

What does an F1 score of 1.0 mean?

A perfect F1 score of 1.0 means both precision and recall are 1.0 — every predicted positive was correct, and every actual positive was found, with no false positives or false negatives.

What's the difference between F1 and F-beta score?

F1 weighs precision and recall equally, while the more general F-beta score lets you weight recall beta times more heavily than precision (beta > 1) or vice versa (beta < 1), useful when one error type matters more than the other.

F1 Score Calculator – Calculate F1 Score & Precision