acalculator

What is the average?

Paste or type your numbers to get their average, the sum, the count, and the median.

Your numbers

Read as: 85; 90; 78; 92; 88
Average (mean)
86.6

The average of 85, 90, 78, 92, 88 is 86.6.

Sum
433
Count
5
Median
88
Geometric mean
86.458024
Harmonic mean
86.311763

Average (mean): 86.6. The average of 85, 90, 78, 92, 88 is 86.6.

How to calculate

Computes the average (arithmetic mean) of a list of numbers, with the sum, the count, the median, and the geometric and harmonic means.

Example with the default inputs (Your numbers [85, 90, 78, 92, 88]): The average of 85, 90, 78, 92, 88 is 86.6.

Method: mean = (x₁ + x₂ + … + xₙ) ÷ n

  • Every number in the list counts once. To give some numbers more weight, use the weighted average calculator.
  • The median sorts the list and takes the middle number, or the mean of the two middle numbers when the count is even.
  • The geometric and harmonic means are shown only when every number is above 0.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Your numbers 85, 90, 78, 92, 88 gives Average (mean) 86.6, Sum 433, Count 5, Median 88, Geometric mean 86.458024, Harmonic mean 86.311763.Source: hand calculation in content.mdx: 433 ÷ 5 = 86.6, median 88; geometric and harmonic means from the Python statistics module (geometric_mean, harmonic_mean)
  2. Your numbers 10,000,001, 10,000,003, 10,000,002 gives Average (mean) 10,000,002, Sum 30,000,006, Median 10,000,002.Source: NIST StRD univariate dataset NumAcc1: certified sample mean 10000002 (exact)
  3. Your numbers 2.0018, 2.0017, 2.0018, 2.0019, 2.0018, 2.0017, 2.0015, 2.0014, 2.0015, 2.0015, 2.0017, 2.0018, 2.0018, 2.0019, 2.0019, 2.0021, 2.002, 2.0016, 2.0014, 2.0013, 2.0013, 2.0015, 2.0015, 2.0016, 2.0015, 2.0014, 2.0013, 2.0014, 2.0015, 2.0014, 2.0015, 2.0016, 2.0015, 2.0016, 2.0019, 2.002, 2.002, 2.0021, 2.0022, 2.0023, 2.0024, 2.0025, 2.0027, 2.0026, 2.0026, 2.0026, 2.0027, 2.0026, 2.0025, 2.0024 gives Average (mean) 2.001856, Count 50.Source: NIST StRD univariate dataset Mavro: certified sample mean 2.00185600000000
  4. Your numbers 2, 8 gives Average (mean) 5, Geometric mean 4, Harmonic mean 3.2.Source: hand calculation in content.mdx: (2 + 8) ÷ 2 = 5; √(2 × 8) = 4; 2 ÷ (1/2 + 1/8) = 3.2
  5. Your numbers -4, 0, 7 gives Average (mean) 1, Median 0, Sum 3.Source: hand calculation in content.mdx: (−4 + 0 + 7) ÷ 3 = 1

How it works

For a list of n numbers x₁, x₂, …, xₙ:

  • Average (arithmetic mean): x̄ = (x₁ + x₂ + … + xₙ) ÷ n, the sum divided by the count (NIST e-Handbook 1.3.5.1).
  • Sum: x₁ + x₂ + … + xₙ.
  • Count: n.
  • Median: sort the list. When n is odd, the median is the middle number, the one in position (n + 1) ÷ 2. When n is even, it is the mean of the numbers in positions n ÷ 2 and n ÷ 2 + 1 (NIST e-Handbook 1.3.5.1).
  • Geometric mean: (x₁ × x₂ × … × xₙ)^(1/n), the n-th root of the product. The calculator works it out as e raised to the mean of the natural logarithms, which gives the same number without overflowing on long lists.
  • Harmonic mean: n ÷ (1/x₁ + 1/x₂ + … + 1/xₙ).

Assumptions

  • Every number counts once. The list needs at least 1 number and takes up to 1,000.
  • The geometric and harmonic means are shown only when every number is greater than 0. With a zero or a negative number in the list, those two results are left out and the others still show.
  • For numbers above 0, the harmonic mean is never more than the geometric mean, and the geometric mean is never more than the average. All three are equal only when every number is the same.

Worked examples by hand

85, 90, 78, 92, 88 (five test scores, the default list). The sum is 85 + 90 + 78 + 92 + 88 = 433. There are 5 numbers, so the average is 433 ÷ 5 = 86.6. Sorted, the list is 78, 85, 88, 90, 92, and the middle number (position 3) is the median, 88. The geometric mean is (85 × 90 × 78 × 92 × 88)^(1/5) = 86.458, and the harmonic mean is 5 ÷ (1/85 + 1/90 + 1/78 + 1/92 + 1/88) = 86.312.

2 and 8. The average is (2 + 8) ÷ 2 = 5. The geometric mean is √(2 × 8) = √16 = 4. The harmonic mean is 2 ÷ (1/2 + 1/8) = 2 ÷ 0.625 = 3.2.

10000001, 10000003, 10000002 (NIST's NumAcc1 test data). The sum is 30000006 and the average is 30000006 ÷ 3 = 10000002, which is NIST's certified value. Sorted, the middle number is also 10000002.

−4, 0, 7. The sum is 3 and the average is 3 ÷ 3 = 1. Sorted, the median is 0. The list has a zero and a negative number, so the geometric and harmonic means are not shown.

Other questions people ask

How do I calculate the average of a set of numbers?

Add the numbers up, then divide by how many numbers there are. For 85, 90, 78, 92, and 88, the sum is 433 and there are 5 numbers, so the average is 433 ÷ 5 = 86.6.

Is the average the same as the mean?

In everyday use, yes. "Average" usually means the arithmetic mean: the sum divided by the count. Statisticians also call the median and the mode averages, because each one describes the middle of the data in a different way.

When should I use the median instead of the mean?

Use the median when a few very large or very small values would pull the mean away from a typical value, such as house prices or incomes. The mean of 1, 2, 3, 4, and 100 is 22, but the median is 3.

What are the geometric and harmonic means for?

The geometric mean averages growth rates and ratios: two years of 10% and 50% growth multiply by 1.1 and 1.5, and their geometric mean, about 1.2845, is the steady yearly factor that gives the same total. The harmonic mean averages rates over the same amount of work, such as the average speed for two equal distances driven at 40 and 60 mph, which is 48 mph, not 50.

Why are the geometric and harmonic means missing for my list?

Both need every number to be above 0. A zero makes the product 0 and a reciprocal undefined, and a negative number has no real logarithm, so the calculator leaves them out.

Can the average be a number that is not in my list?

Yes. The mean of 1 and 2 is 1.5, and the mean of whole numbers is often a decimal. The average only has to lie between the smallest and the largest number.

How do I give some numbers more weight than others?

Use a weighted average: multiply each number by its weight, add the products, and divide by the sum of the weights. The weighted average calculator does this for you.