# Descriptive Statistics Calculator

> Computes summary statistics for a list of numbers: count, sum, mean, median, mode, range, sample and population variance and standard deviation, standard error, coefficient of variation, quartiles (linear interpolation) and skewness.

- Calculator id: `descriptive-statistics` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_descriptive_statistics`
- Canonical page: https://tttkmbb.com/statistics/descriptive-statistics · This document: https://tttkmbb.com/statistics/descriptive-statistics.md · JSON definition: https://tttkmbb.com/statistics/descriptive-statistics.json

## Purpose

Computes summary statistics for a list of numbers: count, sum, mean, median, mode, range, sample and population variance and standard deviation, standard error, coefficient of variation, quartiles (linear interpolation) and skewness.

**Use when:** You have a set of numeric observations and need its central tendency, spread or quartiles, e.g. the standard deviation of a data set.

**Do not use when:** You need a single percentile or the percentile rank of one value (use percentile), a standardised score (use z-score), or statistics of two paired variables (use correlation or linear-regression).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `values` | number_list |  | required | The data set, as a list of numbers (comma-separated or JSON array). At least 2 values are needed for sample statistics. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `count` | integer |  | Number of values. |
| `sum` | number |  | Sum of all values. |
| `mean` | number |  | Arithmetic mean = sum / n. |
| `median` | number |  | Middle value of the sorted data (average of the two middle values when n is even). |
| `mode` | string |  | Most frequent value(s), comma-separated when several values tie; 'none' when no value repeats. |
| `mode_count` | integer |  | How many times the mode occurs. |
| `min` | number |  | Smallest value. |
| `max` | number |  | Largest value. |
| `range` | number |  | max − min. |
| `sample_variance` | number |  | Σ(x − mean)² / (n − 1). Use when the data are a sample of a larger population (n ≥ 2). |
| `sample_std_dev` | number |  | √sample_variance (n ≥ 2). |
| `population_variance` | number |  | Σ(x − mean)² / n. Use when the data are the entire population. |
| `population_std_dev` | number |  | √population_variance. |
| `standard_error` | number |  | s / √n (n ≥ 2). |
| `coefficient_of_variation_percent` | number | % | 100 × s / mean; only meaningful for ratio-scale data with a positive mean (omitted when the mean is 0). |
| `q1` | number |  | 25th percentile by linear interpolation (Excel PERCENTILE.INC / R type 7). |
| `q3` | number |  | 75th percentile by the same method. |
| `iqr` | number |  | Q3 − Q1. |
| `skewness` | number |  | Adjusted Fisher-Pearson sample skewness G1 (same as Excel SKEW); requires n ≥ 3 and s > 0. Positive = right tail longer. |

## Formula

`mean = Σx / n; sample_variance = Σ(x − mean)² / (n − 1); population_variance = Σ(x − mean)² / n; standard_error = s / √n; CV% = 100·s / mean; quartile at p: rank = p·(n − 1), value = x(⌊rank⌋) + (rank − ⌊rank⌋)·(x(⌊rank⌋+1) − x(⌊rank⌋)) on sorted data; skewness G1 = n / ((n − 1)(n − 2)) · Σ((x − mean) / s)³`

Quartiles use linear interpolation between order statistics (Hyndman & Fan type 7, the default in Excel PERCENTILE.INC, NumPy and R); other conventions (Tukey hinges, exclusive method) can give different Q1/Q3 for small samples. Sample statistics are omitted for n = 1.

## Data Sources

- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.1 Measures of Location — https://www.itl.nist.gov/div898/handbook/eda/section3/eda351.htm (government, retrieved 2026-09-23)
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.6 Measures of Scale — https://www.itl.nist.gov/div898/handbook/eda/section3/eda356.htm (government, retrieved 2026-09-23)
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.11 Measures of Skewness and Kurtosis — https://www.itl.nist.gov/div898/handbook/eda/section3/eda35b.htm (government, retrieved 2026-09-23)

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/descriptive-statistics?values=…`
- `POST https://tttkmbb.com/api/v1/calculate/descriptive-statistics` 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/descriptive-statistics · OpenAPI operationId `calculate_descriptive_statistics` 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: `calculate_descriptive_statistics` (dedicated) or `run_calculator` with `{"calculator_id": "descriptive-statistics", "inputs": {…}}`

## Example

- 2, 4, 4, 4, 5, 5, 7, 9: inputs `{"values":[2,4,4,4,5,5,7,9]}` → `{"count":8,"sum":40,"mean":5,"median":4.5,"mode":"4","mode_count":3,"min":2,"max":9,"range":7,"sample_variance":4.5714,"sample_std_dev":2.1381,"population_variance":4,"population_std_dev":2,"standard_error":0.7559,"coefficient_of_variation_percent":42.76,"q1":4,"q3":5.5,"iqr":1.5,"skewness":0.8185}`
- 4, 8, 15, 16, 23, 42: inputs `{"values":[4,8,15,16,23,42]}` → `{"count":6,"mean":18,"median":15.5,"mode":"none","sample_std_dev":13.4907,"population_std_dev":12.3153,"q1":9.75,"q3":21.25,"iqr":11.5,"skewness":1.2426}`

```
GET https://tttkmbb.com/api/v1/calculate/descriptive-statistics?values=2%2C4%2C4%2C4%2C5%2C5%2C7%2C9
```

## Limitations

You need a single percentile or the percentile rank of one value (use percentile), a standardised score (use z-score), or statistics of two paired variables (use correlation or linear-regression). Quartiles use linear interpolation between order statistics (Hyndman & Fan type 7, the default in Excel PERCENTILE.INC, NumPy and R); other conventions (Tukey hinges, exclusive method) can give different Q1/Q3 for small samples. Sample statistics are omitted for n = 1. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Sample or population standard deviation?**

Use the sample version (n − 1 denominator) when the values are a sample drawn from a larger population and you want to estimate its spread; use the population version (n denominator) when the values are the whole population of interest.

**Why do my quartiles differ from another tool?**

There are several quartile conventions. This calculator uses linear interpolation (Excel PERCENTILE.INC, R type 7); Excel QUARTILE.EXC, Minitab and the Tukey hinge method interpolate differently and can differ for small n.

**What does the coefficient of variation mean?**

It is the standard deviation as a percentage of the mean, allowing spread to be compared between data sets with different units or scales; it is not meaningful when the mean is near zero or negative.

## Related

- [Percentile Calculator](https://tttkmbb.com/statistics/percentile.md) — Find any percentile or the percentile rank of a value in the same data.
- [Z-Score Calculator](https://tttkmbb.com/statistics/z-score.md) — Standardise a single value using the mean and standard deviation.
- [Confidence Interval Calculator](https://tttkmbb.com/statistics/confidence-interval.md) — Turn the mean and standard deviation into a confidence interval for the population mean.
