Home › Math › Mean Calculator (Arithmetic, Geometric, Harmonic, Quadratic)
Mean Calculator (Arithmetic, Geometric, Harmonic, Quadratic)
Computes the Pythagorean means (arithmetic, geometric, harmonic) of a list of numbers together with the quadratic mean (root mean square), the contraharmonic mean, the midrange and the median.
When to use
You need a specific kind of average, e.g. the geometric mean of growth factors, the harmonic mean of rates or speeds, or the RMS of signal values, or want to compare the different means of one data set.
Do not use when: You need dispersion measures such as variance and standard deviation (use descriptive-statistics) or a weighted average (use weighted-average).
Formula
A = Σx/n; G = (Πx)^(1/n); H = n/Σ(1/x); Q = √(Σx²/n); C = Σx²/Σx; midrange = (min + max)/2
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
numbers | number_list | yes | The values, comma-separated. Geometric and harmonic means require all values to be positive. |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
arithmetic_mean | number | Σx / n. | |
geometric_mean | number | (Πx)^(1/n), computed as exp(mean(ln x)); only for positive values. | |
harmonic_mean | number | n / Σ(1/x); only for positive values. | |
quadratic_mean | number | √(Σx² / n), the root mean square. | |
contraharmonic_mean | number | Σx² / Σx (requires Σx ≠ 0). | |
midrange | number | (min + max) / 2. | |
median | number | Middle value of the sorted list (mean of the two middle values for an even count). | |
count | integer | Number of values n. | |
inequality | string | For positive values: harmonic ≤ geometric ≤ arithmetic ≤ quadratic ≤ contraharmonic, with equality only when all values are equal. |
Example
1, 2, 4, 8: {"numbers":[1,2,4,8]} → {"arithmetic_mean":3.75,"geometric_mean":2.828427,"harmonic_mean":2.133333,"quadratic_mean":4.609772,"contraharmonic_mean":5.666667,"midrange":4.5,"median":3,"count":4}
4 and 9: {"numbers":[4,9]} → {"arithmetic_mean":6.5,"geometric_mean":6,"harmonic_mean":5.538462,"quadratic_mean":6.964194,"contraharmonic_mean":7.461538,"midrange":6.5,"median":6.5,"count":2}
GET https://tttkmbb.com/api/v1/calculate/mean-types?numbers=1%2C2%2C4%2C8
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/mean-types(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/mean-types · Markdown: https://tttkmbb.com/math/mean-types.md · JSON definition: https://tttkmbb.com/math/mean-types.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="mean-types" - OpenAPI operationId:
calculate_mean_types - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Pythagorean means (reference)
- Wikipedia – Root mean square (reference)
- Wikipedia – Contraharmonic mean (reference)
FAQ
When should I use the geometric or harmonic mean?
Geometric for quantities that multiply (growth rates, ratios, index numbers); harmonic for rates over a fixed quantity (average speed over equal distances, price/earnings ratios). The arithmetic mean overstates both.
Why is the geometric mean missing?
It is only defined for positive values (a zero makes it 0 and negatives make it complex), so it and the harmonic mean are omitted, with a note, when the list contains zero or negative numbers.
Related calculators
- Descriptive Statistics Calculator — Full summary statistics including variance and quartiles.
- Weighted Average Calculator — Average with different weights per value.
- CAGR Calculator — The geometric mean growth rate of an investment.