Skip to main content
Statistics & Probability

Mean Calculator – Arithmetic, Weighted, Geometric & Harmonic Mean

Calculate the arithmetic, weighted, geometric, harmonic, and quadratic mean of any dataset with step-by-step statistical breakdowns.

MD Abu Hanif Mia

Engineered & Verified by MD Abu Hanif Mia • Nexus Systems Engineering Team (NIST Constants & ISO 80000-2 Mathematical Standards)

Institutional Formula & Benchmark Verification • Last Verified: 2026-11-19

Formula at a Glance

Measures of Central Tendency (Mean, Median & Mode)

Verified Formula
xˉ=1n∑i=1nxi\bar{x} = \frac{1}{n}\sum_{i=1}^{n} x_i

Key Formula Variables:

x̄Arithmetic Mean: Sum of all observations divided by count n
nSample Size: Total count of numeric values in the set
Calculation Methodology: 1. Sum all numbers and divide by n for the mean. 2. Sort values ascending and pick the center (or average of middle two) for median. 3. Identify the highest-frequency value for mode.
Try a 1-Click Scenario:
Continue Your Calculation Workflow

What to Calculate After Mean Calculator – Arithmetic, Weighted, Geometric & Harmonic Mean

The Math Behind It

Calculations for this tool are based on the standard Measures of Central Tendency (Mean, Median & Mode):

xˉ=1n∑i=1nxi\bar{x} = \frac{1}{n}\sum_{i=1}^{n} x_i
  • x̄ = Arithmetic Mean (Sum of all observations divided by count n)
  • n = Sample Size (Total count of numeric values in the set)

1. Sum all numbers and divide by n for the mean. 2. Sort values ascending and pick the center (or average of middle two) for median. 3. Identify the highest-frequency value for mode.

Quick Reference Matrix

Normal Distribution Empirical Rule (68–95–99.7% Sigma Coverage)

Interactive Presets

Percentage of observations falling inside ±1σ to ±3σ around the mean, illustrated with a reference normal distribution (μ = 100, σ = 15).

Normal Distribution Empirical Rule (68–95–99.7% Sigma Coverage)
Sigma BandData Within RangeOutside Range (Tails)Example (μ=100, σ=15)Action
±1σ68.27%31.73%85 – 115
±1.5σ86.64%13.36%77.5 – 122.5
±2σ95.45%4.55%70 – 130
±2.5σ98.76%1.24%62.5 – 137.5
±3σ99.73%0.27%55 – 145

Click any row to test these numbers in the interactive calculator above.

In statistical analysis, the word "average" usually refers to the simple arithmetic mean, yet relying solely on an unweighted additive average can distort results across finance, physics, and data science. Depending on whether your data combines additively, compounds multiplicatively over time, expresses rates per unit of output, or carries unequal importance across observations, different mathematical formulations of the mean are required to identify the true center of the distribution.

Together, the arithmetic, geometric, and harmonic means form the classical Pythagorean means, while weighted, trimmed, and quadratic (Root Mean Square) averages extend central tendency analysis to academic grading, portfolio asset allocation, signal processing, and outlier-resistant econometrics.

Mathematical Formulas for Core Mean Types

Each formulation of the mean corresponds to a distinct algebraic invariant across a dataset of nn observations {x1,x2,…,xn}{x_1, x_2, \dots, x_n}.

1. Arithmetic Mean (xˉ\bar{x} or μ\mu)

The arithmetic mean preserves the additive total of the dataset such that replacing every observation with xˉ\bar{x} leaves the total sum unchanged (nxˉ=∑xin\bar{x} = \sum x_i):

xˉ=1n∑i=1nxi=x1+x2+⋯+xnn\bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i = \frac{x_1 + x_2 + \dots + x_n}{n}

2. Weighted Arithmetic Mean (xˉw\bar{x}_w)

When individual observations carry different frequencies, probabilities, or capital allocations wiw_i, the weighted mean scales each observation by its relative weight:

xˉw=∑i=1nwixi∑i=1nwi=w1x1+w2x2+⋯+wnxnw1+w2+⋯+wn\bar{x}_w = \frac{\sum_{i=1}^{n} w_i x_i}{\sum_{i=1}^{n} w_i} = \frac{w_1 x_1 + w_2 x_2 + \dots + w_n x_n}{w_1 + w_2 + \dots + w_n}

3. Geometric Mean (GMGM)

The geometric mean preserves the multiplicative product of positive real numbers (GMn=∏xiGM^n = \prod x_i). To prevent numerical overflow on large datasets, it can also be evaluated using natural logarithms:

GM=(∏i=1nxi)1n=x1⋅x2⋯xnn=exp⁡(1n∑i=1nln⁡(xi))GM = \left( \prod_{i=1}^{n} x_i \right)^{\frac{1}{n}} = \sqrt[n]{x_1 \cdot x_2 \cdots x_n} = \exp\left( \frac{1}{n} \sum_{i=1}^{n} \ln(x_i) \right)

4. Harmonic Mean (HMHM)

The harmonic mean preserves the sum of reciprocals for positive observations (xi>0x_i > 0), defined as the reciprocal of the arithmetic mean of the reciprocals:

HM=n∑i=1n1xi=n1x1+1x2+⋯+1xnHM = \frac{n}{\sum_{i=1}^{n} \frac{1}{x_i}} = \frac{n}{\frac{1}{x_1} + \frac{1}{x_2} + \dots + \frac{1}{x_n}}

5. Quadratic Mean / Root Mean Square (RMSRMS)

Used extensively in electrical engineering (AC voltage) and error evaluation (RMSE), the quadratic mean preserves the average squared magnitude:

RMS=1n∑i=1nxi2RMS = \sqrt{\frac{1}{n} \sum_{i=1}^{n} x_i^2}

Variable Definitions

  • xix_i: The ii-th numerical observation in the sample or population.
  • nn: Total number of observations in the dataset.
  • wiw_i: Non-negative weight or frequency assigned to observation xix_i.
  • ∏i=1n\prod_{i=1}^{n}: Product operator indicating multiplication across all nn terms.
  • ln⁡(xi)\ln(x_i): Natural logarithm (base ee) of observation xix_i for xi>0x_i > 0.

The Generalized Power Mean Hierarchy (AM-GM-HM Inequality)

All of the classical means belong to the family of generalized power means Mp(x1,…,xn)=(1n∑xip)1/pM_p(x_1, \dots, x_n) = \left(\frac{1}{n}\sum x_i^p\right)^{1/p}, where p=2p = 2 yields the Quadratic Mean, p=1p = 1 yields the Arithmetic Mean, the limit p→0p \to 0 yields the Geometric Mean, and p=−1p = -1 yields the Harmonic Mean. For any set of positive real numbers, these statistics obey a strict mathematical ordering:

RMS≥AM≥GM≥HMRMS \ge AM \ge GM \ge HM

Equality holds across all four metrics (RMS=AM=GM=HMRMS = AM = GM = HM) if and only if every observation in the dataset is identical (x1=x2=⋯=xnx_1 = x_2 = \dots = x_n). The wider the variance of the dataset, the larger the gap between the arithmetic mean and the geometric mean—a phenomenon known in financial economics as volatility drag (GM≈AM−σ22GM \approx AM - \frac{\sigma^2}{2}).

Step-by-Step Worked Calculation Examples

Example 1: Comparing AM, GM, and HM on an Exponential Dataset

Consider a dataset of five doubling measurements: {4,8,16,32,64}{4, 8, 16, 32, 64}.

  1. Arithmetic Mean (AMAM):
    xˉ=4+8+16+32+645=1245=24.80\bar{x} = \frac{4 + 8 + 16 + 32 + 64}{5} = \frac{124}{5} = 24.80
  2. Geometric Mean (GMGM): Expressing each number as a power of $2$ (22,23,24,25,262^2, 2^3, 2^4, 2^5, 2^6):
    GM=(4×8×16×32×64)15=(220)15=24=16.00GM = (4 \times 8 \times 16 \times 32 \times 64)^{\frac{1}{5}} = \left(2^{20}\right)^{\frac{1}{5}} = 2^4 = 16.00
  3. Harmonic Mean (HMHM): Convert all reciprocals to a common denominator of $64$:
    HM=514+18+116+132+164=53164=32031≈10.3226HM = \frac{5}{\frac{1}{4} + \frac{1}{8} + \frac{1}{16} + \frac{1}{32} + \frac{1}{64}} = \frac{5}{\frac{31}{64}} = \frac{320}{31} \approx 10.3226

Notice the strict inequality ordering: $24.80 > 16.00 > 10.3226$.

Example 2: Compound Investment Returns and Equal-Distance Speeds

Suppose a $10,000$10,000 investment surges by +50%+50% in Year 1 (growing to $15,000$15,000) and drops by −50%-50% in Year 2 (falling to $7,500$7,500). Averaging +50%+50% and −50%-50% arithmetically gives 0.00%0.00%, falsely implying the investor broke even. Converting each return rir_i into a positive growth multiplier (1+ri)(1 + r_i) yields $1.50$ and $0.50$:

GMreturn=1.50×0.50−1=0.75−1≈−13.40% per yearGM_{\text{return}} = \sqrt{1.50 \times 0.50} - 1 = \sqrt{0.75} - 1 \approx -13.40\%\text{ per year}

Compounding $10,000$10,000 at −13.40%-13.40% annually for two years ($10,000×0.75=$7,500)($10,000 \times 0.75 = $7,500) reproduces the exact ending balance. Similarly, if a vehicle drives 120 km120\text{ km} outbound at 40 km/h40\text{ km/h} and returns 120 km120\text{ km} at 60 km/h60\text{ km/h}, the harmonic mean gives the true round-trip speed: HM=21/40+1/60=48.0 km/hHM = \frac{2}{1/40 + 1/60} = 48.0\text{ km/h}.

Benchmark Comparison of Mean Formulations

Mean TypeMathematical FormulaInput DomainOutlier BehaviorPrimary Practical Use Case
Arithmetic Mean (AMAM)1n∑xi\frac{1}{n}\sum x_iAll reals (R\mathbb{R})Sensitive to outliersSample means, physical measurements
Weighted Mean (xˉw\bar{x}_w)∑wixi∑wi\frac{\sum w_i x_i}{\sum w_i}xi∈R, wi≥0x_i \in \mathbb{R},\ w_i \ge 0Driven by high weightsCourse GPA, WACC, grouped frequencies
Geometric Mean (GMGM)(∏xi)1/n\left(\prod x_i\right)^{1/n}Positive reals (xi>0x_i > 0)Dampens large spikesCompound annual growth rate (CAGR)
Harmonic Mean (HMHM)n∑(1/xi)\frac{n}{\sum (1/x_i)}Positive reals (xi>0x_i > 0)Weighted toward minimumsEqual-distance speeds, P/E ratios, F1-score
Quadratic Mean (RMSRMS)1n∑xi2\sqrt{\frac{1}{n}\sum x_i^2}
l0 -0
c4,-6.7,10,-10,18,-10 H400000v40
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M1001 80h400000v40h-400000z"/>​All reals (R\mathbb{R})Amplifies large valuesAC voltage/current, RMSE error tracking
Trimmed MeanMean dropping outer k%k%All reals (R\mathbb{R})Outlier resistantJudging scores, financial rate benchmarks

Frequently Asked Questions

What is the mathematical formula used by the Mean Calculator – Arithmetic, Weighted, Geometric & Harmonic Mean?
The Mean Calculator – Arithmetic, Weighted, Geometric & Harmonic Mean uses the Measures of Central Tendency (Mean, Median & Mode): Mean x̄ = (Σ xᵢ) / n | Median = middle sorted value | Mode = most frequent value. Where: x̄ = Arithmetic Mean (Sum of all observations divided by count n); n = Sample Size (Total count of numeric values in the set). 1. Sum all numbers and divide by n for the mean. 2. Sort values ascending and pick the center (or average of middle two) for median. 3. Identify the highest-frequency value for mode.
What is the difference between the arithmetic, geometric, and harmonic mean?
The arithmetic mean sums values and divides by the count, making it ideal for additive quantities. The geometric mean multiplies values and takes the n-th root, capturing multiplicative growth and compounding rates. The harmonic mean takes the reciprocal of the average of reciprocals, accurately averaging rates and ratios such as speed over equal distances.
When should I use the geometric mean instead of the arithmetic mean?
Use the geometric mean whenever data points represent multiplicative growth factors, compound annual growth rates (CAGR), inflation indexes, or proportional changes over time. Because percentages compound sequentially, the arithmetic mean always overstates true multi-period compound performance whenever volatility is present.
Why does the harmonic mean give the exact average speed for a round trip?
When traveling equal distances at different speeds, you spend more time traveling at the slower speed than at the faster speed. The harmonic mean automatically weights each speed by the time spent traveling that segment, whereas the arithmetic mean wrongly assumes you drove for equal durations at both speeds.
Can you calculate the geometric or harmonic mean if a dataset contains zero or negative numbers?
The standard geometric and harmonic means are strictly defined for positive real numbers (x > 0). In the geometric mean, a single zero collapses the entire product to zero, and negative numbers can yield complex roots; for negative percentage returns, convert each rate r into a positive growth multiplier (1 + r) before taking the geometric mean.
What is the AM-GM-HM inequality?
For any dataset of positive real numbers, the Arithmetic Mean (AM) is always greater than or equal to the Geometric Mean (GM), which in turn is always greater than or equal to the Harmonic Mean (HM): AM >= GM >= HM. The three means are equal if and only if every number in the dataset is identical.

Community Discussions & Real Scenarios

Ask specific questions, compare edge cases, and get advice from people calculating the same scenario.