Harmonic Mean Calculator
True average of rates and ratios, beside the ordinary mean.
What it does
Some averages punish the naive approach. Drive one leg at 30 mph and the return at 40, and the dashboard answer of 35 mph is wrong, because the slow leg eats more time. The correct 34.29 mph comes from the harmonic mean, which weights each speed by the time spent at it.
The tool above takes any list of positive numbers and returns the harmonic mean beside the ordinary arithmetic mean. The 30, 40 default replays the round trip above: harmonic 34.29 against arithmetic 35, with the count confirming two values.
The definition is standard statistics: the reciprocal of the average of reciprocals, H = n / (1/x1 + ... + 1/xn). NIST documents exactly this form in its Dataplot statistics reference, and LibreTexts biostatistics texts teach the same reciprocal recipe for skewed measures like dispersal distance.
Reach for this mean when the data are rates over fixed distances, parallel work rates, or price earnings style ratios. Reach for the ordinary mean when amounts accumulate over fixed times instead, like hourly pay across equal hours. Mixing the two settings is the classic error this page prevents.
How to use
- Type positive numbers with commas, spaces, or both.
- Include 2 to 200 values; units stay out of the box.
- Read the harmonic mean first for rates.
- Compare with the arithmetic mean beside it.
- Use equal distance legs for true average speed claims.
- Split unequal legs into equal slices before averaging.
Formula
- H
- Harmonic mean of the list.
- n
- How many values were entered.
- xi
- Each positive value (speed, rate, ratio).
- 1/xi
- Reciprocal, proportional to time per unit distance.
Why reciprocals work: time per mile is 1/speed, so averaging times then inverting gives the speed covering the total distance in the total time. Equal time legs instead average speeds directly, which is why 30 mph for one hour plus 40 for one hour truly is 35. Distance fixed picks harmonic; time fixed picks arithmetic.
Worked example
Example: out at 30 mph, back at 40 mph
Defaults 30, 40 already filled in.
- Reciprocals: 1/30 = 0.033333 and 1/40 = 0.025.
- Sum: 0.033333 + 0.025 = 0.058333.
- Divide count: 2 / 0.058333 = 34.2857, shown as 34.29.
- Arithmetic check: (30 + 40) / 2 = 35.
- Sanity: 34.29 sits below 35, as theory demands.
- Meaning: 120 miles each way takes 4 + 3 = 7 hours, and 240 / 7 = 34.29 mph.
Reference table
| Legs | Harmonic (true) | Arithmetic (wrong here) |
|---|---|---|
| 30 and 40 | 34.29 | 35 |
| 60 and 20 | 30 | 40 |
| 50 and 50 | 50 | 50 |
| 10, 20, 30 | 16.36 | 20 |
Limits
- Positive values only; zero has no reciprocal and negatives break the logic.
- Equal distance assumed; unequal legs need splitting or weighting first.
- One summary hides spread, so report the range beside it for honesty.
- Not a substitute for time weighted bookkeeping in payroll style problems.
Common mistakes
- Averaging out and back speeds with the ordinary mean.
- Feeding in zeros, like a stopped leg, and expecting a finite answer.
- Mixing minutes per mile with miles per hour in one list.
- Using harmonic for equal time settings where arithmetic is correct.
- Quoting 4 decimals on speedometer grade inputs.
Try it yourself
Quick checks. Answers sit tucked under each question.
Out at 60, back at 20. True average?
2 / (1/60 + 1/20) = 30 mph against an arithmetic 40.
Three equal legs at 10, 20, 30. Average?
3 / (0.1 + 0.05 + 0.0333) = 16.36 mph.
When do both means agree?
When every value is equal, like 50 and 50 giving 50.
Questions
What is the harmonic mean?
Count divided by the sum of reciprocals; the rate aware average.
Why is my round trip slower than the midpoint?
Slow legs consume more time, dragging the true average below the plain midpoint.
Can it exceed the arithmetic mean?
Never for positive inputs; it sits equal only when all values match.
Why are zeros refused?
Division by zero has no reciprocal, so the formula cannot start.
Does order matter?
No. Reciprocals add commutatively, so listing order changes nothing.
Who defines this formula?
Standard statistics references including the NIST Dataplot manual.