Moving Average Calculator

Smooth a data series with a simple, exponential or weighted moving average, chart it against the raw values, and check how well it forecasts the next period.

Values in time order, separated by commas, spaces or new lines.
Average type
Number of values in each average.
Latest data value
139
Change from prior average
+2.6667
Averages computed
10
Forecast MAE
5.4074mean absolute one-step error
Forecast RMSE
6.0471
Simple moving average (3)139.6667latest value; also the naive forecast for period 13
  • The first 2 periods have no average because a full window is not yet available.

Show the work

  1. SMA = (sum of the last 3 values) ÷ 3. The first average is available at period 3: (112 + 118 + 115) ÷ 3 = 115
  2. Latest: (138 + 142 + 139) ÷ 3 = 139.6667
  3. Using each average as the forecast for the next period gives 9 forecast errors: mean absolute error 5.4074
  • Data
  • Simple moving average (3)
1101201301401501357911Data1: 1122: 1183: 1154: 1215: 1276: 1247: 1308: 1369: 13110: 13811: 14212: 139Simple moving average (3)3: 1154: 1185: 1216: 1247: 1278: 1309: 132.33333333310: 13511: 13712: 139.666666667
Moving average by period
PeriodValueSimple moving average (3)Forecast for this periodError
1112———
2118———
3115115——
41211181156
51271211189
61241241213
71301271246
81361301279
9131132.33331301
10138135132.33335.6667
111421371357
12139139.66671372

A moving average smooths out short-term ups and downs so the underlying direction of a series is easier to see. It is used for sales and demand figures, website traffic, temperatures, quality-control readings and stock prices. Paste a series in time order, choose the type and period, and the calculator returns every average, the latest value, a chart of the data with the smoothed line, and the error you would have made using each average as a forecast for the next period.

How to use the moving average calculator

  1. Paste the data in time order, oldest first.
  2. Pick Simple (SMA), Exponential (EMA) or Weighted (WMA).
  3. Set the period N, the number of values in each average. For an EMA you can also override the smoothing factor α.
  4. Read the latest average on the tape. The table lists the average at each period, the forecast it implies for the following period and the resulting error.

Moving average formulas

SMAt = (xt + xt−1 + … + xt−N+1) ÷ N
WMAt = (N·xt + (N − 1)·xt−1 + … + 1·xt−N+1) ÷ (N(N + 1)/2)
EMAt = α·xt + (1 − α)·EMAt−1,   α = 2 ÷ (N + 1)

The EMA starts from the SMA of the first N values. The forecast for period t + 1 is the average through period t; forecast accuracy is summarized by the mean absolute error (MAE) and root mean squared error (RMSE).

Worked example

A shop’s weekly orders for 12 weeks are 112, 118, 115, 121, 127, 124, 130, 136, 131, 138, 142, 139.

3-week SMA. The first average is (112 + 118 + 115) ÷ 3 = 115 in week 3. The next is (118 + 115 + 121) ÷ 3 = 118, and the last is (138 + 142 + 139) ÷ 3 = 139.67. That becomes the naive forecast for week 13.

3-week EMA. α = 2 ÷ 4 = 0.5. Starting from 115 in week 3, week 4 is 0.5 × 121 + 0.5 × 115 = 118, week 5 is 0.5 × 127 + 0.5 × 118 = 122.5, and by week 12 the EMA is 138.64.

3-week WMA. Weights 1, 2 and 3 sum to 6, so the latest value is (1 × 138 + 2 × 142 + 3 × 139) ÷ 6 = 139.83.

Which forecasts best? Over weeks 4 through 12, the forecast MAE is 5.41 orders for the SMA, 5.32 for the EMA and 4.70 for the WMA. The orders are trending upward, so every method lags behind; the WMA lags least because it leans hardest on the newest week. Almost every error is positive, which is the signature of lag on a rising series.

Choosing a method

Lag and responsiveness

A simple moving average of period N trails the data by about (N − 1) ÷ 2 periods. Weighted and exponential versions shorten the lag by emphasizing recent values, at the cost of passing through more noise. If turning points matter (spotting a slowdown quickly), prefer an EMA; if steadiness matters, a longer SMA.

Seasonal data

To strip out a repeating cycle, use a period equal to the cycle length, such as 12 for monthly data with a yearly pattern. The average then contains exactly one of each season and reveals the trend.

Beyond smoothing

Moving averages describe the past; they do not model trend. For a series with a steady upward or downward drift, fit a line with the linear regression calculator using the period number as x. For averages where you choose the weights yourself, use the weighted average calculator.

Frequently asked questions

What is the difference between SMA, EMA and WMA?

A simple moving average weights the last N values equally. A weighted moving average gives linearly increasing weights, so the newest value counts N times as much as the oldest in the window. An exponential moving average gives every past value some weight, shrinking by a constant factor each period, so it reacts fastest to recent changes.

How do I choose the period?

Shorter periods follow the data closely but keep more noise; longer periods are smoother but lag behind turning points. Match the period to the cycle you want to remove: 7 for daily data with a weekly pattern, 12 for monthly data with a yearly pattern. Comparing forecast errors for several periods is a practical tiebreaker.

Why does the EMA start at period N?

An EMA needs a starting value. This calculator follows the usual charting convention: the first EMA is the simple average of the first N values, and the recursive formula takes over from there. Some software starts from the first data value instead, which gives slightly different early values that converge over time.

Can a moving average predict the future?

Only naively. Using the latest average as next period's forecast works for a series that wanders around a stable level. For a trending series a moving average always lags behind, as the forecast errors in the example show; a trend line or a method designed for trends will do better.

What smoothing factor does the EMA use?

By default α = 2 ÷ (N + 1), so a 3-period EMA uses 0.5 and a 9-period EMA uses 0.2. You can enter your own α between 0 and 1; larger values react faster.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.