Skip to content

Geometric and harmonic mean calculator

Compare weighted or unweighted geometric, harmonic and arithmetic means for positive values.

Positive values

Processed in your browser.

Enter 2–100 positive values separated by spaces, commas or semicolons.

Leave blank for equal weight, or enter one positive weight per value.

Result

Enter values, then calculate.

How to use

Enter two to one hundred positive values. Leave Weights blank to give every observation equal influence, or enter one positive weight for each value. Weights may be counts, frequencies or other relative importance values; multiplying every weight by the same constant does not change the answer.

The pale example 1, 4, 16 can be calculated immediately and uses equal weights. Focusing either numeric field clears the examples together once. Later edits keep your values. Any edit clears the confirmed result and disables copying. Clear empties both lists; it does not restore an example automatically.

Three means and how to read them

The weighted arithmetic mean is Σwᵢxᵢ/Σwᵢ. The weighted geometric mean is exp[Σwᵢln(xᵢ)/Σwᵢ]. The page performs the geometric calculation in logarithmic space to avoid multiplying many large or small values directly. The weighted harmonic mean is Σwᵢ / Σ(wᵢ/xᵢ).

For positive values with the same weights, arithmetic mean ≥ geometric mean ≥ harmonic mean. The result shows all three so you can verify this expected order. When every value is identical, all three means equal that value. Rounding applies only to display and copying; calculations keep more precision.

Worked examples

For 1, 4 and 16 with equal weights, the geometric mean is 4, harmonic mean is about 2.29 and arithmetic mean is 7. Their difference reflects how each mean responds to the large value 16 and the small value 1.

For values 1 and 4 with weights 1 and 3, normalized weights are 0.25 and 0.75. The geometric mean is 4^0.75, about 2.83; the harmonic mean is 1/(0.25/1+0.75/4), about 2.29; the arithmetic mean is 3.25. Values 5,5,5 always give 5 under any positive weights.

Choosing the appropriate mean

Use the geometric mean for positive multiplicative factors, proportional changes or normalized ratios when the product structure is meaningful. Use the harmonic mean for positive rates when the numerator or exposure is held consistently, such as equal-distance speeds. Use the arithmetic mean for additive quantities with the stated weights.

Choosing a mean is a modeling decision, not a contest to find the most favorable number. Do not use the harmonic mean for rates with incompatible denominators, and do not treat the geometric mean of arbitrary levels as a financial return. Explain what each value and weight represents.

Limits and common errors

Zero and negative values are rejected because the real logarithm and reciprocal used here would be undefined or incompatible with this positive-value model. Every supplied weight must also be positive and its list length must match the values. Missing, extra or nonnumeric tokens are errors.

The page accepts ordinary decimal or scientific notation within 10⁻¹⁰⁰ to 10¹⁰⁰ and at most one hundred entries. It does not support negative-growth conventions, complex-valued means, missing-value imputation or generic descriptive statistics. Extreme valid mixtures may still lose some floating-point precision.

Common questions

Why is the geometric mean calculated with logs? Adding logarithms avoids intermediate overflow and underflow from a long product. Why are equal weights omitted? A blank weight list is exactly the equal-weight mode. Can weights be percentages? Yes, if all are positive; they are normalized by their sum.

Is the geometric mean the same as compound return? Only when inputs are valid positive growth factors and the periods and weighting match the intended return definition. This page does not convert percentages or handle losses at or below −100%. Copy result exports the displayed means as text without storing or transmitting inputs.