F1 Score Calculator

This F1 score calculator finds the harmonic mean of precision and recall. It also gives F-beta variants such as F0.5 and F2 that weight precision or recall more heavily.

β > 1 favours recall, β < 1 favours precision.

Checks on your data

  • F1 ignores true negatives. If correctly rejecting negatives matters too, look at specificity or the full confusion matrix. Open the confusion matrix →
  • Use F2 when missing a positive is worse than a false alarm (screening), and F0.5 when false alarms are worse. Both are in the results.

Results

F1 score
0.75
75 %
F-beta (β = 1)
0.75
same as F1
Precision
80 %
Recall
70.588 %
F2 (recall-heavy)
0.722892
F0.5 (precision-heavy)
0.779221
Arithmetic mean of P and R
0.752941
F1 is never above this
Geometric mean of P and R
0.751469
Precision, recall and the F-scores
00.20.40.60.8Precision: 0.8Precision0.8Recall: 0.705882Recall0.706F0.5: 0.779221F0.50.779F1: 0.75F10.75F2: 0.722892F20.723
F1 as recall varies (precision held at your value)
00.500.20.40.60.81youF1Arithmetic meanRecall
Show step-by-step solution
  1. Precision = TP ÷ (TP + FP) = 60 ÷ 75 = 0.8; recall = TP ÷ (TP + FN) = 60 ÷ 85 = 0.705882.
  2. F1 = 2PR ÷ (P + R) = 2 × 0.8 × 0.70588 ÷ (0.8 + 0.70588) = 0.75.
  3. F-beta = (1 + β²)PR ÷ (β²P + R) = 0.75.
Formula2PR / (P + R)
Range0 to 1
Mean typeHarmonic
IgnoresTrue negatives

What Is F1 Score?

The F1 score combines precision and recall in a single number: F1 = 2 × precision × recall ÷ (precision + recall). Because it uses the harmonic mean, it is pulled down sharply when either precision or recall is low, so a model cannot score well by doing well on only one of them.

The calculator also shows F-beta scores, where beta above 1 weights recall more and beta below 1 weights precision more, and compares the harmonic mean with the arithmetic and geometric means of precision and recall. F1 ignores true negatives, which matters when they are a large share of the data.

Below you will find the formulas, a variables table, a worked example and answers to common questions such as F1 versus accuracy.

How to Use the F1 Score Calculator

  1. Choose counts or precision/recall as the input.
  2. Enter your values; the calculator derives the missing metrics.
  3. Choose a beta if recall or precision matters more than the other.
  4. Compare F1 with the arithmetic mean in the results: a large gap means one of the two is weak.

F1 Score Formula

F1 score

F1=2PRP+R=2TP2TP+FP+FNF_1=\frac{2PR}{P+R}=\frac{2TP}{2TP+FP+FN}

F-beta score

Fβ=(1+β2) PRβ2P+RF_\beta=\frac{(1+\beta^2)\,PR}{\beta^2P+R}

F1 Score Variables Explained

SymbolMeaningNotes
PPrecisionTP ÷ (TP + FP)
RRecallTP ÷ (TP + FN)
F1Harmonic mean of P and R2PR ÷ (P + R)
βWeight of recall relative to precisionβ = 1 gives F1

F1 Score Worked Example

With the example values loaded in the calculator above, the steps are:

  1. Precision = TP ÷ (TP + FP) = 60 ÷ 75 = 0.8; recall = TP ÷ (TP + FN) = 60 ÷ 85 = 0.705882.
  2. F1 = 2PR ÷ (P + R) = 2 × 0.8 × 0.70588 ÷ (0.8 + 0.70588) = 0.75.
  3. F-beta = (1 + β²)PR ÷ (β²P + R) = 0.75.

Result: F1 score = 0.75; F-beta (β = 1) = 0.75.

How to Read F1, F2 and F0.5

With 60 true positives, 15 false positives and 25 false negatives, precision is 60 ÷ 75 = 80% and recall is 60 ÷ 85 = 70.6%. The F1 score is their harmonic mean, 0.75. That is a little below their arithmetic mean of 0.7529, because the harmonic mean is pulled toward the lower of the two numbers.

The F-beta family lets you weight one side more. F2 = 0.7229 puts more weight on recall, the weaker figure here, so it is lower. F0.5 = 0.7792 favours precision, the stronger figure, so it is higher. Pick the version that matches the cost of mistakes: F2 when missing a positive is worse, F0.5 when a false alarm is worse.

Why the harmonic mean?

With the arithmetic mean, precision 1.0 and recall 0.0 would average to 0.5, which looks respectable for a model that finds nothing useful. The harmonic mean punishes that imbalance: the same pair gives an F1 of 0. A model must keep both numbers reasonably high to get a high F1.

Precision and recall vs F1
PrecisionRecallArithmetic meanF1
0.900.900.900.90
0.900.500.700.64
0.990.100.5450.18
1.000.000.500.00

F-beta: tuning the balance

Choose β by how much more you value recall than precision. F2 treats recall as twice as important and suits screening or fraud detection, where missing a case is costly. F0.5 favours precision and suits situations where false alarms are expensive, such as automated enforcement.

Common F-scores
ScoreβEmphasis
F0.50.5Precision
F11Balanced
F22Recall

Limits of F1

  • It ignores true negatives, so it says nothing about how well the negative class is handled.
  • It depends on which class you call positive; swapping classes changes the score.
  • For multi-class problems you must choose how to average: macro (each class equal), micro (pooled counts) or weighted (by class size).
  • MCC or balanced accuracy use all four cells and can be a better single metric.

Where F1 Score Is Used

Classifier evaluation

Compute F1 from TP, FP and FN, or from precision and recall.

Choosing a weight

Use F-beta to favour recall or precision.

Imbalanced data

Use F1 when accuracy would be misleading.

Comparing models

Compare two models on a single balanced score.

Common F1 Score Mistakes to Avoid

  • Specify which class is positive when reporting F1.
  • In multi-class reports state the averaging method.
  • Use F-beta if the costs of the two error types are not equal.
  • Check precision and recall individually, not only their combination.

F1 Score Terms and Definitions

Harmonic mean
The reciprocal of the average of reciprocals; pulled towards the smaller value.
Macro-average
Average of per-class scores, treating classes equally.

F1 Score FAQs

What is the F1 score?

The harmonic mean of precision and recall, a single score from 0 to 1 that is high only when both are high.

How do you calculate F1 from TP, FP and FN?

F1 = 2TP ÷ (2TP + FP + FN).

Is a higher F1 score always better?

Yes, higher is better, but a good value depends on the problem. Compare against a baseline and against the costs of each error type.

What is a good F1 score?

It depends on the task. Above 0.9 is excellent in many settings, 0.7 to 0.9 is good, and anything below 0.5 usually needs improvement, but compare with a baseline model.

What is the difference between F1 and accuracy?

Accuracy counts all correct predictions, including true negatives. F1 looks only at the positive class, which makes it far more informative for rare events.

What is macro vs micro F1?

Macro F1 averages the F1 of each class equally. Micro F1 pools all TP, FP and FN first, so large classes dominate.

What is the F1 score formula in terms of counts?

F1 = 2TP ÷ (2TP + FP + FN). With TP = 60, FP = 15 and FN = 25 that is 120 ÷ 160 = 0.75, the same as the harmonic mean of precision and recall.

Why is F1 a harmonic mean and not a simple average?

The harmonic mean is pulled toward the lower value, so a model cannot hide poor recall behind high precision. In the example the plain average of precision and recall is 0.753 while F1 is 0.750.

When should I use F2 or F0.5 instead of F1?

Use F2 when missing a positive is worse than a false alarm, as in screening. Use F0.5 when false alarms cost more. Beta above 1 weights recall, below 1 weights precision.

Does F1 use true negatives?

No. F1 ignores true negatives, so it can look fine on a model that is poor at identifying negatives. Pair it with specificity or MCC if negatives matter.

Related calculators

Last updated 2026-11-09. See our disclaimer.