Harmonic Mean Calculator
Calculate the harmonic mean of any dataset - or find the true average speed for a round trip.
⟨⟩ What is Harmonic Mean?
The harmonic mean is a type of average calculated by dividing the count of values by the sum of their reciprocals. It is the reciprocal of the arithmetic mean of the reciprocals. For a set of values x₁, x₂, …, xₙ: HM = n ÷ (1/x₁ + 1/x₂ + … + 1/xₙ). Like all means, it produces a single representative value for a dataset - but it does so in a way that gives proportionally more weight to smaller values.
The harmonic mean is the correct average to use for rates - quantities measured as "something per unit of something else" - when the denominator quantity (the unit) is constant across measurements. The most intuitive example is average speed. If you drive 100 km at 60 km/h and 100 km at 40 km/h, you spend more time driving at 40 km/h (2.5 hours) than at 60 km/h (1.67 hours). The total is 200 km in 4.17 hours = 48 km/h. The harmonic mean gives exactly this: HM(60, 40) = 2 × 60 × 40 / (60 + 40) = 4800/100 = 48 km/h. The arithmetic mean of 50 km/h is wrong.
In the hierarchy of means, the harmonic mean is always the smallest: HM ≤ GM ≤ AM (AM-GM-HM inequality). The harmonic mean represents the "lower bound" of averages, and the gap between HM and AM grows as values become more spread out. This inequality is one of the fundamental results in classical mathematics, appearing in optimization, inequalities, and physics.
Practical applications of the harmonic mean include: average price-per-share in dollar-cost averaging, fuel efficiency averages (miles per gallon), parallel resistance in electronics, average P/E ratios in financial analysis, and pharmacokinetic averages in medicine. Any time equal portions are divided at different rates, the harmonic mean is the correct tool.
📐 Formula
📖 How to Use This Calculator
Steps to Calculate Harmonic Mean
💡 Example Calculations
Example 1 — Harmonic Mean of a List
Find the harmonic mean of 3, 6, 9
Example 2 — Average Speed for a Round Trip
Drive 100 km at 60 km/h, return 100 km at 40 km/h
Example 3 — Harmonic Mean for Fuel Efficiency
Car gets 25 mpg in city, 40 mpg on highway - equal distances driven
Example 4 — Five-Value Dataset with AM-GM-HM Comparison
Values: 2, 5, 10, 20, 50 - verify the three-means inequality
❓ Frequently Asked Questions
🔗 Related Calculators
What is the formula for harmonic mean?
Harmonic Mean = n / (1/x₁ + 1/x₂ + ... + 1/xₙ) - divide the count of values by the sum of their reciprocals. Example: HM of 4, 8, 16 = 3 / (1/4 + 1/8 + 1/16) = 3 / (0.4375) ≈ 6.86.
When should I use harmonic mean?
Use harmonic mean when averaging rates, speeds, or ratios where the denominator (distance, time, quantity) is fixed and equal across all measurements. Classic cases: average speed over equal-distance segments, average price-earnings ratio, average fuel efficiency in miles per gallon, average work rate when each worker does the same fixed task.
What is the harmonic mean of 2 numbers?
For two values a and b, HM = 2ab / (a+b). Example: HM of 30 and 60 = 2×30×60 / (30+60) = 3600/90 = 40. If you drive 60 km at 30 km/h and 60 km at 60 km/h, the average speed is exactly 40 km/h - not 45 km/h as the arithmetic mean suggests.
Why is the arithmetic mean wrong for average speed?
Arithmetic mean assumes equal time spent at each speed. But for equal-distance segments, more time is spent at the slower speed. Driving 100 km at 50 km/h takes 2 hours; driving 100 km at 100 km/h takes 1 hour. Total: 200 km in 3 hours = 66.7 km/h average. HM = 2×50×100/(50+100) = 66.7 ✓. Arithmetic mean = (50+100)/2 = 75 ✗.
What is the difference between harmonic mean and arithmetic mean?
Arithmetic mean = sum ÷ count. Harmonic mean = count ÷ (sum of reciprocals). AM ≥ HM always. AM is correct for additive quantities (scores, lengths). HM is correct for rates where denominators are equal (speed, fuel efficiency). The more values differ from each other, the larger the gap between AM and HM.
What is the relationship between HM, GM, and AM?
The AM-GM-HM inequality states: Arithmetic Mean ≥ Geometric Mean ≥ Harmonic Mean, with equality only when all values are identical. For 1 and 4: AM = 2.5, GM = √(1×4) = 2, HM = 2×1×4/(1+4) = 1.6. This confirms 2.5 ≥ 2 ≥ 1.6. This inequality is fundamental in mathematics and has applications in optimization and inequalities.
What is the harmonic mean used for in finance?
In finance, harmonic mean is used to average price-to-earnings (P/E) ratios and other price-per-unit ratios. When you invest equal dollar amounts in stocks, the average price paid per share is the harmonic mean of the purchase prices - not the arithmetic mean. This is the correct 'dollar-cost averaging' calculation.
Can harmonic mean be negative or zero?
Harmonic mean is undefined if any value is zero (division by zero in the reciprocal sum). For negative values, the harmonic mean can theoretically be calculated but gives counterintuitive results. In practice, harmonic mean is used only for strictly positive values representing rates, speeds, or ratios.
How do I calculate harmonic mean in Excel?
Use =HARMEAN(values_range). Example: =HARMEAN(A1:A5). HARMEAN ignores text and empty cells but will return an error (#NUM!) if any value is zero or negative. For two speeds: =2*A1*A2/(A1+A2) gives the harmonic mean of the two values directly.
What is the harmonic mean in physics and engineering?
In physics, harmonic mean appears in parallel resistance calculations: two resistors R₁ and R₂ in parallel give R_total = R₁R₂/(R₁+R₂) = HM(R₁,R₂)/2. In optics, the lens equation 1/f = 1/d₁ + 1/d₂ is directly related to harmonic means. In signal processing, effective bandwidth calculations use harmonic-mean-type formulas.