Harmonic Mean Calculator
Enter positive numbers separated by commas or spaces to calculate the harmonic mean. Ideal for averaging rates, speeds, and other ratio-based values.
How Harmonic Mean Works
The harmonic mean flips values, averages them, then flips back. Mathematically, for numbers x₁, x₂, ..., xₙ, the harmonic mean H is n / (1/x₁ + 1/x₂ + ... + 1/xₙ). This double inversion gives smaller numbers greater influence over the result. Where arithmetic mean treats all values equally and geometric mean uses multiplication, harmonic mean emphasizes reciprocals.
To see why this matters, consider averaging speeds. If you travel 100 miles at 30 mph and 100 miles at 60 mph, your average speed is not 45 mph. The slower leg takes longer (3.33 hours vs. 1.67 hours), so the average must account for time spent at each speed. The harmonic mean of 30 and 60 is 2 / (1/30 + 1/60) = 2 / (0.0333 + 0.0167) = 40 mph, correctly reflecting that you spent more time at the slower speed.
Harmonic mean appears whenever the underlying quantity is a rate (something per unit). Miles per hour, items per dollar, tasks per hour—all of these benefit from harmonic averaging when you want a true average rate across varying conditions or periods.
Practical Applications of Harmonic Mean
Average speed over equal distances is the classic harmonic mean application. A round trip at 60 mph one way and 40 mph the other has an average speed of 48 mph, not 50 mph. The slower leg dominates because it consumes more time, and harmonic mean captures that asymmetry automatically.
Financial analysts use harmonic mean for price-to-earnings ratios when averaging across a portfolio. If you invest equal dollar amounts in stocks with different P/E ratios, the harmonic mean P/E reflects the actual portfolio valuation. Computer scientists use harmonic mean to average rates like instructions per cycle or queries per second when workload size varies.
In physics, harmonic mean combines resistances in parallel circuits. The total resistance of parallel resistors is the reciprocal of the sum of reciprocals, which is precisely the harmonic mean scaled by the count. Engineering disciplines use harmonic mean for fluid flow rates, optical lens calculations, and other systems where reciprocal relationships govern behavior.
Comparing Arithmetic, Geometric, and Harmonic Means
Three classic means—arithmetic, geometric, and harmonic—form a hierarchy. For any set of positive numbers, the harmonic mean is smallest, the arithmetic mean is largest, and the geometric mean falls between them. This ordering holds strictly unless all values are equal, in which case all three means coincide.
Each mean answers a different question. Arithmetic mean minimizes the sum of squared deviations and works for additive quantities. Geometric mean preserves ratios and works for multiplicative quantities. Harmonic mean emphasizes smaller values and works for reciprocal quantities. Using the wrong mean can distort your results: averaging fuel economy in miles per gallon requires harmonic mean, not arithmetic, because gallons per mile is the reciprocal quantity.
The relationship among means is captured by the generalized mean formula, where harmonic, geometric, and arithmetic means correspond to powers of -1, 0, and 1 respectively. This mathematical framework shows that selecting the right mean depends on the exponent that reflects your data's structure. Understanding this relationship empowers you to choose the correct averaging method for any dataset.
Frequently Asked Questions
What is the harmonic mean?
The harmonic mean is the reciprocal of the arithmetic mean of reciprocals. For n numbers, it equals n divided by the sum of 1/x₁ + 1/x₂ + ... + 1/xₙ.
When should I use harmonic mean?
Use harmonic mean for rates and ratios, especially when averaging speeds or prices over the same distance or quantity. It gives the correct average when denominators matter more than numerators.
How is harmonic mean different from arithmetic mean?
Harmonic mean weights smaller values more heavily. It is always less than or equal to the arithmetic mean, and it is particularly useful for reciprocal quantities like speed (distance/time).
Can I use harmonic mean with negative numbers?
No. Harmonic mean requires all positive numbers because it involves taking reciprocals, and negative or zero values create undefined or problematic results.
What is an example of harmonic mean in real life?
If you drive to work at 60 mph and return at 40 mph over the same distance, your average speed is the harmonic mean: 48 mph, not the arithmetic mean of 50 mph.