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

Using the example values (press “Load example” above to try them):

  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.

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

Evaluating classifiers

Summarising precision and recall in one score.

Imbalanced classes

Scoring a model when accuracy would be misleading.

Choosing a trade-off

Using F2 when missed positives cost more, or F0.5 when false alarms do.

Reporting model results

Giving F1 alongside precision and recall.

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.

Related calculators

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