Moving Average Calculator
Smooth any time series with a Simple or Exponential Moving Average. Enter your values, pick a window, and get the full smoothed series plus an overlaid chart.
What is a moving average?
A moving average replaces each point in a time series with an average of nearby values, computed inside a fixed-length window that slides across the data. It filters out short-term wiggles so the underlying trend becomes easier to see, which is why it's the default smoother in finance, sales forecasting, sports analytics, and anywhere a noisy sensor stream needs to be readable.
The two workhorse variants are the Simple Moving Average (SMA), which averages the last n points with equal weight, and the Exponential Moving Average (EMA), which weights recent points more heavily so the smoothed line reacts faster to real changes in the trend.
Moving averages, piece by piece
Simple Moving Average — average the last n points
An SMA slides a fixed-length window across the series and reports the arithmetic mean of the points inside it. Every value in the window carries equal weight, so a spike stays in the average for exactly n steps before it drops out.
Exponential Moving Average — geometrically decaying weights
The EMA is a recursive weighted average: the newest point gets weight α, the previous EMA carries the rest. Weights on older points shrink geometrically, so the recent past dominates without any point ever being fully forgotten.
Choosing α from the window size
The convention α = 2 / (n + 1) makes an EMA behave like an n-period SMA in the sense that both have the same centre-of-mass. Larger n means smaller α, which means more smoothing and slower response to new data.
Lag: why the EMA catches turning points sooner
Both averages lag the underlying series, but the SMA lags by about (n − 1) / 2 periods because every point in the window is weighted equally. The EMA's front-loaded weights cut that lag roughly in half, at the cost of slightly noisier output.
Common uses
- Stock and crypto trend analysis — 20-day, 50-day and 200-day moving averages are standard chart overlays.
- Sales and demand forecasting — smoothing weekly or monthly sales to see the real trend under seasonal noise.
- Sensor smoothing — cleaning up temperature, GPS or accelerometer signals before feeding them to control logic.
- Sports analytics — rolling averages for player performance across a season.
- Website analytics — 7-day rolling active users to remove the weekday/weekend cycle.
Features of this calculator
- SMA and EMA in one tool — switch modes without re-entering your data.
- Handles messy pasted input: commas, spaces, tabs, newlines, currency symbols and thousand separators are all cleaned automatically.
- Full smoothed series shown alongside your raw values in an easy-to-scan table.
- Overlaid SVG line chart: raw series and moving average on the same axes.
- Auto or custom EMA smoothing factor — defaults to the standard α = 2 / (n + 1).
- Show/hide step-by-step working with the exact averages for the first few points.
- Copy the whole result summary or download the panel as a PNG.