Mean Calculator
Find the arithmetic mean (average) of any list of numbers. Enter your values below, and see the formula, a worked example, and ready-to-use Python code underneath.
Enter your data
Separate values with commas, spaces, or new lines — e.g. 12, 15, 9, 21, 14
Please enter at least one valid number.
What the mean tells you
The mean, often just called the average, summarizes a whole data set with a single number: the value each observation would take if the total were shared out equally. It's the most commonly reported measure of central tendency because it's simple to compute and uses every value in the data set.
The mean works best on data that is roughly symmetric and free of extreme outliers. When a data set is heavily skewed, or contains a few unusually large or small values, the median often gives a more representative "typical value," since it isn't pulled around by extremes the way the mean is.
Mean formula
Python code
You can compute the mean by hand with a loop, or with Python's built-in statistics module:
# Method 1 — manual calculation data = [12, 15, 9, 21, 14] mean_value = sum(data) / len(data) print(mean_value) # 14.2 # Method 2 — statistics module import statistics mean_value = statistics.mean(data) # Method 3 — NumPy (useful for larger data sets) import numpy as np mean_value = np.mean(data)
Worked example
Suppose you recorded five quiz scores: 12, 15, 9, 21, and 14.
| x₁ | x₂ | x₃ | x₄ | x₅ |
|---|---|---|---|---|
| 12 | 15 | 9 | 21 | 14 |
- 1Add up all the values.
12 + 15 + 9 + 21 + 14 = 71 - 2Count the values.
There are n = 5 scores. - 3Divide the sum by the count.
71 / 5 = 14.2
The mean quiz score is 14.2.
Frequently asked questions
What is the difference between mean and average?
In everyday language, "average" and "mean" usually refer to the same thing: the sum of a set of values divided by how many values there are. Statisticians call this the arithmetic mean specifically, because there are other kinds of average too, such as the median, mode, geometric mean, and weighted mean.
How does an outlier affect the mean?
The mean uses every value in the calculation, so one very large or very small value can pull it noticeably higher or lower. The median is usually a more representative summary than the mean when a data set has outliers or a skewed shape.
Is the population mean different from the sample mean?
The formula is identical: add up the values and divide by the count. The difference is what the values represent. If your numbers are the entire population, you get the population mean (μ). If they're a sample drawn from a larger population, you get the sample mean (x̄), which is used to estimate μ.
Can the mean be a number that isn't in the original data set?
Yes — this is normal. The mean is a computed summary, not a value that has to appear in the data. The mean of 2, 3, and 4 happens to be 3, but the mean of 2, 3, and 5 is 3.33, which isn't in the set.
What is a weighted mean, and how is it different?
A weighted mean multiplies each value by a weight reflecting its importance or frequency before averaging, rather than treating every value equally. It's used when some observations should count more than others — for example, when exams count more than homework in a course grade.
What happens if I calculate the mean of an empty data set?
The mean is undefined for an empty data set, because the formula divides the sum by the count of values, and division by zero has no defined result. You need at least one value to compute a mean.