Math
Harmonic Mean Calculator
Paste a list of numbers to get their harmonic mean: the count divided by the sum of the reciprocals.
The steps write out each reciprocal, their sum, and the final division, then place the harmonic mean next to the arithmetic and geometric means so you can see the AM ≥ GM ≥ HM inequality in action. The speed mode handles the textbook trip that goes out at one speed and back at another, where the harmonic mean is the true average speed.
Positive numbers separated by commas, spaces, or new lines. Zero is not allowed (its reciprocal is undefined).
Try an example
Result
Harmonic mean
—
- Arithmetic mean
- —
- Geometric mean
- —
- Sum of reciprocals
- —
- AM ≥ GM ≥ HM
- —
Student quick launch
Grade planning, algebra checks, and formulas students reach for most.
Study path
Use this calculator with
Follow these when you want the formula behind the answer, a short lesson, or nearby tools in the same topic.
What the harmonic mean calculator solves
The harmonic mean is the The number you get by flipping a fraction; 3/4 becomes 4/3, and 5 becomes 1/5. of the average of the reciprocals. It is the right average for rates measured over equal amounts of the The top number of a fraction; it counts how many parts you have.: speeds over equal distances, prices per unit when equal money is spent, resistances in parallel, and the F1 score in machine learning. This calculator computes it for any list and shows the reciprocal steps, then lines it up against the arithmetic and geometric means.
Why 48 and not 50: the round-trip problem
Drive 120 miles out at 40 mph (3 hours) and back at 60 mph (2 hours). You covered 240 miles in 5 hours, so the average speed is 48 mph, the harmonic mean, not the arithmetic mean 50. The slower leg takes longer, so it gets more weight. Whenever the quantity you are averaging is a rate and the The bottom number of a fraction; it says how many equal parts make one whole. (here, time) differ while the numerators (distance) match, the harmonic mean is the true average.
| Numbers | Arithmetic mean | Geometric mean | Harmonic mean |
|---|---|---|---|
| 40, 60 | 50 | 48.99 | 48 |
| 1, 4 | 2.5 | 2 | 1.6 |
| 2, 8 | 5 | 4 | 3.2 |
| 1, 2, 4 | 2.333 | 2 | 1.714 |
| 5, 5, 5 | 5 | 5 | 5 |
AM ≥ GM ≥ HM
For positive numbers the three classical means are always ordered arithmetic ≥ geometric ≥ harmonic, with all three equal only when every number is the same. For two numbers there is a neat link: GM^2 = AM × HM. The calculator reports all three so you can check the inequality on your own data.
How to use it
- Choose the list mode and type the numbers, or the speed mode and enter the two speeds.
- Read the harmonic mean, then compare it with the arithmetic and geometric means underneath.
- Open Show the work to see each reciprocal, their sum, and the division; for two numbers the 2ab/(a + b) shortcut is shown too.
How to read the answer
The harmonic mean is always the smallest of the three means and is pulled toward the smallest values in the list, which is why it suits averaging rates where the small values dominate the time spent. If the result equals the arithmetic mean, every value is identical. In speed mode the result is the true average speed of the round trip, and the warning shows how much the naive average overstates it.
Common mistakes and edge cases
- Averaging speeds with the arithmetic mean when the distances are equal; that overstates the average speed.
- Using the harmonic mean when the times (not distances) are equal; then the arithmetic mean is correct.
- Including 0 in the list; 1/0 is undefined and so is the harmonic mean.
- Forgetting the count n on top: HM is n divided by the reciprocal sum, not 1 divided by it.
- Expecting the harmonic mean to be between the geometric and arithmetic means; it is below both.
Worked examples
Harmonic mean of 40 and 60
2 / (1/40 + 1/60) = 48.
Harmonic mean
48
Three numbers
1, 2, 4 → 3 / 1.75 = 1.714…
Harmonic mean
1.714286
All equal
AM = GM = HM = 5.
Harmonic mean
5
Decimals
0.5 and 0.25 → 1/3.
Harmonic mean
0.333333
Single value
The harmonic mean of one number is itself.
Harmonic mean
12
Round trip at 40 and 60
Average speed 48, not 50.
Harmonic mean
48
Contains zero
Undefined.
Harmonic mean
Error
Frequently asked questions
What is the harmonic mean?+
The number of values divided by the sum of their reciprocals: HM = n / (1/x₁ + … + 1/xₙ). For 40 and 60 it is 48.
How do I find the harmonic mean of two numbers?+
Use HM = 2ab / (a + b). For 40 and 60: 2 × 40 × 60 / 100 = 48.
When should I use the harmonic mean instead of the arithmetic mean?+
When averaging rates over equal numerators: speeds over the same distance, cost per item when the same amount of money is spent each time, or precision and recall in an F1 score.
Why is the average speed of a round trip the harmonic mean?+
Because the slower leg takes more time. Total distance divided by total time works out to 2ab/(a + b) when both legs cover the same distance.
Can the harmonic mean be larger than the arithmetic mean?+
Not for positive numbers. AM ≥ GM ≥ HM always, with equality only when all values are equal.
What is the harmonic mean if one value is zero?+
Undefined, because 1/0 does not exist. Some texts define it as 0 in the limit, but strictly it is undefined.
What is the geometric mean, and how does it relate?+
The nth root of the product. For two positive numbers, GM² = AM × HM, so the geometric mean sits between the other two.
About this calculator
- Written by
- mathcheck editorial team
- Last reviewed
- September 4, 2026
Method
- Uses the values entered by the user and stable formulas documented on the page.
Related calculators
Reciprocal Calculator
Find the reciprocal (multiplicative inverse) of an integer, decimal, fraction, or mixed number as an exact fraction, a mixed number, and a decimal, with the conversion steps and the check x × 1/x = 1.
Geometric Mean Calculator
Calculate the geometric mean of positive values with log-safe product-root steps.
Average Calculator
Calculate arithmetic, weighted, geometric, or harmonic averages from a list of numbers with steps and summary statistics.
Mean Median Mode Range Calculator
Find mean, median, mode, range, count, sum, minimum, and maximum for a list of numbers with sorted values and steps.
Speed Distance Time Calculator
Solve for speed, distance, or time using the distance = speed x time relationship with unit-friendly steps.
Harmonic Number Calculator
Compute the harmonic number H(n) = 1 + 1/2 + ... + 1/n as an exact fraction for n up to 500, as a decimal for any n, and compare it with the asymptotic estimate ln(n) + γ.
Last updated: September 4, 2026