Blog
Statistics on data

Geometric and harmonic mean calculator online

The arithmetic mean is the wrong average surprisingly often. For year-on-year growth factors it overstates; for speeds and rates per unit it overstates differently. This page computes all four classical means side by side so the right one is visible next to the familiar one.

Your data never leaves this device

Your data

Paste a table straight from Excel or Google Sheets, or drop a CSV file. Nothing is uploaded anywhere — the whole calculation runs inside this browser tab.

CSV, TSV or plain text. Files saved in windows-1251 are detected and re-read automatically, so Cyrillic headers do not turn into garbage.

Parsing options

Columns

Result

The drawing library is downloaded only when you press the button, and only on this page.

This page has no server side at all. The table you paste is parsed by JavaScript inside your own browser, the chart is drawn on a canvas element on your machine, and the export file is assembled locally. Nothing is uploaded, stored or written to any log. You can disconnect from the network after the page has loaded and everything will still work — which is the simplest way to verify the claim yourself.

Facts and limits of this method

Geometric mean The nth root of the product — the correct average for growth factors and ratios
Harmonic mean n divided by the sum of reciprocals — the correct average for rates per unit
Arithmetic mean The familiar sum divided by count, shown for comparison
Quadratic mean (RMS) The root of the mean of squares
Fixed ordering harmonic ≤ geometric ≤ arithmetic ≤ quadratic, always
Non-positive values Excluded from the geometric and harmonic means, and counted

When it misleads you

How it is calculated

The geometric mean is computed through logarithms — the exponential of the mean of the logs — rather than by multiplying the values and taking a root. Multiplying a hundred numbers overflows a double-precision float and returns infinity, which is a common silent bug in hand-written implementations.

It is the right average whenever values multiply rather than add. Growth over three years of ×1.5, ×0.8 and ×1.3 compounds to ×1.56, and only the geometric mean reproduces that: raised to the third power it returns the total, while the arithmetic mean does not.

The harmonic mean is n divided by the sum of the reciprocals, and it is the right average for rates measured per unit of something. Driving 60 km at 30 km/h and 60 km at 60 km/h gives an average speed of 40, not 45 — the harmonic mean gives 40 because the slow leg takes twice as long.

All four are displayed together along with a reminder of their fixed ordering: harmonic ≤ geometric ≤ arithmetic ≤ quadratic, with equality only when every value is identical. The size of the gaps between them is itself a measure of how spread out the data is.

Questions and answers

When do I use the geometric mean?

For anything that compounds: growth rates, interest, ratios, index numbers. If applying your average repeatedly should reproduce the total change, you need the geometric mean.

And the harmonic mean?

For rates defined per unit of something: speeds over fixed distances, price-earnings ratios across equal investments, throughput per machine. Whenever the denominator is what is held constant.

Why were some of my rows excluded?

Because they were zero or negative. Logarithms and reciprocals are undefined for those, so the geometric and harmonic means cannot include them. The count of excluded rows is shown.

Why is the arithmetic mean always the largest of the three?

It is a mathematical fact for positive numbers, not a property of your data. The three coincide only when every value is identical, and the wider your spread the further they separate.

Is my data uploaded?

No. All four means are computed in your browser.

The opposite tool

Need it the other way round? Weighted average An average where some rows count more than others

Related tools

All tools