Harmonic Mean Calculator
Calculate the harmonic mean of a dataset. Compare with arithmetic and geometric means. Used for rates, speeds, and averaging ratios.
What Is the Harmonic Mean Calculator?
The harmonic mean is the reciprocal of the arithmetic mean of reciprocals. It is the appropriate average when combining rates, speeds, or ratios — whenever equal intervals of a denominator quantity (time, distance) are used rather than equal intervals of the numerator. This calculator computes the harmonic mean alongside the arithmetic and geometric means for comparison.
Formula
How to Use
Enter a set of positive numbers separated by commas or spaces. The calculator computes all three Pythagorean means (arithmetic, geometric, harmonic) and shows their relationship H ≤ G ≤ A. The means are equal only when all values are identical.
Example Calculation
A car travels 60 km/h for the first half of a journey and 40 km/h for the second half. Average speed = harmonic mean = 2 / (1/60 + 1/40) = 2 / (1/24) = 48 km/h — NOT the arithmetic mean (50 km/h).
Understanding Harmonic Mean
The three classical Pythagorean means — arithmetic (A), geometric (G), and harmonic (H) — satisfy the inequality H ≤ G ≤ A for any set of positive numbers, with equality only when all numbers are identical. This relationship has been known since antiquity and appears in music theory (harmonic intervals), optics (lens equations), and financial modelling.
In finance, the harmonic mean is used to calculate the average price-to-earnings ratio of a portfolio, since P/E ratios represent value divided by earnings — a rate. Using the arithmetic mean overstates the true average valuation.
In physics, resistors in parallel obey 1/R_total = 1/R₁ + 1/R₂ + … — the harmonic mean of the individual resistances multiplied by n. Springs in series follow the same formula for equivalent spring constant.
The harmonic series 1 + 1/2 + 1/3 + 1/4 + … diverges (albeit very slowly), which was proven by Nicole Oresme in the 14th century. The harmonic mean is closely related but distinct.
Frequently Asked Questions
When should I use the harmonic mean instead of the arithmetic mean?
Use the harmonic mean when averaging rates: speed (km/h), fuel efficiency (mpg), price-to-earnings ratios, or any situation where you have a fixed amount of a quantity (distance, money) divided by a variable (time, shares). Using the arithmetic mean in these cases gives an incorrect result.
Why is harmonic mean always ≤ arithmetic mean?
This follows from the AM-HM inequality, a consequence of the convexity of f(x) = 1/x. The equality H = A holds only when all values are equal. In general, extreme values pull the arithmetic mean up but have less effect on the harmonic mean.
What is the harmonic mean of 2 values?
For two values a and b, the harmonic mean is 2ab/(a+b). This is exactly the formula for the combined resistance of two equal resistors in parallel, and the combined speed for equal-distance legs of a journey.
Can I take the harmonic mean of negative numbers?
The harmonic mean is undefined if any value is zero (division by zero). Negative values produce a result, but the interpretation is only meaningful for positive quantities like rates and ratios.