Moving Average Calculator
Smooth a series to see the trend — simple, weighted and exponential moving averages side by side, with the lag each one introduces.
A simple moving average replaces each point with the mean of the last k values.
How the moving average calculator works
A simple moving average replaces each point with the mean of the last k values. It smooths, and it lags: the center of a k-period window sits (k−1)/2 periods in the past, which is why a moving average always turns after the data does.
The weighted version tapers the weights linearly and the exponential version decays them geometrically; both react faster at the cost of being noisier.
Formula: SMA = (x₁ + … + x_k)/k; EMA_t = αx_t + (1−α)EMA_(t−1)
Worked examples
| Inputs | Latest simple moving average | Note |
|---|---|---|
| A 3-period average | 20.333333 | the last three average to 20.33 |
| A longer window | 18.8 | smoother, and lags twice as much |
| A flat series | 5 | the average is also flat |
FAQFrequently asked questions
What does a moving average do?
Replaces each point with the average of a recent window, suppressing short-term noize so the trend is visible.
How long should the window be?
Long enough to cover one cycle of the noize you want gone. Weekly data with a 7-day cycle wants 7; monthly seasonality wants 12.
Why does it lag?
Because it looks backwards. A k-period average is centred (k−1)/2 periods in the past, so it always turns after the series does.
What is the difference between SMA and EMA?
The simple average weights every point in the window equally and then drops them entirely; the exponential average never fully forgets, weighting recent points more.
Can I use it to forecast?
Only weakly. It describes where the series has been. Forecasting needs a model of where it is going.
Where these figures come from
- NIST Digital Library of Mathematical Functions — reference definitions for elementary and special functions
- Wolfram MathWorld — definitions and formulas for every topic on this page
- NIST/SEMATECH e-Handbook of Statistical Methods — the statistical formulas (mean, variance, z, confidence intervals, sample size)
- Common Core State Standards — Mathematics — the terms and methods taught in US schools
Last checked: September 2026. Formulas are fixed by mathematics and do not change with tax years or regulations.