Mean, Median & Mode Calculator

Calculate the mean, median, mode, range, variance, standard deviation, quartiles, and IQR for any dataset. Detects outliers, shows sorted data, and supports both population and sample statistics.

Statistics type:

What Is the Mean, Median & Mode Calculator?

This calculator computes all key descriptive statistics for any list of numbers you provide. Enter values separated by commas, spaces, or line breaks — the parser handles mixed delimiters automatically. Results update instantly when you click Calculate.

  • All central tendency measures — mean, median, and mode (including multi-mode datasets where several values tie for highest frequency).
  • Spread and variability — range, variance, standard deviation (population and sample), and coefficient of variation.
  • Quartiles and IQR — Q1, Q2, Q3, and the interquartile range, calculated using the inclusive quartile method.
  • Outlier detection — values outside Q1 − 1.5×IQR and Q3 + 1.5×IQR are flagged automatically using Tukey's fence method.
  • Sorted data and frequency table — see your data in order with index labels, and a count of how often each unique value appears.

Formula

Mean (Arithmetic Average)

x̄ = (Σxᵢ) / n

Median

Middle value when data is sorted (odd n)

Average of two middle values (even n)

Mode

Most frequently occurring value(s) in the dataset

Variance

Population: σ² = Σ(xᵢ − x̄)² / n

Sample: s² = Σ(xᵢ − x̄)² / (n − 1)

Standard Deviation

Population: σ = √σ²

Sample: s = √s²

Quartiles & IQR

Q1 = 25th percentile, Q2 = Median (50th), Q3 = 75th percentile

IQR = Q3 − Q1

Outlier bounds: [Q1 − 1.5×IQR, Q3 + 1.5×IQR]

SymbolNameDescription
nCountNumber of values in the dataset
MeanSum of all values divided by n
MedianMedianMiddle value of the sorted dataset
ModeModeMost frequently occurring value(s)
RangeRangeMaximum minus minimum value
σPopulation SDStandard deviation using n in the denominator
sSample SDStandard deviation using n−1 (Bessel correction)
IQRInterquartile RangeQ3 − Q1; the spread of the middle 50% of the data
Q1/Q3Quartiles25th and 75th percentile of the sorted data

How to Use

  1. 1
    Enter your data: Type or paste numbers into the text area. Use commas, spaces, or new lines as separators — all are accepted.
  2. 2
    Choose population or sample: Toggle the switch to select whether your data is the full population (divides by n) or a sample from a larger group (divides by n−1, Bessel's correction).
  3. 3
    Click Calculate: Press the Calculate button or hit Enter. All statistics appear instantly: mean, median, mode, range, variance, SD, quartiles, and IQR.
  4. 4
    Review detailed output: Scroll down to see the sorted data display (with outliers highlighted), the frequency table, and a mini bar chart of the distribution.

Example Calculation

Dataset: 4, 7, 13, 2, 7, 1, 8

Input: 4, 7, 13, 2, 7, 1, 8 (n = 7 values)

Sorted: 1, 2, 4, 7, 7, 8, 13

Sum = 4 + 7 + 13 + 2 + 7 + 1 + 8 = 42

Mean = 42 / 7 = 6

Median = 7 (4th value in sorted list)

Mode = 7 (appears twice)

Range = 13 − 1 = 12

Q1 = 2, Q2 = 7 (median), Q3 = 8

IQR = Q3 − Q1 = 8 − 2 = 6

Outlier fences: [2 − 9, 8 + 9] = [−7, 17] → no outliers

Pop. Variance σ² = Σ(xᵢ−6)² / 7 ≈ 13.14

Pop. SD σ ≈ 3.63 Sample SD s ≈ 3.92

StatisticValue
Count (n)7
Mean (x̄)6
Median7
Mode7
Range12
Min / Max1 / 13
Q1 / Q32 / 8
IQR6
Pop. Std Dev (σ)≈ 3.630
Sample Std Dev (s)≈ 3.916

Understanding Mean, Median & Mode

Mean, Median, or Mode: Which to Use?

All three measures describe the "centre" of a dataset, but they respond differently to the shape and quirks of your data:

  • Mean — uses every value, so it is sensitive to extreme outliers. A single very large value pulls the mean upward. Best for symmetric distributions with no outliers (e.g., test scores, heights).
  • Median — the middle value after sorting. Completely unaffected by outliers. Preferred for skewed data such as income, house prices, or any dataset with extreme values on one end.
  • Mode — the most common value. Most useful for categorical or discrete data (e.g., the most popular shoe size, the most frequent survey response). A dataset can have zero, one, or multiple modes.

Skewness rule of thumb

In a right-skewed distribution (long tail to the right): Mode < Median < Mean. In a left-skewed distribution: Mean < Median < Mode. When these three values are equal, the distribution is perfectly symmetric.

Why Standard Deviation Matters

Two datasets can have identical means yet look completely different. Standard deviation quantifies how spread out the values are around the mean. A small SD means values cluster tightly; a large SD means they are widely dispersed.

  • Population SD (σ) — use when your data IS the entire population (every member is included). Divides by n.
  • Sample SD (s) — use when your data is a sample drawn from a larger population and you want to estimate the true population SD. Divides by n−1 (Bessel's correction), which removes the downward bias present in dividing by n.
  • The coefficient of variation (CV) = (SD / mean) × 100% lets you compare variability across datasets with different units or scales.

Quartiles and the IQR

Quartiles divide the sorted data into four equal parts. The three dividers are Q1 (25th percentile), Q2 (50th percentile = median), and Q3 (75th percentile). The interquartile range IQR = Q3 − Q1 represents the spread of the middle 50% of your data.

Unlike the full range (max − min), the IQR is resistant to outliers. A very large or small extreme value shifts the range dramatically but barely changes the IQR. This makes it the preferred measure of spread in box-and-whisker plots and robust statistical summaries.

Detecting Outliers with the IQR Method

The Tukey fence method is the most widely used rule for identifying outliers in exploratory data analysis:

Lower fence = Q1 − 1.5 × IQR

Upper fence = Q3 + 1.5 × IQR

Any value below the lower fence or above the upper fence is flagged as an outlier.

Using a multiplier of 3 instead of 1.5 identifies "extreme outliers." This calculator uses the standard 1.5×IQR fence. Outliers are highlighted in the sorted data display and listed separately in a callout box.

Skewness: When Mean ≠ Median

The relationship between mean and median is a quick indicator of distributional shape. If the mean is significantly higher than the median, your data is right-skewed — a few large values are pulling the average up. This is common in income data, wait times, and real estate prices. If the mean is lower than the median, the data is left-skewed.

In practice, always report the median alongside the mean for skewed datasets, and use the IQR alongside standard deviation. These pairs give a more complete picture of both centre and spread.

Applications Across Fields

FieldCommon UseBest Measure
FinanceAverage return on investmentMean (symmetric returns)
Real estateTypical house priceMedian (right-skewed prices)
EducationClass test score summaryMean + SD
HealthcarePatient wait time analysisMedian + IQR (skewed)
Quality controlProduction defect ratesMean + 3σ control limits
RetailMost popular product sizeMode
SportsPlayer performance consistencyMean + SD or IQR

Frequently Asked Questions

When should I use the median instead of the mean?

Choose the median over the mean in these situations:

  • Skewed distributions — a few very large or very small values distort the mean
  • Datasets with outliers — one extreme value can shift the mean significantly
  • Income, housing prices, wait times — all classically right-skewed
  • Ordinal data where the numeric differences between ranks are not meaningful

For symmetric, bell-shaped distributions with no outliers (e.g., heights, IQ scores), mean and median give essentially the same answer and both are appropriate.

What happens when a dataset has multiple modes?

The mode is the value that appears most often. A dataset can have:

  • No mode — if all values appear exactly once
  • One mode (unimodal) — one value appears more often than all others
  • Two modes (bimodal) — two values share the highest frequency
  • Three or more modes (multimodal) — more than two values tie for highest frequency

This calculator lists all modes when there is a tie. Bimodal distributions often signal two distinct subgroups in your data (e.g., two exam score clusters from students who did vs. did not study).

What is the difference between population and sample standard deviation?

  • Population SD (σ): Use when your dataset includes every member of the group you are describing. Example: exam scores for all students in a class.
  • Sample SD (s): Use when your dataset is a random sample and you want to estimate the true population SD. Example: quality-testing 50 units from a batch of 10,000.
  • Bessel's correction (÷ n−1) removes the systematic underestimate that would result from dividing by n when working with a sample.
  • For large n the difference is negligible; for small n (under ~30) the distinction matters.

What does the IQR tell me that the range doesn't?

  • Range = max − min: simple but captures only the two most extreme points
  • IQR = Q3 − Q1: the spread of the central 50% of data, robust to outliers
  • One outlier can double the range but barely change the IQR
  • IQR is used in box plots (the box spans Q1 to Q3)
  • IQR × 1.5 defines the Tukey fences for outlier detection

How does the calculator identify outliers?

The Tukey fence method (used in box-and-whisker plots):

  • Compute Q1, Q3, and IQR = Q3 − Q1
  • Lower fence = Q1 − 1.5 × IQR
  • Upper fence = Q3 + 1.5 × IQR
  • Any value outside these fences is flagged as an outlier

Outliers in this calculator are highlighted in the sorted data display and listed in a separate callout box. Note that outliers are not automatically removed — always investigate them before deciding whether to exclude them.

When is the mode not a useful statistic?

  • Continuous data with high precision — no two values are likely to be identical, so the mode is often undefined or meaningless
  • Very small datasets — ties at frequency 1 are common by chance
  • Roughly uniform distributions — many values share the highest frequency, making the mode non-informative
  • Mode is most useful for: shoe/clothing sizes, survey Likert scale responses, exam score bins, and any discrete data with clear peaks

What is the difference between range and IQR?

  • Range: single calculation, easy to understand, but one outlier can make it misleadingly large
  • IQR: requires sorting and quartile computation, but gives a stable estimate of spread for the typical data points
  • Example: dataset [1, 2, 3, 4, 100] — Range = 99 (suggests huge spread), IQR = 2.5 (reveals that most values are tightly clustered)
  • Always report both when summarising a dataset: range shows the full extent, IQR shows the typical spread

Related Calculators