Exponential Moving Average Calculator
Solve the recursive EMA relation EMAtoday = Price × k + EMAprev × (1 − k) with k = 2 / (N + 1) for any of its four unknowns — today's EMA, the current price, the prior EMA, or the smoothing factor itself — with step-by-step math, a live weighting schematic, and a price-series parser that computes the full EMA series from pasted data.
Paste a series of closing prices (comma, space or newline separated). The parser seeds the EMA with a simple average of the first N prices and computes the full EMA series using the recursive formula.
Every past price is still inside the EMA
Unlike a simple moving average, which forgets a price the instant it falls out of the window, the EMA carries the influence of every historical price forward forever — but with geometrically decaying weight. The price from 100 bars ago still contributes a tiny amount, on the order of (1 − k)^100, to today's value. For a period of 26 this is about 0.0005% — negligible but not zero. This infinite memory is why the EMA is smoother than the SMA of the same nominal period and why it responds more gracefully to new information.
The "period" is a decay parameter, not a window
When a chart says "EMA 26," the 26 is not the number of bars used in the average — it is the input to the smoothing formula k = 2 / (N + 1), which yields k ≈ 0.0741. The EMA always uses the entire price history, but the weight on any given bar decays exponentially. The "memory horizon" of an EMA N (where the weight on a bar falls below ~1%) is approximately 4.6 × N / 2 ≈ 2.3 × N bars. So an EMA 26 has meaningful memory of roughly 60 bars back; an EMA 200 reaches almost 460 bars back. This is what makes longer-period EMAs feel like slow, structural trend lines.
The EMA responds faster than the SMA
Because more weight sits on the most recent bars, the EMA turns more quickly when the trend changes. On a V-shaped reversal, the SMA 20 will keep falling for several bars after the price has bottomed, while the EMA 20 will already be curving upward. This responsiveness is why shorter-term traders prefer EMAs (especially the EMA 9 and EMA 12) and why MACD — which is entirely built on EMAs — is one of the most followed momentum indicators. The cost of this responsiveness is more frequent false signals in choppy markets.
Bootstrapping matters for the first ~100 bars
The EMA recursion needs a starting value, called the seed. Most platforms seed with a simple average of the first N prices, then apply the recursive formula from bar N+1 onward. Because the seed's influence decays as (1 − k)^n, it becomes negligible after roughly 3–5 × N bars. For an EMA 200 this means the first 600–1,000 bars are "warming up" — the EMA values in that range depend heavily on the seed choice and are not directly comparable between platforms. If you are computing an EMA yourself and want stable values, discard the first ~5 × N bars of output.
How to Use This Calculator
The EMA relation links four quantities: today's EMA, the current price, the prior EMA and the smoothing factor. Pick which one you want the tool to solve, then fill in the other three.
1. Start with a scenario
Click a scenario chip like "EMA 26" or "EMA 200" to load typical values. Each chip carries the period, the current price and the prior EMA so you can see the implied result immediately.
2. Choose what to solve for
Pick EMAt, P, EMAt−1 or N from the toggle. Solving for EMAt is the normal mode; solving for P tells you what price would deliver a target EMA; solving for EMAt−1 reverses the recursion to reveal the prior bar; solving for N tells you what period a given k corresponds to.
3. Read the result and verdict
The result card shows the EMA value plus the price, prior EMA and k. A colour-coded verdict classifies the position of price relative to the EMA — bullish above, bearish below, or at-EMA for the crossing zone.
4. Check the schematic and chart
The schematic draws the weight split between the price contribution and the prior-EMA contribution, then shows each contribution as its own bar, with the sum in the middle. The chart plots today's EMA against current price for three prior-EMA levels.
5. Parse a real price series
Paste a series of closing prices into the parser in Advanced mode. The tool seeds the EMA with a simple average of the first N prices, then computes the full recursive series. The last 30 bars are displayed in a table so you can see how the EMA evolves bar-by-bar.
6. Switch to Advanced for depth
Advanced mode adds a smoothing-weight chart showing k and (1−k) as functions of period, inputs for three comparison periods, a sensitivity check, and companion metrics including memory horizon, price-vs-EMA percentage, and side-by-side EMA values for the three comparison periods.
What This Tool Offers
Built around the recursive EMA relation EMAt = P × k + EMAt−1 × (1 − k), the standard formula for exponential smoothing that underlies most modern technical indicators.
Four-way solving
Solve for today's EMA, the current price, the prior EMA or the period/smoothing factor. The calculator rearranges the formula for whichever variable you choose.
Weight-split schematic
A live diagram draws the k vs (1−k) weight split as a bar, then shows each contribution to today's EMA separately, making the recursive structure visually intuitive.
Price vs. EMA verdict
Each result is classified from strong bearish through at-EMA to strong bullish based on the price's percentage distance from the EMA, with a colour badge that updates as you adjust.
Price-series parser
Paste a series of closing prices and the calculator seeds the EMA with a simple average of the first N prices, computes the full recursive series, and shows the last 30 bars in a table.
Multi-period comparison
Advanced mode lets you set three comparison periods and shows the implied EMA for each against the current price, so you can see short-, medium- and long-term trend simultaneously.
Reference tables
Common EMA periods and their uses, smoothing factors and memory horizons, typical EMA distances by asset class, and a full variable reference.
Reference Tables & Conversions
Common EMA periods, smoothing factors and memory horizons, plus typical EMA distance distributions.
Quick EMA estimator
Common EMA Periods and Their Uses
The period is a decay parameter, not a window length. The "memory horizon" column shows approximately how many bars back the EMA still carries meaningful weight (where the weight has fallen below 1%).
| Period | k = 2/(N+1) | Memory horizon | Typical use | Character |
|---|---|---|---|---|
| 5 | 0.3333 | ~12 bars | Very short-term intraday | Nearly tracks price; extremely reactive |
| 9 | 0.2000 | ~21 bars | Short-term signals, MACD signal line | Fast, prone to whipsaw in chop |
| 12 | 0.1538 | ~28 bars | MACD fast line | The "fast" EMA in the classic MACD pair |
| 20 | 0.0952 | ~46 bars | Short swing reference; Bollinger centerline variant | Popular middle-speed reference |
| 21 | 0.0909 | ~48 bars | Swing trading (frequently used alternative to 20) | Slightly smoother than 20 |
| 26 | 0.0741 | ~60 bars | MACD slow line | The "slow" EMA in the classic MACD pair |
| 50 | 0.0392 | ~115 bars | Medium-term trend reference | Popular institutional swing line |
| 100 | 0.0198 | ~230 bars | Institutional reference | Slow but responsive to major turns |
| 200 | 0.00995 | ~460 bars | The classic long-term trend line | Watched by almost every professional |
| 500 | 0.00399 | ~1,150 bars | Multi-year macro regime | Very smooth; useful for cycle analysis |
Smoothing Factor and Weight Decay
How the weight on a historical bar decays with age, for the most common periods. The number in each cell is the weight that bar still has in today's EMA.
| Bars ago | N = 12 | N = 26 | N = 50 | N = 200 |
|---|---|---|---|---|
| 1 (prior EMA itself) | 0.9231 | 0.9259 | 0.9608 | 0.9901 |
| 5 | 0.5905 | 0.6438 | 0.8043 | 0.9507 |
| 10 | 0.3487 | 0.4146 | 0.6469 | 0.9038 |
| 20 | 0.1216 | 0.1719 | 0.4185 | 0.8169 |
| 30 | 0.0424 | 0.0713 | 0.2707 | 0.7384 |
| 50 | 0.0052 | 0.0122 | 0.1133 | 0.6032 |
| 100 | 2.7e-5 | 1.5e-4 | 0.0128 | 0.3639 |
| 200 | ~0 | ~0 | 1.6e-4 | 0.1324 |
| 460 (horizon for N=200) | ~0 | ~0 | ~0 | 0.0100 |
Typical Price Distance from EMA by Asset Class
Representative ranges for how far price tends to wander from its own EMA before mean-reverting. Not a trading signal — just a scale reference for interpreting "price is X% above/below the EMA".
| Asset class | EMA 20 distance | EMA 50 distance | EMA 200 distance | Notes |
|---|---|---|---|---|
| Stablecoins (USDC) | ±0.1% | ±0.1% | ±0.2% | Peg keeps distance tiny |
| 10Y Treasury | ±0.5% | ±1.0% | ±2.5% | Rate moves are slow and persistent |
| Major FX (EUR/USD) | ±0.7% | ±1.5% | ±4% | G10 pairs mean-revert quickly |
| S&P 500 | ±2% | ±4% | ±10% | Index level; tends to hug the 200 EMA |
| Large-cap equities | ±3% | ±6% | ±15% | Trend persistence varies widely |
| Gold | ±2% | ±4% | ±10% | Smoothest of the commodity complex |
| Bitcoin | ±5% | ±10% | ±25% | Wide swings around long EMAs during cycles |
| Ethereum | ±6% | ±12% | ±30% | Higher beta than BTC |
| Altcoins (top 50) | ±8% | ±15% | ±40% | Correlated with BTC but amplified |
| Meme coins | ±15% | ±30% | ±70% | Distance routinely exceeds all normal bands |
Variable Reference
| Symbol | Meaning | Typical range | Units |
|---|---|---|---|
| EMAt | Today's EMA value | > 0 | price |
| EMAt−1 | Prior bar's EMA (the memory input) | > 0 | price |
| P | Current price (usually the close) | > 0 | price |
| N | EMA period | 1 – 500+ | periods |
| k | Smoothing factor = 2 / (N + 1) | 0.004 – 0.667 | ratio |
| 1 − k | Memory weight on prior EMA | 0.333 – 0.996 | ratio |
| Horizon | Bars where weight falls below 1% | ~2.3 × N bars | bars |
| Dist | Price − EMA, in % of EMA | −50% – +50% | % |
What Does the Exponential Moving Average Measure?
An exponential moving average is a smoothed version of a price series where recent prices are weighted more heavily than older ones, and the weights decay exponentially into the past. The formula EMAt = P × k + EMAt−1 × (1 − k) captures this in a single line, and the smoothing factor k = 2 / (N + 1) determines how aggressively the average responds to new information. A shorter period means a larger k, a faster response, and a noisier line; a longer period means a smaller k, a slower response, and a smoother line.
The EMA is one of the two most fundamental tools in technical analysis (the other being the simple moving average). It is the building block of MACD, of most trend-following systems, of Bollinger Band variants, and of a thousand proprietary indicators. Its popularity comes from its elegance: a single recursive equation carries the memory of the entire price history, weighted by recency, with no need to store or window the underlying data.
Exponential Moving Average Formula
The defining recursive relationship is:
where the smoothing factor is:
Rearranged to solve for the other three unknowns:
EMAt−1 = ( EMAt − Pt × k ) / (1 − k)
N = 2 / k − 1
To seed the recursion, the standard approach is to use the simple moving average of the first N prices:
Exponential Moving Average Variables
| Symbol | Meaning | Notes |
|---|---|---|
| EMAt | Today's EMA value | The output of the recursion |
| EMAt−1 | Prior bar's EMA | The entire memory of the series, compressed into one number |
| Pt | Current bar's price | Usually the close; sometimes HLC/3 or the open |
| N | Period | The decay parameter, not a window length |
| k | Smoothing factor | k = 2 / (N + 1) |
| 1 − k | Weight retained from prior EMA | The decay rate of memory |
How Each Variable Affects the EMA
The EMA rises when the current price is above the prior EMA and falls when it is below. The magnitude of the move is proportional to k and to the gap between price and EMA. This linearity makes the EMA easy to reason about: the EMA always moves toward the current price by a fixed fraction k of the gap. If the price is 100 above the prior EMA and k = 0.1, the EMA rises by 10; if k = 0.05, it rises by 5. Over a series of bars, this produces the characteristic smooth curve that hugs price loosely with a lag proportional to 1/k.
In practice, the period N is the parameter that matters most, because it determines k. Shorter periods (9, 12, 20) produce EMAs that respond quickly and hug price tightly; longer periods (100, 200) produce EMAs that respond slowly and act as longer-term trend reference lines. A common professional pattern is to overlay a fast EMA (12 or 20) with a slow EMA (50 or 200) and treat crossovers as trend-change signals. The two EMAs converging and crossing is the visual signature of a trend reversal, and it is exactly what MACD formalises arithmetically.
EMA Calculation Examples
k = 2 / (26 + 1) = 0.07407
EMAt = 42,300 × 0.07407 + 42,200 × 0.92593 = 42,220.00
k = 0.07407 · P = (42,220 − 42,200 × 0.92593) / 0.07407 = 42,300.00
EMAt−1 = (42,220 − 42,300 × 0.07407) / 0.92593 = 42,200.00
N = 2 / 0.07407 − 1 = 26.0
k = 2 / 10 = 0.20
EMAt = 42,300 × 0.20 + 42,200 × 0.80 = 42,220.00
Frequently Asked Questions
The simple moving average (SMA) is the arithmetic mean of the last N prices — every bar in the window gets equal weight, and bars that fall out of the window are instantly forgotten. The exponential moving average (EMA) gives exponentially decaying weight to every historical price, so recent bars matter much more than old ones, and nothing is ever truly forgotten. The practical consequences: EMAs turn faster on reversals, produce cleaner trend lines, and lag price by less than SMAs of the same nominal period. SMAs are smoother and more resistant to single-bar spikes (like earnings gaps or flash crashes) because those bars eventually age out. Neither is "better" — they answer slightly different questions about the recent past.
Because N determines the smoothing factor k = 2 / (N + 1), which determines how fast the memory of old bars decays. A period of 9 gives k = 0.20, meaning 20% of today's price enters the EMA and the "memory" of a price from 20 bars ago has decayed to about 1.15% of its original weight. A period of 200 gives k ≈ 0.00995, meaning only about 1% of today's price enters the EMA and prices from 20 bars ago still carry about 82% of their original weight. So when someone says "EMA 200," they do not mean "the average of the last 200 bars" — they mean "an EMA whose decay parameter corresponds to a period of 200." The nominal period is a convenient label for the decay rate, not a window length.
The EMA recursion needs an initial value for EMAt−1. There are two common conventions: (1) use the first price as the seed, or (2) use the simple moving average of the first N prices. The first approach is simpler but makes the early EMA values highly dependent on the very first price, which is arbitrary. The second approach is what most charting platforms use (TradingView, most exchanges, most charting libraries) and produces stable values after a warm-up period. Because the seed's influence decays as (1 − k)^n, it becomes negligible after roughly 3–5 × N bars. So for an EMA 200, the first ~600–1,000 bars are "warm-up"; the seed matters only for the early part of the chart. This calculator uses the SMA seed, matching the standard convention.
The memory horizon is the number of bars back at which the EMA's weight on a historical price has decayed below some threshold (typically 1%). Because the weight decays as (1 − k)^n, the horizon is n where (1 − k)^n = 0.01, i.e. n = ln(0.01) / ln(1 − k). For small k this simplifies to approximately 4.6 / k = 4.6 × (N + 1) / 2 ≈ 2.3 × N. So an EMA 20 has a memory horizon of about 46 bars, an EMA 50 about 115 bars, and an EMA 200 about 460 bars. This is a more intuitive way to think about what a given EMA period means in terms of "how far back in time does this line still care about" — much more useful than the nominal N value alone.
Two reasons. First, the EMA responds faster to new information, which means it turns sooner on trend changes — a real advantage for traders who want to enter early in a move. The SMA 20 lags the EMA 20 by several bars on a V-shaped reversal, and the difference is noticeable on shorter timeframes. Second, EMA crossovers tend to produce fewer whipsaws than SMA crossovers because the smoothed line curves more gracefully and does not have the SMA's characteristic "step" artifacts (where a big bar drops out of the window and the average jumps). For these reasons, MACD, most moving-average ribbons, and the majority of trend-following systems are built on EMAs. SMAs remain popular for longer-term reference levels and for chart construction where the exact mathematical properties of the SMA are useful (like in Bollinger Bands, where the SMA is the standard center line).
Yes, especially in the warm-up period. Different platforms may use different seed values (first price vs. SMA of first N vs. some other convention), different price inputs (close vs. typical vs. open), or different warm-up lengths before publishing values. In the steady state — after the seed's influence has decayed to negligible — the EMA is fully determined by the price series and k, so any correctly implemented EMA will agree to the last decimal. But in the first ~5 × N bars, small implementation differences can produce visible discrepancies. If you are matching a specific platform's EMA exactly (for backtesting or cross-checking), use their seed convention and their price input. For most practical purposes, the difference is negligible after the warm-up.
A price crossing above its EMA is a bullish signal; crossing below is bearish. The signal is stronger on longer-period EMAs (a 200 EMA cross is watched by far more market participants than a 9 EMA cross) and weaker on shorter ones (a 9 EMA gets crossed constantly, and most crosses are noise). A common practice is to combine: only take short-term EMA crosses in the direction of the long-term EMA — e.g. only take 20 EMA crosses above when price is already above the 200 EMA. This reduces false signals dramatically at the cost of missing the earliest part of trend reversals. The 200 EMA in particular is treated by many institutional traders as a line-in-the-sand between bull and bear regimes, and price crossing it is treated as a regime change rather than a normal trading signal.
Yes. The EMA is timeframe-agnostic — it operates on whatever series of prices you give it. On a 1-minute chart, an EMA 20 uses the last ~46 minutes of price memory. On a daily chart, the same EMA 20 reaches back ~46 days. On a weekly chart, it reaches back ~46 weeks (nearly a year). The period N is a pure decay parameter; what changes across timeframes is the real-world span of the memory horizon. Traders use this to construct multi-timeframe systems: for example, the EMA 50 on the daily chart for regime context, the EMA 20 on the 4-hour chart for entry timing, and the EMA 9 on the 15-minute chart for precise execution. Because the same formula and the same period values are used on all timeframes, the EMA is the most portable indicator in technical analysis.
Variables
| Symbol | Quantity | Unit |
|---|---|---|
| EMA_today | Today's EMA value | currency |
| Price_today | Today's closing price | currency |
| k | Smoothing factor | |
| n | Number of periods |
What it means
The Exponential Moving Average (EMA) is a moving average that gives more weight to recent prices, making it more responsive to new information. The smoothing factor k determines the weight. EMAs are used to identify trends earlier than SMAs. They are used in many indicators (MACD, RSI). Understanding the EMA is essential for technical traders looking for timely signals and for reacting to price changes quickly.
Worked example
Exponential Moving Average – Two Detailed Examples
Real‑World| Parameter | Value |
|---|---|
| n (period) | 12 |
| k = 2/(n+1) | 0.1538 |
| Price today | 61,200 |
| EMA yesterday | 61,000 |
| Parameter | Value |
|---|---|
| n | 26 |
| k | 0.0741 |
| Price | 3,020 |
| EMA_yest | 3,050 |
Common mistakes
- EMA: Exponential Moving Average – gives more weight to recent prices.
- k = 2/(n+1): The smoothing factor.
- EMA today: Depends on the previous EMA – needs an initial value.
- Lag: EMA reacts faster than SMA.
Applications
Exponential Moving Average (EMA) gives more weight to recent prices, making it more responsive to new information than the SMA. Traders use EMAs to identify trend changes earlier and to generate faster signals. The smoothing factor k determines the sensitivity. EMAs are commonly used in crossover strategies and in combination with other indicators. Understanding EMA helps traders stay ahead of market moves. It is a staple of technical analysis.
- Identifying trend reversals more quickly than SMA
- Generating buy/sell signals via EMA crossovers
- Dynamic support/resistance levels
- Components of MACD and other indicators
- Short‑term trading and scalping strategies
Related calculators · Technical & Market Analysis
Recently updated formulas
Suggest an improvement
Found a mistake? Have a better example? Let us know.
You may send up to 3 suggestions per 24 hours.