Exponential Moving Average Calculator

Paste your values and a period to compute the exponential moving average.

How it is calculated

Paste your values oldest first, separated by commas, spaces or semicolons, and give the period n. The smoothing factor is k = 2 ÷ (n + 1). The tool starts the EMA from the simple average of the first n values, then for every later value x applies EMA = k × x + (1 − k) × EMAprevious, and shows the final EMA and k to four decimals, plus the number of values read. With fewer values than the period, the seed is the average of all of them and no further steps are taken. The period must be at least 1 and is rounded to a whole number. A comma inside a number is read as a decimal comma only when the list is separated by spaces or semicolons (22,5 24,5 23); in a comma-separated list every comma is a separator. Any non-numeric entry makes the whole result disappear.

Worked example

Closing prices are 22, 24, 23, 25, 27, 26, 28, 30 and the period is 3, so k = 2 ÷ 4 = 0.5. Step 1: seed = (22 + 24 + 23) ÷ 3 = 23. Step 2: 25 gives 0.5 × 25 + 0.5 × 23 = 24, then 27 gives 25.5, 26 gives 25.75, 28 gives 26.875. Step 3: the last value 30 gives 0.5 × 30 + 0.5 × 26.875 = 28.4375. The tool shows an EMA of 28.4375, smoothing 0.5000 and 8 data points. The plain average of all eight values is 25.625, so the EMA sits closer to recent prices.

Try this example →

Common mistakes

  • Pasting the newest price first. The order matters: the tool treats the first value as the oldest, so a reversed list gives a different EMA.
  • Writing decimals with a comma inside a comma-separated list: 22,5, 24,5 is read as four values (22, 5, 24, 5), not two. Use a dot for decimals, or separate the values with spaces or semicolons.
  • Using too few values for the period. With only 2 values and a period of 5 the tool just returns their average (23.0000 for 22 and 24), which is not a real EMA.
  • Comparing EMAs of different periods without noting that a shorter period reacts faster, so a 3-period EMA is far closer to the last price than a 26-period one.
  • Including a text label or header in the pasted list; one non-numeric entry removes the result.

Sources

About this calculator

The exponential moving average weights recent data points more heavily than older ones using the recursive formula EMA_t = price_t × k + EMA_{t−1} × (1 − k), where the smoothing factor k = 2 ÷ (period + 1). A shorter period pushes k closer to 1, making the EMA react quickly to recent changes; a longer period smooths more and lags further behind, unlike a simple moving average that weights every point in the window equally.

Stock and crypto traders use EMAs (commonly the 12- and 26-period EMAs that feed into MACD) as core technical-analysis tools for spotting trend direction and momentum shifts, while algorithmic trading systems use the same recursive formula because it only needs the previous EMA value to update, making it cheap to compute on streaming price data.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators