Harmonic Mean Calculator

Enter a list of numbers (and optional weights) to compute the harmonic mean, weighted harmonic mean, arithmetic mean, and geometric mean.

Quick Facts

Harmonic mean formula
HM = n / Σ(1/xᵢ)
n divided by the sum of the reciprocals of each value.
Weighted harmonic mean
HM_w = Σwᵢ / Σ(wᵢ/xᵢ)
Used when some values should count more than others.
Mean inequality
AM ≥ GM ≥ HM
Equality holds only when all values are identical.
Domain
Values must be positive
Undefined for zero; not meaningful for negative numbers.

Your Results

Calculated
Harmonic Mean
-
HM = n / Σ(1/x)
Weighted Harmonic Mean
-
HM_w = Σw / Σ(w/x)
Arithmetic Mean
-
Sum of values ÷ count
Geometric Mean
-
nth root of the product

Ready

Enter positive values (and optional weights), then press Calculate.

How the Harmonic Mean Works

The harmonic mean is a type of average best suited to rates and ratios — quantities like speed, price-to-earnings ratios, or resistance in parallel circuits. For a set of n positive numbers x₁, x₂, …, xₙ, the harmonic mean is HM = n / Σ(1/xᵢ) — that is, n divided by the sum of the reciprocals of each value. Because it is based on reciprocals, the harmonic mean weights smaller values more heavily than larger ones, which makes it pull toward the low end of a data set rather than the middle.

Formula and method

To compute the harmonic mean by hand: (1) take the reciprocal of every value (1 divided by the value), (2) sum those reciprocals, and (3) divide the count of values, n, by that sum. For example, with 4, 8, and 16: the reciprocals are 0.25, 0.125, and 0.0625, which sum to 0.4375. Dividing n = 3 by 0.4375 gives HM ≈ 6.857. When some observations should count more than others, use the weighted harmonic mean: HM_w = Σwᵢ / Σ(wᵢ/xᵢ), where each value xᵢ is paired with a weight wᵢ. If no weights are supplied, this calculator treats every value as equally weighted, so the weighted result matches the plain harmonic mean.

Common sources of error

  • Zero or negative values: the harmonic mean requires every value to be strictly positive — a zero makes 1/x undefined, and negative values make the result meaningless for rate-style data.
  • Using the arithmetic mean for rates: averaging speeds, ratios, or rates with a simple arithmetic mean (sum ÷ count) typically overstates the true average — the harmonic mean corrects for this when the quantities share a common numerator (e.g., a fixed distance or fixed cost).
  • Mismatched weight count: when using weights, make sure you enter exactly one weight per value, in the same order, or the weighted result will not correspond to the correct pairing.

Checking your result

The harmonic mean of a set of positive numbers is always less than or equal to the geometric mean, which is always less than or equal to the arithmetic mean — the relationship AM ≥ GM ≥ HM always holds, with equality only when all the values are identical. This calculator reports all three means, so you can use that inequality as a sanity check: if your harmonic mean comes out larger than the arithmetic mean, double-check your inputs.

Frequently Asked Questions

What is the harmonic mean and how is it calculated?
The harmonic mean of n positive numbers is n divided by the sum of the reciprocals of the numbers: HM = n / Σ(1/xᵢ). For example, the harmonic mean of 4, 8, and 16 is 3 / (1/4 + 1/8 + 1/16) = 3 / 0.4375 ≈ 6.857.
When should I use the harmonic mean instead of the arithmetic mean?
Use the harmonic mean when averaging rates or ratios that share a common numerator, such as speeds over equal distances, price-to-earnings ratios, or fuel efficiency figures. Averaging such rates with the arithmetic mean overstates the true average because it does not account for the different amounts of time or effort each rate represents.
What is a weighted harmonic mean?
The weighted harmonic mean applies a weight wᵢ to each value: HM_w = Σwᵢ / Σ(wᵢ/xᵢ). It is used when observations should not count equally, such as combining P/E ratios weighted by each company's market capitalization.
Why must all values be positive, and how does the harmonic mean compare to the arithmetic and geometric means?
The harmonic mean is undefined if any value is zero (division by zero) and is not meaningful for negative values, since it is designed for positive rates and ratios. For any set of positive numbers, the inequality AM ≥ GM ≥ HM always holds, with equality only when every value in the set is identical.