How to use the Moving Average Calculator
- 1. Paste your valuesEnter numbers oldest first, separated by commas, spaces or lines.
- 2. Set the windowChoose how many periods each average covers and the type.
- 3. Read the trendSee the averages in a table and a chart, then download CSV.
Formulas for each moving average
- Simple (SMA): the plain average of the last n values. SMA = (x₁ + x₂ + … + xₙ) ÷ n.
- Weighted (WMA): newer values count more. With n = 3 the weights are 1, 2 and 3, so WMA = (1·x₁ + 2·x₂ + 3·x₃) ÷ 6.
- Exponential (EMA): starts from the SMA of the first n values, then each step is EMA = α·x + (1 − α)·previous EMA, where α = 2 ÷ (n + 1).
Worked example: for 10, 12, 14, 13, 15, 17, 16 with a 3-period simple average, the first average is (10 + 12 + 14) ÷ 3 = 12. Sliding forward one value at a time gives SMA(3): 12, 13, 14, 15, 16. The first two periods have no average because there are not yet three values.
Choosing the window and type
A short window follows the data closely but stays noisy. A long window is smooth but reacts late. Common choices are 7 days for daily web traffic, 3 or 12 months for sales, and 20, 50 or 200 days for stock prices.
Use SMA when you want an easy-to-explain trend line for a report. Use EMA or WMA when recent changes matter more, such as spotting a sales dip early. In Excel, an SMA is =AVERAGE(B2:B4) dragged down; in pandas it is df['x'].rolling(3).mean().
Moving averages describe the past. They are not a forecast, and they always lag turning points. Running window sums in SQL? See the window functions playground.
Frequently asked questions
Why is the first value blank?
A moving average needs a full window. With a window of 3, the first two periods do not have three values yet.
Does EMA match trading platforms?
It uses the common method of seeding with the first SMA. Some platforms seed differently, so the first few values may differ slightly before they converge.
Is the Moving Average Calculator free?
Yes, the Moving Average Calculator is free. The first time you see your first moving average, you are asked for your name and WhatsApp number once. After that, this and every other Uncodemy tool opens straight away without the form.