# 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.

- Calculator id: `mean-types` · Category: Math (`math`) · Tool name: `calculate_mean_types`
- Canonical page: https://tttkmbb.com/math/mean-types · This document: https://tttkmbb.com/math/mean-types.md · JSON definition: https://tttkmbb.com/math/mean-types.json

## Purpose

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.

**Use when:** 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).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `numbers` | number_list |  | required | The values, comma-separated. Geometric and harmonic means require all values to be positive. |

## Output

| Field | 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. |

## Formula

`A = Σx/n; G = (Πx)^(1/n); H = n/Σ(1/x); Q = √(Σx²/n); C = Σx²/Σx; midrange = (min + max)/2`

## Data Sources

- Wikipedia – Pythagorean means — https://en.wikipedia.org/wiki/Pythagorean_means (reference, retrieved 2026-09-24)
- Wikipedia – Root mean square — https://en.wikipedia.org/wiki/Root_mean_square (reference, retrieved 2026-09-24)
- Wikipedia – Contraharmonic mean — https://en.wikipedia.org/wiki/Contraharmonic_mean (reference, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/mean-types?numbers=…`
- `POST https://tttkmbb.com/api/v1/calculate/mean-types` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/mean-types · OpenAPI operationId `calculate_mean_types` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "mean-types", "inputs": {…}}`

## Example

- 1, 2, 4, 8: inputs `{"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: inputs `{"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
```

## Limitations

You need dispersion measures such as variance and standard deviation (use descriptive-statistics) or a weighted average (use weighted-average). All values are computed from the formula above; no measurement or live data is involved.

## 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

- [Descriptive Statistics Calculator](https://tttkmbb.com/statistics/descriptive-statistics.md) — Full summary statistics including variance and quartiles.
- [Weighted Average Calculator](https://tttkmbb.com/statistics/weighted-average.md) — Average with different weights per value.
- [CAGR Calculator](https://tttkmbb.com/finance/cagr.md) — The geometric mean growth rate of an investment.
