Home / Forecasting and Analytics / Moving Average Forecast Calculator
Forecasting and Analytics
Moving Average Forecast Calculator (Simple and Weighted, with Error Metrics)
Turn a run of past demand into a next-period forecast, then see how good that forecast really is. Paste your demand history, pick a simple or a weighted moving average, set the window, and the tool returns the forecast for the next period along with the four numbers that tell you whether to trust it: MAD, RMSE, MAPE, and the bias. It also sweeps every window for you and names the one with the lowest RMSE, so you stop guessing at the number of periods to average. On top of the numbers it draws the actual demand and the forecast on the same chart, so you can see where the forecast lags, where it overshoots, and where it tracks. Every value stays in your browser.
A moving average is the plainest forecast there is, and that is its strength. You average the last few periods of demand and use that average as the forecast for the next one. As each new period arrives, the window slides forward, the oldest value drops off, and the average moves with it, which is where the name comes from. It smooths out the random wobble in a demand series so you plan against the signal rather than the noise. The catch is that a moving average only describes the recent past, so it lags whenever demand is trending, and it says nothing useful about demand that arrives in lumps. This calculator makes both the forecast and its limits visible. It gives you the next-period number, grades it against the periods where a forecast existed, shows you the direction of the miss through the bias, and recommends a window from the data instead of leaving you on the usual default of three. It is free, needs no sign-up, and runs entirely in your browser.
In short: a simple moving average forecasts the next period as the average of the last n actual demands, F(t) = (D(t-1) + D(t-2) + … + D(t-n)) / n, while a weighted moving average puts more weight on recent periods, F(t) = w1*D(t-1) + w2*D(t-2) + … + wn*D(t-n) with the weights summing to 1. The tool grades the fit with the in-sample error e = actual – forecast: MAD is the mean of the absolute errors, RMSE is the square root of the mean squared error, MAPE is the mean absolute percentage error, and bias is the sum of the errors, whose sign tells you the direction of the miss. On the default rising series with a simple moving average and n = 3, the next-period forecast is 34.67, with MAD 2.85, RMSE 3.35, MAPE 9.3%, and a bias of +25.7 because the average lags the trend. The window sweep recommends n = 2, which has the lowest RMSE on this series.
next-period forecast
34.67next-period forecast
- MAD (mean absolute deviation)
- 2.85
- RMSE (root mean square error)
- 3.35
- MAPE
- 9.3%
- Bias (sum of errors)
- 25.7
- Best window by RMSE
- n = 2
The forecast is graded on 9 in-sample periods. A positive bias means the forecast runs below actual demand (it lags a rising trend). The window sweep suggests n = 2 (lowest RMSE); a shorter window tracks a trend, a longer one smooths noise.
How the calculator works
The tool does the same work you would do by hand to build a moving average forecast and then check it, only faster and with the error metrics attached. You give it a demand history, one value per period, and tell it whether to weight recent periods or treat them equally. It slides a window of n periods across the series, averages the values in the window, and uses that average as the forecast for the next period. It repeats that step for every period where enough history exists, so it builds a forecast for each of those periods and can compare the forecast against what actually happened. From those paired numbers it computes the error metrics, and from a run of trial windows it picks the one that fits your series best. You read the next-period forecast at the top and the quality of the fit just below it.
The forecast itself is a plain average. For a simple moving average the forecast for period t is the mean of the last n actual demands, F(t) = (D(t-1) + D(t-2) + … + D(t-n)) / n. With n = 3 on the default series, the next-period forecast is the average of the last three values, 34, 33, and 37, which is 34.67. A weighted moving average keeps the same idea but lets you decide how much each recent period counts, F(t) = w1*D(t-1) + w2*D(t-2) + … + wn*D(t-n), with the weights normalized to sum to 1 and the largest weight usually on the most recent period. Weighting the newest demand more heavily makes the forecast turn faster toward a trend, which is why the weighted example below beats the equal-weight average on this rising series.
The grading is where the tool earns its keep. For every period that has a forecast it takes the error, e = actual – forecast, and rolls those errors into four measures. MAD is the mean of the absolute errors, so it reads in the same units as demand. RMSE is the square root of the mean of the squared errors, which punishes big misses harder than small ones. MAPE is the mean of the absolute percentage errors, which lets you compare across items of different size. Bias is the sum of the errors, and its sign matters: a positive bias means the forecast sat below actual demand across the run, which is the fingerprint of a moving average lagging a rising trend. This work sits inside the Forecasting and Analytics silo and feeds the wider Supply Chain hub, because a demand forecast is the number the rest of the planning chain runs on.
Simple against weighted moving average
The two methods differ in one choice: whether every period in the window counts the same. A simple moving average gives each of the last n periods equal weight, so a three-period average is just the three values added up and divided by three. That even weighting is what makes it smooth, because a single odd period only moves the average by a third of its surprise, but it is also what makes it slow, because the average keeps carrying old periods at full strength until they fall out of the window. On demand that holds a steady level with random noise around it, equal weighting is exactly what you want, since the noise averages out and the level shows through.
A weighted moving average changes the answer by letting recent periods pull harder. You set a weight for each position in the window, largest for the most recent period, and the tool normalizes them to sum to 1 so the forecast stays on the same scale as demand. Weights of 0.5, 0.3, and 0.2 mean the last period counts for half the forecast, the one before for a third, and the one before that for a fifth. Because the newest demand dominates, the forecast turns toward a change sooner than an equal-weight average of the same length would. That responsiveness helps when demand is drifting up or down, and it is the reason the weighted example on the default series comes out with a lower RMSE than the plain three-period average.
The trade is the same one that runs through all of moving average forecasting. Weighting recent periods more heavily makes the forecast quicker to follow a real change, but it also makes it quicker to chase a random spike, because a one-off high period now moves the forecast by half rather than a third. Equal weighting is steadier but slower. Neither is right in the abstract. The weighted method wins when the recent past is the better guide, as on a trend, and the simple method wins when the whole window is equally informative, as on stable demand. The tool lets you switch between them and watch the error metrics move, so you can decide from your own series rather than from a rule of thumb.
Choosing the window
The window is the number of periods you average, and it is the single most consequential setting on a moving average. A short window reacts fast. With n = 2 the forecast is the average of just the last two periods, so it turns almost as soon as demand does, which is good on a trend and bad when a single period is noise. A long window is steady. With n = 8 the forecast carries eight periods, so one strange period barely moves it, which smooths noise well but leaves the forecast lagging any real change for several periods. Every window is a point on that spectrum between fast and noisy at one end and steady and slow at the other.
Most people reach for three periods out of habit, and three is often a fine start, but it is rarely the best window for a specific series. The right window depends on how much of the wobble in your demand is signal you want to follow and how much is noise you want to smooth away. A series that trends wants a shorter window so the forecast keeps up. A series that holds a level wants a longer window so the noise cancels. Because that balance is a property of your data, the sensible way to set the window is to test several and measure the fit, not to pick a number in advance.
That is what the window sweep does. The tool computes the RMSE for every window from n = 2 upward and reports the window with the lowest RMSE for your series. On the default rising series the sweep lands on n = 2, because the shortest window tracks the trend best and the longer windows lag it. On the stable series in the fourth worked example the same sweep recommends n = 8, because there the longer window smooths the noise best and a short one just chases it. Same tool, opposite advice, both driven by the data. Use the recommended window as a starting point, then adjust it if you have a reason the RMSE cannot see, such as a known structural break partway through the history.
Reading the error metrics
A forecast without an error measure is just a number, so the tool grades every forecast on the periods where one existed. The four metrics answer different questions and are worth reading together. MAD, the mean absolute deviation, is the average size of the miss in the units of demand, so a MAD of 2.85 means the forecast was off by about 2.85 units per period on average. It is easy to explain and it does not blow up on outliers, which makes it a good everyday measure of typical error.
RMSE, the root mean square error, also reads in the units of demand but weights large misses more heavily, because it squares the errors before averaging and then takes the square root. A forecast with a few big misses will have an RMSE noticeably above its MAD, while a forecast whose errors are all similar in size will have the two measures close together. RMSE is the metric the window sweep optimizes, because squaring makes it sensitive to exactly the kind of large occasional miss you most want a forecast to avoid. MAPE, the mean absolute percentage error, converts the miss into a percentage of actual demand, so a MAPE of 9.3% means the forecast was off by about nine percent per period. Because it is unit-free it lets you compare accuracy across items of very different volume, but it has a known weakness: it skips periods where actual demand is zero, because dividing by zero is undefined, and it inflates badly when demand is small, which is why the intermittent example below shows a huge MAPE.
Bias is the one metric that carries a direction, and it is easy to overlook next to the size measures. It is the plain sum of the errors, not the absolute errors, so positive and negative misses can cancel. A bias near zero means the forecast was about as often high as low, which is what you want. A large positive bias, like the +25.7 on the default series, means the forecast sat below actual demand almost every period, which is exactly what a moving average does on a rising trend: it is always averaging older, lower numbers, so it always forecasts low. A large negative bias would mean the forecast ran high, the pattern you see when a moving average lags a falling trend. Reading the bias tells you not just how big the misses were but which way they leaned, and a bias that keeps growing period after period is the clearest sign the method or the window no longer fits.
Bias and lag on a trend
The most important thing to understand about a moving average is that it lags, and the bias is how that lag shows up in the numbers. A moving average forecasts the next period from periods that already happened, all of which are older than the period you are forecasting. When demand is flat that does not matter, because old and new periods sit at the same level. When demand is rising, every period in the window is lower than the period you are trying to forecast, so the average comes out low and the forecast falls short. The steeper the trend and the longer the window, the further behind the forecast falls.
On the default series demand climbs from 20 to 37 over twelve periods, a clear upward trend, and the three-period forecast trails it the whole way. Because the forecast is low almost every period, the errors are almost all positive, and their sum, the bias, piles up to +25.7. That is not a random run of bad luck, it is the structural signature of the method meeting a trend. You can see it on the chart, where the green forecast line sits below and to the right of the blue actual line, always a step behind the climb. The lag is why the sweep prefers the shortest window here: n = 2 carries less old demand, so it lags less and the bias is smaller.
The practical reading is that a large, one-directional bias on a moving average is a message, not a defect to tune away. It is telling you that demand has a trend the method cannot follow. You can shorten the window to reduce the lag, and the sweep will help you find the shortest window that still smooths enough, but you cannot make the lag disappear while you are still averaging past periods. If the bias stays large after you have shortened the window as far as the noise allows, that is the point to switch to a method built for trends, such as exponential smoothing with a trend term or a linear regression on time. The bias is the trigger, and reading it is what stops you from shipping a forecast that is quietly low every single period.
When a moving average is the wrong tool
A moving average assumes demand is fairly stable, wobbling around a level that changes slowly if at all. When that assumption holds it is hard to beat for its simplicity. When it breaks, the method breaks with it, and there are two common ways it breaks. The first is a strong trend, which the section above covers: the forecast lags and the bias grows, and past some point a trend-aware method will do better. The second is intermittent or lumpy demand, where the series is mostly zeros with occasional spikes, and there the moving average does not just lag, it describes nothing real.
The intermittent case is worth seeing clearly, because it is where a moving average misleads most. On a series that is zero for most periods and then jumps, averaging the recent window gives you a small fractional number that will never match either the zeros or the spikes. The forecast is always wrong, badly, and the MAPE explodes because you keep dividing real misses by tiny or zero actuals. The fifth worked example shows this: a lumpy series produces a MAPE near 45%, a number so large it is really just telling you the method does not apply. Averaging cannot forecast something that arrives in bursts, because the whole idea of a central level does not fit a series that has no stable level to find.
The way to avoid the trap is to classify the item before you forecast it. An XYZ analysis groups items by how variable their demand is, separating the smooth items a moving average handles well from the erratic and lumpy items it does not. Run that classification first, keep the moving average for the smooth and reasonably stable items, and route the trending items to exponential smoothing or a regression trend and the lumpy items to a method built for intermittent demand. A forecast error metrics tool with a tracking signal is the other half of this discipline, because it watches the bias over time and flags the moment a method that used to fit has drifted out of fit. The moving average is a good default, not a universal one, and knowing its two failure modes is what keeps you from using it where it cannot work.
Preparing a clean demand series
The forecast is only as good as the history you feed it, so a little care with the series pays off. Enter demand, not sales, if the two differ. Sales are capped by what you had in stock, so a period that sold out understates the demand that was really there, and averaging a censored low period drags the forecast down. If you know a period was stocked out, it is better to estimate the true demand for that period than to average the truncated sales figure. The tool takes one value per period, separated by a new line, a space, or a comma, so you can paste a column straight from a spreadsheet.
Order matters and so does spacing. List the periods oldest first, so the most recent period is at the bottom, because the tool treats the last value as the latest demand and forecasts the period after it. Keep the periods evenly spaced, one per week or one per month, and do not mix them, because a moving average assumes each step is the same length of time. If you have a gap where a period is genuinely missing, decide whether a zero or an estimate is the honest value, since a stray zero in an otherwise steady series will pull the average down and show up as a bias.
Watch for the things that are real but not part of the underlying pattern. A one-off promotion, a price change, or a data-entry error is a spike the moving average will treat as signal and smooth into several future forecasts. If a period is a known anomaly rather than genuine demand, clean it before you forecast, because the method has no way to tell an outlier from a real jump. Enough history helps too: give the tool at least a handful more periods than your window so the error metrics have several forecasts to grade, since a MAD or RMSE computed on one or two periods is not worth much. Clean, ordered, evenly spaced demand with anomalies handled is what turns the forecast from a rough guess into a number you can plan against.
Five worked examples
Example 1: simple moving average, n = 3 (the widget opens on this)
This is the case the tool opens on, and it shows the method and its main weakness in one go. The series is 20, 24, 22, 26, 25, 29, 27, 31, 30, 34, 33, 37, a demand history that climbs steadily. With a simple moving average and a window of n = 3, the next-period forecast is the average of the last three values, 34, 33, and 37, which is 34.67. Graded over the nine periods that had a forecast, the fit comes out at MAD 2.85, RMSE 3.35, MAPE 9.3%, and a bias of +25.7. The lesson is in that bias: on a rising trend the moving average lags, so it forecasts below actual demand almost every period, and the errors pile up into a large positive bias. The forecast is usable, but it is structurally low, and the bias is the number that tells you so.
Example 2: the window sweep on the same series
This case keeps the same rising series and lets the sweep pick the window instead of defaulting to three. Testing each window, n = 2 gives an RMSE of 2.40 and a next-period forecast of 35.00, against an RMSE of 3.35 at n = 3 and 3.62 at n = 4. The shortest window wins because it carries the least old demand, so it lags the trend least and fits best. The lesson is not to settle for n = 3 by habit. The sweep finds the best window from the data automatically, and here it says the two-period average tracks this trending series more closely than the three or four-period averages do. On a different series the sweep would point the other way, which is the whole point of letting the data choose.
Example 3: weighted moving average on the same series
This case swaps equal weighting for weights that favor recent demand, still on the same rising series. With weights of 0.5, 0.3, and 0.2, most recent first, the next-period forecast is 35.20, with MAD 2.52, RMSE 3.09, and MAPE 8.2%. Compared against the plain three-period average from the first example, the weighted forecast fits better, RMSE 3.09 against 3.35, because putting half the weight on the newest period lets the forecast turn toward the trend faster than equal weighting can. The lesson is that on trending demand a weighted moving average beats an equal-weight average of the same length, since the recent past is the better guide when demand is drifting and weighting says so directly.
Example 4: stable, no-trend demand
This case shows the opposite situation, where a longer window wins. The series is 50, 52, 48, 51, 49, 50, 53, 47, 50, 51, demand that holds around 50 with only random noise and no trend. With a simple moving average and n = 3, the next-period forecast is 49.33, with MAD 1.52, RMSE 1.95, MAPE 3.1%, and a bias of just +0.7. The window sweep here recommends n = 8. The lesson is the mirror image of the trending case: for stable demand a longer window smooths the noise best, because averaging more periods cancels more of the random wobble, and the bias sits near zero because there is no trend to lag. Longer is better here, shorter was better on the trend, and the sweep gets both right from the data.
Example 5: intermittent, lumpy demand
This case breaks the method on purpose to show where it does not belong. The series is 5, 0, 0, 8, 0, 3, 0, 0, 12, 0, 4, 0, demand that arrives in occasional bursts with long runs of zero between them. With a simple moving average and n = 3, the next-period forecast is 1.33 and the MAPE is 45.5%. The forecast matches neither the zeros nor the spikes, because averaging a lumpy series produces a small fractional number that is always wrong, and the MAPE explodes because the misses are being divided by tiny or zero actuals. The lesson is that a moving average is the wrong tool for lumpy demand. Classify the item with an XYZ analysis first, and route intermittent demand to a method built for it rather than forcing an average onto a series that has no stable level to find.
Three expert tips
Match the window to the pattern
The window sets how the forecast trades speed against smoothness, so match it to the shape of your demand rather than defaulting to three periods. A short window follows a trend or a level shift quickly but chases noise, while a long window is steady but slow to turn. The two worked examples make the point: the rising series fits best at n = 2, and the flat series fits best at n = 8. Rather than guessing, use the built-in window sweep and take the n with the lowest RMSE for your own series, then adjust only if you know something the RMSE cannot see, such as a structural break partway through the history. The best window is a property of the data, and the sweep reads it off for you.
Read the bias, not only the size of the error
MAD and RMSE tell you how big the average miss is, but they say nothing about which way it leaned. The bias, the sum of the errors, carries that direction. A moving average on a trending series is persistently biased because it lags, forecasting low on a rising trend and high on a falling one, and the sign of the bias tells you which. A bias near zero is what you want. A bias that keeps growing period after period is the signal that the method or the window no longer fits, and it is the trigger to shorten the window or change method. A forecast error metrics tool watches exactly this drift with a tracking signal, so the size measures and the bias together give you both how wrong the forecast is and why.
Know when a moving average is the wrong tool
A moving average assumes fairly stable demand, and it fails in two known ways when that assumption breaks. For a clear trend it lags, and exponential smoothing with a trend term or a linear regression on time will beat it once the bias grows past what shortening the window can fix. For intermittent or lumpy demand it is misleading, producing a fractional forecast that matches nothing and a MAPE so large it is really just saying the method does not apply. The discipline is to classify the item first with an XYZ analysis, keep the moving average for the smooth and stable items where it shines, and send the trending and lumpy items to methods suited to their pattern. Using the right tool for the pattern beats tuning the wrong one.
Common mistakes to avoid
The first mistake is defaulting to a three-period window without checking. Three is a habit, not a rule, and it is rarely the best fit for a specific series. The window sweep tests every window and names the one with the lowest RMSE, so there is no reason to guess. The second mistake is reading only the size of the error and ignoring its direction. A forecast with a moderate RMSE can still be low every single period, which the bias reveals and the size measures hide, so always read the bias alongside MAD and RMSE. A large one-directional bias means the forecast is structurally off, not just noisy.
A third mistake is forecasting sales instead of demand, which quietly biases the forecast down whenever a period was stocked out, because censored sales understate the demand that was really there. A fourth is feeding the method demand it cannot handle, a strong trend or a lumpy intermittent series, and then trying to tune the window to fix a problem the window cannot fix, when the real answer is a different method. A fifth is leaving anomalies in the history, since a one-off promotion or a data error is a spike the moving average will smear across several future forecasts. Test the window, read the bias, forecast true demand, match the method to the pattern, and clean the obvious anomalies, and the forecast the tool gives will hold up.
Where this calculator fits
It suits anyone who has to turn a demand history into a next-period number and wants to know how much to trust it. A demand planner can paste a series, let the sweep pick the window, and read the forecast against MAD, RMSE, MAPE, and the bias before committing it to a plan. An operations or inventory analyst can use the forecast as the input to a reorder point or a safety stock calculation, with the error metrics feeding the variability those calculations need. A student or an analyst learning forecasting can see the simple and weighted methods side by side, watch the window sweep explain itself, and read the bias to understand why a moving average lags a trend.
Because a forecast is the number the rest of planning runs on, this tool hands off naturally to the rest of the work. When the bias tells you a moving average is lagging a trend, an Exponential Smoothing calculator is the next step, since it can carry a trend term the moving average cannot. When you want to grade a forecast from any method against a target, a Forecast Error Metrics calculator takes the same MAD, RMSE, and MAPE further with a tracking signal that watches the bias over time. Before you forecast at all, an XYZ Demand Classification separates the smooth items a moving average handles from the erratic and lumpy items it does not, so you point each item at the right method. The Forecasting and Analytics hub gathers the forecasting tools, and the Supply Chain hub carries the tools that turn a demand forecast into an inventory and replenishment plan.
Frequently asked questions
What does this moving average forecast calculator do?
It turns a demand history into a next-period forecast and grades how good that forecast is. You paste your demand, one value per period, pick a simple or weighted moving average, and set the window, and it returns the forecast for the next period along with MAD, RMSE, MAPE, and the bias. It also sweeps every window and names the one with the lowest RMSE, and it draws the actual demand against the forecast so you can see where the forecast lags or overshoots. On the default rising series with a simple moving average and n = 3, the next-period forecast is 34.67, with MAD 2.85, RMSE 3.35, MAPE 9.3%, and a bias of +25.7 because the average lags the trend, and the window sweep recommends n = 2. Every value stays in your browser.
How is a simple moving average forecast calculated?
A simple moving average forecasts the next period as the average of the last n actual demands, F(t) = (D(t-1) + D(t-2) + … + D(t-n)) / n. With a window of n = 3 on the default series, the forecast is the average of the last three values, 34, 33, and 37, which is 34.67. As each new period arrives the window slides forward, the oldest value drops off, and the average moves with it, which is where the name comes from. Every period in the window counts equally, which makes the forecast smooth but slow to turn. The tool builds a forecast for each period that has enough history behind it, so it can compare the forecast against actual demand and compute the error metrics.
What is a weighted moving average and when is it better?
A weighted moving average keeps the same idea as a simple one but lets recent periods count more. The forecast is F(t) = w1*D(t-1) + w2*D(t-2) + … + wn*D(t-n), with the weights normalized to sum to 1 and the largest usually on the most recent period. Weights of 0.5, 0.3, 0.2 mean the last period is half the forecast, the one before a third, and the one before that a fifth. Because the newest demand dominates, the forecast turns toward a change faster than an equal-weight average of the same length. It is better when the recent past is the better guide, such as on a trend. On the default rising series the weighted forecast is 35.20 with RMSE 3.09, which beats the equal-weight three-period RMSE of 3.35.
What window size should I use?
It depends on your demand, which is why the tool sweeps every window and names the one with the lowest RMSE instead of leaving you on the usual default of three. A short window reacts fast, so it tracks a trend or a level shift but chases noise. A long window is steady, so it smooths noise but lags any real change. On the default rising series the sweep recommends n = 2, because the shortest window lags the trend least. On the stable series in the fourth worked example the same sweep recommends n = 8, because there a longer window smooths the noise best. Same tool, opposite advice, both driven by the data. Take the recommended window as a starting point and adjust only if you know something the RMSE cannot see, such as a structural break in the history.
What do MAD, RMSE, and MAPE mean?
They are three ways to measure the average miss over the periods where a forecast existed, using the error e = actual – forecast. MAD, the mean absolute deviation, is the average size of the miss in the units of demand, so a MAD of 2.85 means the forecast was off by about 2.85 units per period. RMSE, the root mean square error, also reads in demand units but squares the errors before averaging, so it punishes big misses harder, which is why the window sweep optimizes it. MAPE, the mean absolute percentage error, expresses the miss as a percentage of actual demand, so a MAPE of 9.3% means the forecast was off by about nine percent per period, and it lets you compare across items of different size. MAPE skips periods where actual demand is zero and inflates when demand is small.
What is forecast bias and why does the sign matter?
Bias is the plain sum of the errors, not the absolute errors, so positive and negative misses can cancel. Its sign carries a direction that MAD and RMSE hide. A bias near zero means the forecast was about as often high as low, which is what you want. A large positive bias, like the +25.7 on the default series, means the forecast sat below actual demand almost every period, the fingerprint of a moving average lagging a rising trend. A large negative bias means the forecast ran high, which you see when a moving average lags a falling trend. Reading the bias tells you not just how big the misses were but which way they leaned, and a bias that keeps growing period after period is the clearest sign the method or the window no longer fits.
Why does a moving average lag a trend?
Because it forecasts the next period from periods that already happened, all of which are older than the period you are forecasting. When demand is flat that does not matter, since old and new periods sit at the same level. When demand is rising, every period in the window is lower than the period you are trying to forecast, so the average comes out low and the forecast falls short. The steeper the trend and the longer the window, the further behind it falls. On the default series demand climbs from 20 to 37, and the three-period forecast trails it the whole way, which is why the errors are almost all positive and the bias piles up to +25.7. Shortening the window reduces the lag but cannot remove it while you are still averaging past periods.
What is the window sweep and how does it choose n?
The window sweep computes the RMSE for every window from n = 2 upward and reports the window with the lowest RMSE for your series. RMSE is the natural target because squaring the errors makes it sensitive to large occasional misses, which are the kind you most want a forecast to avoid. On the default rising series the sweep lands on n = 2, since the shortest window lags the trend least, and it also shows RMSE 3.35 at n = 3 and 3.62 at n = 4 for comparison. On the stable series the sweep recommends n = 8, because there a longer window smooths the noise best. The sweep saves you from defaulting to three periods by habit and picks the window from the data instead, though you can still override it when you have a reason.
Should I forecast demand or sales?
Demand, whenever the two differ. Sales are capped by what you had in stock, so a period that sold out understates the demand that was really there, and averaging a censored low period drags the forecast down and shows up as a bias. If you know a period was stocked out, estimate the true demand for that period rather than averaging the truncated sales figure. This is one of the quiet ways a forecast goes wrong: the arithmetic is right but the input is a lower bound on what customers actually wanted. Feed the method true demand, cleaned of stockout censoring and one-off anomalies like promotions or data errors, and the forecast describes the pattern you actually care about.
When should I not use a moving average?
In two situations. The first is a strong trend, where the forecast lags and the bias grows. You can shorten the window to reduce the lag, but past some point a trend-aware method like exponential smoothing with a trend term or a linear regression on time will do better, and a bias that stays large after shortening is the signal to switch. The second is intermittent or lumpy demand, mostly zeros with occasional spikes, where averaging gives a small fractional forecast that matches nothing and the MAPE explodes. The fifth worked example shows a lumpy series with a MAPE near 45%, which really just says the method does not apply. Classify the item with an XYZ analysis first, keep the moving average for smooth stable items, and route trending and lumpy items to methods built for them.
How much demand history do I need?
You need at least your window plus a handful of extra periods, so the error metrics have several forecasts to grade. A MAD or RMSE computed on only one or two periods is not worth much, because a single lucky or unlucky period swings it. The default series has twelve periods and grades the n = 3 forecast on nine of them, which is enough to read the fit with some confidence. List the periods oldest first so the most recent is at the bottom, keep them evenly spaced at one per week or one per month without mixing the two, and enter one value per period separated by a new line, a space, or a comma. More clean, evenly spaced history gives the sweep more to work with and the metrics more forecasts to average over.
How do I prepare a clean demand series?
Enter true demand rather than censored sales, list the periods oldest first so the latest is at the bottom, and keep the spacing even, one per week or one per month, since a moving average assumes each step is the same length of time. Handle gaps honestly by deciding whether a zero or an estimate is the right value for a missing period, because a stray zero drags the average down. Watch for anomalies that are real but not part of the pattern, such as a one-off promotion, a price change, or a data-entry error, and clean them before forecasting, because the method cannot tell an outlier from a genuine jump and will smear it across several future forecasts. The tool accepts values separated by a new line, a space, or a comma, so you can paste a spreadsheet column straight in.
Is the tool free, and does it work in my browser?
Yes to both. The moving average calculator is free with no sign-up, and every calculation runs in your browser, so the demand values you enter are never sent to a server, stored, or shared. You can download a PDF of the result, export a CSV, or share a summary on WhatsApp. It handles the simple and weighted moving average, computes MAD, RMSE, MAPE, and the bias on the in-sample periods, sweeps the window for the best RMSE, and draws the actual demand against the forecast with a marker for the next period. It is a planning and analysis tool, so treat the forecast as a well-grounded estimate and read the error metrics and the bias to judge how much to trust it for your own series before you commit it to a plan.
More forecasting and analytics calculators
This is the flagship of the Forecasting and Analytics silo. The sibling tools below are on the way and are not yet live, so they are listed here for reference rather than linked.
The forecasting tools work as a set. When the bias on a moving average tells you demand is trending, Exponential Smoothing carries a trend term the average cannot. When you want to grade a forecast from any method over time, Forecast Error Metrics takes the same MAD, RMSE, and MAPE further with a tracking signal. Before you forecast at all, an XYZ Demand Classification separates the smooth items this tool handles well from the erratic and lumpy ones it does not. The Forecasting and Analytics hub gathers the forecasting tools as they go live, and the Supply Chain hub carries the tools that turn a demand forecast into an inventory and replenishment plan.
Sources, disclaimer, and editorial transparency
The relationships used here are standard forecasting practice. A simple moving average forecasts the next period as F(t) = (D(t-1) + D(t-2) + … + D(t-n)) / n, and a weighted moving average as F(t) = w1*D(t-1) + w2*D(t-2) + … + wn*D(t-n) with the weights normalized to sum to 1. The error metrics come from the in-sample error e = actual – forecast: MAD is the mean of the absolute errors, MSE is the mean of the squared errors, RMSE is the square root of MSE, MAPE is the mean of the absolute percentage errors and skips periods where actual demand is zero, and bias is the sum of the errors, whose sign gives the direction of the miss. The window sweep computes the RMSE for every window from n = 2 upward and reports the window with the lowest RMSE. The worked example numbers are computed from the series shown: the default rising series gives a next-period forecast of 34.67 at n = 3 with MAD 2.85, RMSE 3.35, MAPE 9.3%, and bias +25.7, the sweep prefers n = 2 at RMSE 2.40, the weighted 0.5, 0.3, 0.2 forecast is 35.20 at RMSE 3.09, the stable series gives 49.33 at n = 3 with the sweep preferring n = 8, and the intermittent series gives 1.33 with a MAPE of 45.5%. This calculator and guide are built and reviewed by the OpsCalculators team; see our Editorial Policy for how each tool is researched, built, and tested.
Results are accurate for the formulas and the series above, and they are a planning and analysis estimate, not a guarantee of future demand. A moving average describes the recent past, so it lags a trend and does not fit intermittent or lumpy demand, and the error metrics grade only the in-sample fit, not how the forecast will perform on demand it has not seen. Read the bias and the error metrics to judge whether the method suits your series, classify erratic items before forecasting them, and move trending demand to a trend-aware method when the bias keeps growing. See our full Disclaimer. OpsCalculators.com is operated by MAFHH INTERNATIONAL LTD. Your inputs are processed in your browser and are never stored; see our Privacy Policy.