Mean, Median, and Mode Calculator

Analyze sample datasets to calculate central tendencies, range, sum, count, geometric mean, and harmonic mean.

Math Audited
Banker's Rounded (Even Half)
Flexible Formatting Parser
Geometric & Harmonic Averages

Separate values with commas, spaces, semicolons, tabs, or newlines. Text is auto-filtered.

Arithmetic Mean
22.14286
Median
23
Mode(s)
23, 38
Mean: 22.14286Median: 23Hover dots to inspectMin: 2Max: 38
Range
36
Sum Total
155
Count (n)
7
Geometric Mean
16.41276
Harmonic Mean
8.8922
Min / Max
2 / 38
1. Sorted Dataset:
[2, 10, 21, 23, 23, 38, 38]
2. Arithmetic Mean (Average):
Mean = Sum / n = (2 + 10 + 21 + 23 + 23 + 38 + 38) / 7 = 155 / 7 β‰ˆ 22.14286
3. Median (Middle Value):
Median (Odd n) = Value at position (n + 1)/2 = Position 4 = 23
4. Mode (Most Frequent):
Highest frequency is 2 times. Mode(s): 23, 38
Frequencies: 2 (x1), 10 (x1), 21 (x1), 23 (x2), 38 (x2)
5. Geometric Mean:
GM = (2 Γ— 10 Γ— 21 Γ— 23 Γ— 23 Γ— 38 Γ— 38)^(1/7) β‰ˆ 16.41276
6. Harmonic Mean:
HM = 7 / (1/2 + 1/10 + 1/21 + 1/23 + 1/23 + 1/38 + 1/38) β‰ˆ 8.8922
Scientific References & Assumptions
Assumptions:
  • Data values are independent, one-dimensional measurements.
  • No grouping weights are applied; all entries carry equal weight.
  • Geometric and Harmonic means assume ratios or positive measurements.
Sources & Citations:

Frequently Asked Questions

What is the difference between mean, median, and mode?

The mean is the mathematical average of a dataset (sum divided by count). The median is the physical middle value when the numbers are sorted. The mode is the most frequently occurring value(s) in the set.

How do you calculate the median if there is an even number of values?

When a dataset has an even number of values, there is no single middle number. The median is calculated by taking the average of the two central numbers after the dataset has been sorted in ascending order.

Can a dataset have more than one mode?

Yes, a dataset can have multiple modes if two or more values share the highest frequency. If a dataset has two modes, it is bimodal; if it has three or more, it is multimodal.

What does it mean if there is no mode?

A dataset has no mode if all values appear with the exact same frequency, which typically occurs when every number in the dataset appears only once.

When is the median preferred over the mean?

The median is preferred over the mean when a dataset is highly skewed or contains extreme outliers. Outliers drag the mean toward them, whereas the median remains stable because it only reflects the center position.

Are geometric mean and harmonic mean always defined?

No, the geometric mean is only defined for non-negative numbers (and normally positive values for fractional powers), while the harmonic mean is undefined if the dataset contains zero due to division by zero.

Why is it important to sort data before finding the median?

The median represents the 50th percentile of a distribution. If the data is not sorted in ascending order, the middle value in the list will be arbitrary and will not represent the true center of the distribution.

How do outliers affect the mean, median, and mode?

Outliers significantly shift the mean because its formula includes all data points. The median is largely unaffected because it relies on ordinal position. The mode is completely unaffected unless the outlier itself is repeated frequently.

About the Mean Median Mode Calculator

The Mean, Median, and Mode calculator is a statistical analysis tool used to measure central tendency, dataset spread, sum, count, and mathematical averages of custom numerical data. Understanding these values is crucial for data science, finance, physics, biology, and everyday decision-making.

Mathematical Formula & Logic

Mathematical Formulas: - Mean (ΞΌ) = (Ξ£ x_i) / n (Sum of all values divided by count) - Median = Central value when sorted (if n is odd) or average of two middle values (if n is even) - Mode = Most frequently occurring value(s) in the dataset - Range = Maximum - Minimum value - Geometric Mean (GM) = (Ξ  x_i)^(1/n) (nth root of product of all values) - Harmonic Mean (HM) = n / (Ξ£ (1 / x_i)) (Reciprocal of the arithmetic mean of reciprocals)

Step-by-Step Example

For the dataset: 10, 2, 38, 23, 38, 23, 21 - Sorted: 2, 10, 21, 23, 23, 38, 38 - Count (n): 7 - Sum: 155 - Mean: 155 / 7 β‰ˆ 22.14286 - Median: Middle value at position 4 is 23 - Mode: 23 and 38 both occur twice (highest frequency), so modes are "23, 38" - Range: 38 - 2 = 36 - Geometric Mean: (2 Γ— 10 Γ— 21 Γ— 23 Γ— 23 Γ— 38 Γ— 38)^(1/7) β‰ˆ 20.14371 - Harmonic Mean: 7 / (1/2 + 1/10 + 1/21 + 1/23 + 1/23 + 1/38 + 1/38) β‰ˆ 8.89219

Reference Data & Values

metricformuladescription
Mean (Average)Ξ£ x / nCenter of gravity of the distribution
Median (Middle)Sorted position center50th percentile, highly outlier-resistant
Mode (Frequent)Max frequencyMost common data points
Geometric Meanⁿ√(x₁ Γ— xβ‚‚ Γ— ...)Typical average for growth rates/proportions
Harmonic Meann / Ξ£(1/x)Average of rates, ratios, or speed

Frequently Asked Questions

The mean is the mathematical average of a dataset (sum divided by count). The median is the physical middle value when the numbers are sorted. The mode is the most frequently occurring value(s) in the set.
When a dataset has an even number of values, there is no single middle number. The median is calculated by taking the average of the two central numbers after the dataset has been sorted in ascending order.
Yes, a dataset can have multiple modes if two or more values share the highest frequency. If a dataset has two modes, it is bimodal; if it has three or more, it is multimodal.
A dataset has no mode if all values appear with the exact same frequency, which typically occurs when every number in the dataset appears only once.
The median is preferred over the mean when a dataset is highly skewed or contains extreme outliers. Outliers drag the mean toward them, whereas the median remains stable because it only reflects the center position.
No, the geometric mean is only defined for non-negative numbers (and normally positive values for fractional powers), while the harmonic mean is undefined if the dataset contains zero due to division by zero.
The median represents the 50th percentile of a distribution. If the data is not sorted in ascending order, the middle value in the list will be arbitrary and will not represent the true center of the distribution.
Outliers significantly shift the mean because its formula includes all data points. The median is largely unaffected because it relies on ordinal position. The mode is completely unaffected unless the outlier itself is repeated frequently.