Harmonic Mean Calculator
Enter two positive values to get their harmonic mean (2ab / (a + b)) — alongside the arithmetic mean — and see why it is the correct average for rates such as speeds.
Two averages at once
Enter both values and the harmonic mean calculator returns the harmonic mean (2ab / (a + b)) together with the arithmetic mean ((a + b) / 2) so you can compare them directly.
Positive values only
The harmonic mean is defined only for positive numbers — enter values greater than zero or the calculator returns no result.
What is the harmonic mean?
The right average for rates
The harmonic mean calculator turns two positive numbers into their harmonic mean, the average that correctly combines rates and ratios rather than plain quantities. While the everyday (arithmetic) mean simply adds the values and halves them, the harmonic mean is the reciprocal of the average of the reciprocals — for two numbers it tidies up to 2ab / (a + b). Its classic use is average speed: if you drive equal distances at two different speeds, the harmonic mean gives the true average speed for the trip, because you spend more time at the slower speed. It also appears in finance (averaging price-to-earnings ratios) and in statistics (the F1 score).
Enter two positive values to get the harmonic mean (2ab / (a + b)) and the arithmetic mean side by side for comparison.
The harmonic mean of two values is twice their product divided by their sum, and the arithmetic mean is simply their sum halved.
H = 2ab / (a + b)Take a = 2 and b = 3. Their product is 2 × 3 = 6, so twice the product is 12, and their sum is 2 + 3 = 5. Dividing gives 12 / 5 = 2.4 — the harmonic mean. The arithmetic mean is (2 + 3) / 2 = 2.5. The harmonic mean comes out a little smaller, and that gap is the whole point: the harmonic mean leans toward the smaller of the two values, which is exactly what averaging rates over a fixed total requires.
The formula is exact, but knowing when the harmonic mean is the right tool matters more than the arithmetic itself.
Positive values, and the right kind of average
The harmonic mean needs both inputs to be strictly positive — a zero or negative value makes the reciprocals undefined, so the calculator returns no result. Reach for it when you are averaging rates over a fixed quantity (equal distances at two speeds, equal investments at two prices); for ordinary quantities the arithmetic mean is correct. The harmonic mean is always less than or equal to the arithmetic mean, with the two equal only when a = b.