ForHosting KIT · Math

Geometric mean calculator

Average numbers that multiply rather than add: the geometric mean of 2, 8 and 32 is 8, against an arithmetic mean of 14. Paste a list of positive values of any length and see their product too. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Data
2, 8, 32
You get
N
3
Values
2, 8, 32
Geometric mean
8
Product
512

The geometric mean is the average that multiplies rather than adds: for a list of positive numbers it is the n-th root of their product, and it is always less than or equal to the ordinary arithmetic mean with equality only when every value is the same. It is the right center of gravity for growth rates, investment returns that compound, normalized ratios, and any scale where a doubling and a halving should cancel on the log scale. Engineers and analysts prefer it when averaging factors, fold-changes, or relative indices because an extreme large value does not dominate as harshly as it does under the arithmetic mean, while a near-zero factor pulls the geometric mean down honestly. Empty lists and any non-positive value are rejected with a clear validation error instead of returning NaN or a complex number.

How the geometric mean is computed

Begin with a non-empty collection of strictly positive finite real numbers. The classical definition multiplies every observation and takes the n-th root of that product, which is exactly the value that, when raised to the n-th power, recovers the product. Direct multiplication is fine for short classroom lists, but products of large magnitudes overflow floating-point range, so production code almost always evaluates the algebraically equivalent form: take the natural logarithm of each value, average those logs with ordinary arithmetic mean, then exponentiate the result.

That is exp of one over n times the sum of ln of each xi, and it is numerically stable for ordinary scientific data. Every input must be greater than zero because the logarithm is undefined on the reals for zero and for negative numbers; a zero factor would also force a zero product and a zero geometric mean, which silently hides bad data, so this engine rejects non-positive values with invalid input. Non-numeric tokens, NaN, and Infinity are likewise rejected.

When the linear product remains finite the response also echoes that product so you can check the n-th root identity by hand; when the product overflows, product is null while the geometric mean from log space remains defined.

Where geometric means show up in real work

Finance and investment analysis compound multiperiod returns and need the geometric mean of relative factors one plus rate so the multi-period growth rate matches the product of period factors. Biology and chemistry summarize fold-changes, concentration ratios, and dilution series on a multiplicative scale where the geometric mean is the natural center. Manufacturing and quality teams average relative efficiencies, normalized sensor indices, and scale-free ratios without letting a single large spike dominate as it would under the arithmetic mean.

If you later need the harmonic mean, weighted geometric mean of signed log-returns, five-number summaries, or z-scores of a sample, treat those as separate search intents and landings rather than overloading this geometric mean calculator page.

Homework and exam answer keys

Generate the geometric mean, product, and arithmetic mean for textbook positive lists so teachers and auto-graders share one ground truth.

Compound growth and investment factors

Average multiperiod relative returns as positive factors and recover the constant growth rate consistent with the product of period factors.

Fold-changes and normalized ratios

Summarize multiplicative biology, chemistry, or process ratios on a log-fair scale without arithmetic-mean inflation from large outliers.

What is the geometric mean?

For n positive numbers it is the n-th root of their product: GM = (x1 · x2 · … · xn)^(1/n). Equivalently, GM = exp of the arithmetic mean of ln(xi).

Why must every value be positive?

The geometric mean is defined over the reals only for strictly positive numbers.

How does it compare to the arithmetic mean?

For positive data, the geometric mean is always less than or equal to the arithmetic mean, with equality only when all values are equal. The response includes both so you can compare.

What does it cost?

The browser tool is free and runs locally.

Can I use the geometric mean to average investment returns?

Yes, as long as you enter growth factors rather than bare rates: one plus each period's rate. The geometric mean of those factors gives the per-period growth that, compounded, matches the product of all the periods.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/stat/geometric-mean

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/stat/geometric-mean \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data":"2, 8, 32"}'
{
  "data": "2, 8, 32"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.geometric_mean",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

This calculator accepts a list of strictly positive finite numbers as a JSON array or a comma, space, or semicolon separated string, evaluates the stable log-space formula exp of the mean of natural logs, and returns the geometric mean together with the product when it stays finite and the arithmetic mean for comparison.

How the geometric mean is computed

The pipeline is deterministic floating-point arithmetic with no random seeds, no wall-clock timestamps, and no network calls, so identical inputs always produce identical JSON.

What you send and what you get back

Provide exactly one of those three field names. Classic textbook checks include two, eight, thirty-two whose geometric mean is eight, and equal values such as five, five, five whose geometric and arithmetic means both equal five. Send one required field named data, or the aliases values or numbers, holding either a JSON array of positive finite numbers or a plain string with numbers separated by commas, spaces, or semicolons. Missing fields, empty arrays, empty strings, non-numeric tokens, NaN, Infinity, zero, and negative values fail with invalid_input and are not charged. On success the response includes the count n, the cleaned values array in input order, the scalar geometric_mean, product when the linear product stays finite or null otherwise, arithmetic_mean of the same list for side-by-side comparison, the method label exp_mean_log, and a short formula string. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance. Because the engine is pure parse code, latency stays sub-millisecond for ordinary classroom lists and modest API payloads.

Where geometric means show up in real work

Secondary-school and college statistics courses constantly assign geometric-mean drills, comparisons against the arithmetic and harmonic means, and growth-factor word problems; a single trusted oracle that returns cleaned JSON speeds grading and demo setup. Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

What method does the calculator use?

The stable log-space form exp((1/n) · Σ ln(xi)), labeled method exp_mean_log. It matches the classical n-th root of the product when the product is finite.

Read the full KIT documentation →