Moving Average Calculator
Calculate Simple Moving Average (SMA), Exponential Moving Average (EMA), Cumulative Moving Average (CMA), and Weighted Moving Average from a series of data points.
About this calculator
This calculator computes four different rolling statistics from up to ten sequential Period values: Simple Moving Average (lines 14-25, the unweighted mean of the last Window Size periods), Exponential Moving Average (lines 27-36, a recursive formula that seeds from Period 1 and then blends each subsequent period in at multiplier = EMA Smoothing Factor / (Window Size + 1)), Cumulative Moving Average (lines 44-49, the running mean of every period entered so far, independent of Window Size), and Weighted Moving Average (lines 52-61, a linearly-weighted mean over the last Window Size periods that gives the most recent period the largest weight). At the defaults, EMA Smoothing Factor is completely inert for Simple, Cumulative, and Weighted Moving Average — none of their formulas reference it, since it only appears in the EMA multiplier (line 28). Window Size is likewise inert for Cumulative Moving Average, which always averages the full period history regardless of how the window is set (lines 44-49 never read windowSize).
Period 10, the most recent data point, dominates Exponential Moving Average's sensitivity — not because it happens to be a large number, but because EMA's recursive blending (line 33) structurally weights the most recent input the heaviest, a genuine recency-weighting mechanism unlike Simple Moving Average's flat window average, where the "dominant" input is only dominant because its default magnitude (26) happens to exceed its window-mates' (19 and 24). This calculator does not detect trend breaks, seasonality, or outliers — it only smooths, so a sudden one-period spike still fully enters every average that includes it.
Inputs
Results
Simple Moving Average (SMA)
23
Exponential Moving Average (EMA)
23.87
How to Use This Calculator
- Enter the time series data points and the desired window size.
- Select moving average type: simple (SMA), exponential (EMA), or weighted (WMA).
- Review the smoothed series values and lag introduced by the window.
- Use shorter windows to detect trends sooner; use longer windows for noise reduction.
- Compare SMA vs. EMA to determine which better tracks your data underlying trend.
How the result changes with Period 10
| Period 10 | Simple Moving Average (SMA) | Exponential Moving Average (EMA) |
|---|---|---|
| 13 | 18.67 | 17.37 |
| 20 | 21 | 20.87 |
| 39 | 27.33 | 30.37 |
| 65 | 36 | 43.37 |
What each input means
- Period 1
- Value for the first time period in your data series.
- Period 2
- Value for the second time period.
- Period 3
- Value for the third time period.
- Period 4
- Value for the fourth time period.
- Period 5
- Value for the fifth time period.
- Period 6
- Value for the sixth time period.
- Period 7
- Value for the seventh time period.
- Period 8
- Value for the eighth time period.
- Period 9
- Value for the ninth time period.
- Period 10
- Value for the tenth time period.
- Window Size
- Number of periods to include in each moving average window.
- EMA Smoothing Factor
- Smoothing constant for EMA calculation. Standard value is 2. Higher = more weight on recent data.
How this is calculated
Worked example, using the default values
- Identify Input Parameters4 parametersPeriod 1 = 10, Period 2 = 12, Period 3 = 15, Period 4 = 14 = 12 input(s) provided
- Calculate Simple Moving AverageSimple Moving Average23 = 23
- Calculate Exponential Moving AverageExponential Moving Average23.8672 = 23.8672
- Calculate Cumulative Moving AverageCumulative Moving Average18 = 18
- Calculate Weighted Moving AverageWeighted Moving Average24.1667 = 24.1667
Engine last updated . Checked against 1 independently-derived test — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.
Frequently Asked Questions
Does the EMA Smoothing Factor affect the Simple Moving Average?
No. Simple Moving Average is a plain arithmetic mean of the last Window Size periods (lines 14-25); EMA Smoothing Factor only appears in the Exponential Moving Average's multiplier calculation (line 28) and never enters the SMA loop, so changing it leaves Simple, Cumulative, and Weighted Moving Average completely unchanged.
Why doesn't Window Size change the Cumulative Moving Average?
Cumulative Moving Average always averages every period entered so far, from Period 1 through the last period supplied (lines 44-49) — the loop that builds it never reads Window Size at all, unlike Simple and Weighted Moving Average, which only look at the most recent Window Size periods.
Why does Period 10 move the Exponential Moving Average more than the Simple Moving Average?
Because the two formulas weight it differently. Simple Moving Average treats every period inside the window equally (line 23 divides by windowSize), so Period 10's outsized influence there comes only from its default value (26) being larger than the other two periods in the window. Exponential Moving Average, by contrast, structurally weights the newest data point the heaviest through its recursive blending step (line 33), so Period 10 would dominate EMA even if all ten periods shared the same default value.
Does the Weighted Moving Average always favor the most recent period?
Yes — Weighted Moving Average assigns linearly increasing weights within the window, so the most recent included period always carries the largest weight (weight = i − startIdx + 1, line 57), meaning raising the most recent period's value always raises the Weighted Moving Average, regardless of what the other periods in the window are set to.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Time Series Decomposition Calculator
Decompose monthly time series data into trend, seasonal, and residual components using additive or multiplicative decomposition methods.
Data ScienceCohort Analysis Calculator
Analyze user cohort retention over time. Calculate monthly retention rates, churn rates, estimated customer lifetime value (LTV), and total cohort revenue.
Data ScienceSMA & EMA
5-point simple and exponential moving average for a mini price series.
Supply ChainDemand Forecast Calculator
Forecast demand using moving average, weighted MA, and exponential smoothing.
More in Math & Statistics.