calculator.onl
Categories50

Geometric and harmonic mean calculator

Compare geometric, harmonic and arithmetic means for a positive data list, with logarithms and reciprocals shown for each value.

A worked example

Compare 4 × 4 with 2 × 8. Which mean stays the same?

Geometric mean20Harmonic mean17.1429Arithmetic mean23.3333Count3
Data values: Separate list items with semicolons; decimal commas are allowed. Follow the item limit shown for the field.

Updates as you type

Use a dot or comma for decimals. No thousands separators.

YOUR RESULT

Geometric mean

20

Calculated from your inputs

Harmonic mean17.1429
Arithmetic mean23.3333
Count3
The numbers, at a glance

Calculations run in your browser.
UNDERSTAND THE RESULT

A little context. A clearer answer.

↑ Back to calculator

When this calculator is useful

Separate values with semicolons or new lines and use a decimal point. The geometric mean is computed through logarithms to avoid product overflow. The harmonic mean is the reciprocal of the mean reciprocal. Up to 100 values from 1e-100 to 1e100 are accepted. For a related calculation, try Weighted Average & Weighted Mean Calculator.

What to enter

InputWhat it meansExample value
Data valuesData values: Separate list items with semicolons; decimal commas are allowed. Follow the item limit shown for the field.10;20;40

How the calculation works

  1. Change the inputs to explore your own scenario. Data values: Separate list items with semicolons; decimal commas are allowed. Follow the item limit shown for the field..
  2. G=exp(Σln(x)/n); H=n/Σ(1/x); A=Σx/n; x>0
  3. Only strictly positive finite values are supported. Equal-distance speeds use the harmonic mean; equal-time speeds use the arithmetic mean. Convert percentage returns into positive growth factors before using a geometric mean.
The formulaG=exp(Σln(x)/n); H=n/Σ(1/x); A=Σx/n; x>0

A worked example

10;20;40 → G=20; H=120/7=17.1428571429; A=70/3=23.3333333333. Equal distances at 40 and 60 km/h give H=48 km/h.

Example you can load

What to enter
Result for this example · Geometric mean20

This is a fixed example; changing the form above does not change these numbers.

Assumptions & limits

Only strictly positive finite values are supported. Equal-distance speeds use the harmonic mean; equal-time speeds use the arithmetic mean. Convert percentage returns into positive growth factors before using a geometric mean.

Frequently asked questions

Why reject zero and negative values?

This tool deliberately uses a positive-only domain shared by its log-based geometric and reciprocal-based harmonic formulas.

Can I average investment returns?

Convert each return r to a growth factor 1+r first. Subtract one from the geometric mean afterward. Raw signed percentages are not valid inputs here.

Which mean applies to speed?

The harmonic mean applies when each segment covers the same distance. The arithmetic mean applies to equal time intervals; unequal segments need appropriate weighting.