Last verified · v1.0
Calculator · math
Harmonic Mean Calculator
Compute the harmonic mean for up to 10 positive values using H = n / Σ(1/xᵢ). Perfect for rates, speeds, and financial ratios.
Inputs
Harmonic Mean
—
Explain my result
Get a plain-English breakdown of your result with practical next steps.
The formula
How the
result is
computed.
What Is the Harmonic Mean?
The harmonic mean is a type of average specifically designed for datasets that represent rates, ratios, or speeds. Unlike the arithmetic mean, which sums values and divides by their count, the harmonic mean computes the reciprocal of the arithmetic mean of the reciprocals. This property makes it the mathematically correct choice when averaging quantities such as vehicle speed over equal distances, fuel efficiency, price-to-earnings ratios, and flow rates.
The Harmonic Mean Formula
For n positive values x1, x2, ..., xn, the harmonic mean H is defined as:
H = n ÷ (1/x1 + 1/x2 + … + 1/xn)
In compact summation notation: H = n / ∑i=1n (1/xi)
Every value must be strictly positive (greater than zero). A single zero in the dataset makes the denominator undefined, and negative values destroy the reciprocal structure of the formula entirely.
Variables Explained
- n — The total count of values included in the calculation.
- xi — Each individual positive data point in the dataset.
- 1/xi — The reciprocal (multiplicative inverse) of each value.
- ∑(1/xi) — The sum of all reciprocals, which forms the denominator.
Step-by-Step Calculation Method
- Confirm all values are positive. Verify that every data point is greater than zero before proceeding.
- Compute each reciprocal. For a value of 4, the reciprocal is 1/4 = 0.25; for a value of 20, it is 1/20 = 0.05.
- Sum all reciprocals. Add every reciprocal together to form the denominator.
- Divide n by the sum. The resulting quotient is the harmonic mean.
Worked Example: Average Travel Speed
A cyclist rides 90 km at 30 km/h and then another 90 km at 45 km/h. The arithmetic mean of (30 + 45) / 2 = 37.5 km/h is incorrect because equal distances, not equal times, were covered. The harmonic mean gives the true average speed:
H = 2 / (1/30 + 1/45) = 2 / (3/90 + 2/90) = 2 / (5/90) = 2 × 18 = 36 km/h
Verification: 90 km at 30 km/h takes 3 hours; 90 km at 45 km/h takes 2 hours. Total: 180 km in 5 hours = 36 km/h. The harmonic mean matches exactly.
Worked Example: Financial P/E Ratios
An investor allocates equal dollar amounts to three stocks with price-to-earnings ratios of 10, 15, and 30. The correct blended P/E multiple is the harmonic mean:
H = 3 / (1/10 + 1/15 + 1/30) = 3 / (3/30 + 2/30 + 1/30) = 3 / (6/30) = 3 / 0.2 = 15
The arithmetic mean of 18.33 would significantly overstate the blended earnings yield, leading to mispriced portfolio comparisons.
When to Use the Harmonic Mean
- Speed and travel: Correct average when equal distances are covered at different speeds.
- Fuel efficiency: Accurate miles-per-gallon average when equal distances are driven on different routes.
- Financial multiples: Blending P/E, P/B, or P/S ratios for equal-dollar-weight portfolios.
- Parallel electrical resistors: Computing equivalent resistance in circuit design.
- Hydrology: The U.S. Geological Survey (2016) applies harmonic mean streamflow in low-flow frequency statistics.
Harmonic Mean vs. Arithmetic Mean vs. Geometric Mean
For any set of unequal positive values, the three classical Pythagorean means obey the strict inequality H ≤ G ≤ A, where H is the harmonic mean, G is the geometric mean, and A is the arithmetic mean. Equality holds only when all values are identical. This fundamental relationship is detailed in the statistical review by Norris et al. (2017, PMC5489931) and the technical exposition by Gavin at Duke University. Selecting the wrong mean for rate data introduces systematic overestimation bias.
Important Limitations
- Zero or negative values are not permitted; they make the formula mathematically undefined.
- The harmonic mean is highly sensitive to values near zero, which dominate the sum of reciprocals and pull the result sharply downward.
- For raw count or quantity data that are not rates, the arithmetic mean remains the appropriate measure of central tendency.
Reference