DigitHelm

Harmonic Mean Calculator | Rates, Speeds & P/E Ratios

Calculate the harmonic mean of any dataset. Compare H, G, A means, verify AM-GM-HM inequality, see reciprocal table. Weighted harmonic mean mode included.

Quick examples

Press Enter to calculate  · Esc to reset

What Is the Harmonic Mean Calculator | Rates, Speeds & P/E Ratios?

The harmonic mean (H) is the reciprocal of the arithmetic mean of the reciprocals of a dataset. It is the appropriate average whenever the quantity being averaged is a rate, such as speed, frequency, or price-to-earnings ratios, and the denominator (distance, time, or earnings) is held constant.

Why the Harmonic Mean for Rates?

If you drive 60 km/h on the way to a destination and 40 km/h on the way back, covering equal distances, the correct average speed is the harmonic mean: H = 2/(1/60 + 1/40) = 48 km/h, not the arithmetic mean of 50 km/h. The arithmetic mean overstates the average because you spend more time at the lower speed.

The Three Pythagorean Means

  • Arithmetic Mean A = (x₁ + x₂ + ... + xₙ) / n, center of mass
  • Geometric Mean G = (x₁ × x₂ × ... × xₙ)^(1/n), exponential center
  • Harmonic Mean H = n / Σ(1/xᵢ), rate average

When Harmonic Mean is Undefined

The harmonic mean is undefined if any value is zero (division by zero in 1/x) or negative (the inequality H ≤ G ≤ A breaks down for mixed-sign datasets). For positive datasets, H is always the smallest of the three means unless all values are equal.

Formula

Harmonic Mean Formula
H = n / (1/x₁ + 1/x₂ + … + 1/xₙ)
Weighted Harmonic Mean
H𝑤 = Σwᵢ / Σ(wᵢ / xᵢ)
AM-GM-HM Inequality
H ≤ G ≤ A (equality only when all values are equal)

How to Use

  1. 1Choose Simple Harmonic Mean or Weighted Harmonic Mean from the mode tabs.
  2. 2For simple mode: enter your positive numbers separated by commas, spaces, or semicolons (up to 50).
  3. 3For weighted mode: enter one value-weight pair per line as "value weight" (e.g. 60 2).
  4. 4Use a preset to autofill a real-world example: Speed, Resistors, P/E ratios, or Average speed.
  5. 5Click Calculate (or press Enter) to see the harmonic mean, arithmetic mean, and geometric mean.
  6. 6Check the AM-GM-HM inequality verification to confirm H ≤ G ≤ A for your data.
  7. 7Expand the Reciprocal Table to see each value, its reciprocal, and its contribution to the harmonic mean.
  8. 8Expand Step-by-step working to see the full substituted calculation with all intermediate values.

Example Calculation

Example 1, Round-trip average speed

You drive 60 km/h going to the office (60 km) and 40 km/h returning (60 km). What is your average speed?

H = 2 / (1/60 + 1/40) = 2 / (0.01667 + 0.025) = 2 / 0.04167 = 48 km/h.

Arithmetic mean would give 50 km/h, but 50 is incorrect because you spend more time at 40 km/h.

Example 2, Parallel resistors

Three resistors of 10, 20, and 30 ohms are connected in parallel. What is the equivalent resistance?

1/R = 1/10 + 1/20 + 1/30 = 11/60. R = 60/11 ≈ 5.455 ohms.

Example 3, Investment P/E ratios

A portfolio has stocks with P/E ratios of 15, 25, and 10 with equal investment amounts. What is the portfolio P/E?

H = 3 / (1/15 + 1/25 + 1/10) = 3 / 0.2067 ≈ 14.52.

Arithmetic mean P/E of 16.67 would overstate the true portfolio valuation.

Understanding Harmonic Mean | Rates, Speeds & P/E Ratios

This calculator runs entirely in your browser, no data is transmitted to any server. All mean calculations (harmonic, geometric, arithmetic) are computed using standard mathematical formulas with full floating-point precision. Results are shown to 6 significant digits.

Harmonic Mean in Finance and Engineering

  • Portfolio P/E ratios: the harmonic mean is the theoretically correct aggregation when investment size is equal.
  • Parallel circuit resistance: 1/R_eq = Σ(1/R_i) is the harmonic mean reciprocal formula.
  • Flow rates and hydraulics: averaging flow speeds when pipe cross-sections are equal.
  • Finance: the correct averaging of rate-of-return data when investment amounts are fixed.
  • Data compression: harmonic mean can reduce the effect of very large outliers.

Weighted Harmonic Mean

When values have different weights (for example, different investment amounts or pipe lengths), use the weighted harmonic mean: H = Σwᵢ / Σ(wᵢ/xᵢ). This is the correct method for aggregating P/E ratios with different portfolio weights, or averaging speeds over trips of different lengths.

Frequently Asked Questions

When should I use the harmonic mean instead of the arithmetic mean?

Use the harmonic mean when you are averaging rates or ratios where the denominator (not the numerator) is fixed.

  • • Equal distances at different speeds: use H = 2/(1/v₁ + 1/v₂)
  • • Equal time periods at different speeds: use arithmetic mean
  • • Equal investment amounts at different P/E ratios: use harmonic mean
  • • Parallel resistors: use harmonic mean formula

Why is H ≤ G ≤ A (AM-GM-HM inequality)?

This is a fundamental result in mathematics known as the AM-GM-HM inequality.

  • • Proven via Jensen's inequality applied to convex functions
  • • Equality holds only when all values in the dataset are identical
  • • The gap between H, G, and A grows with the spread (variance) of the data

This inequality shows that for positive data, the harmonic mean always gives the most conservative (smallest) average.

Why is the harmonic mean undefined for zero or negative values?

The harmonic mean requires computing 1/x for each value:

  • • If any x = 0, then 1/x is undefined (division by zero)
  • • For negative values, the AM-GM-HM inequality breaks down
  • • Mixed positive/negative datasets can give a harmonic mean of undefined

If your data contains zeros or negatives, consider whether the harmonic mean is the appropriate statistic.

What is the weighted harmonic mean and when should I use it?

The weighted harmonic mean uses H = Σwᵢ / Σ(wᵢ/xᵢ) where each value has a weight.

  • • Use when different trips, investments, or pipes have different sizes or proportions
  • • P/E ratios with unequal portfolio weights require weighted harmonic mean
  • • Averaging speeds over trips of different lengths: weight by distance

What is the harmonic mean of 1, 2, 3, 4, 5?

H = 5 / (1 + 1/2 + 1/3 + 1/4 + 1/5) = 5 / (137/60) = 300/137 ≈ 2.1898

Compare: Arithmetic mean A = 3.0, Geometric mean G &approx; 2.605. H < G < A as expected.

How is the harmonic mean related to parallel resistance?

For resistors in parallel, the equivalent resistance uses the same reciprocal sum as the harmonic mean:

  • • The formula 1/R_eq = 1/R₁ + 1/R₂ + ... is the harmonic mean reciprocal sum
  • • For n equal resistors R, the equivalent is R/n, which equals HM/n
  • • Capacitors in series follow the same formula for equivalent capacitance

What is the difference between harmonic mean and median?

Both can resist the influence of large outliers, but they work differently:

  • • Harmonic mean: uses all data via reciprocals, affected by small values more than large ones
  • • Median: uses only the middle value, unaffected by extreme values entirely
  • • For skewed positive data, H < Median < A is common

Can I use the harmonic mean for averaging percentages or growth rates?

Generally no. Percentages and growth rates are multiplicative, so the geometric mean is usually more appropriate.

  • • Compound annual growth rates (CAGR): use geometric mean
  • • Average percentage change: use geometric mean on (1 + r) factors
  • • Harmonic mean of rates is appropriate only when the denominator of the rate is the fixed quantity

Related Calculators