Historical volatility is calculated by taking the standard deviation of an asset’s logarithmic returns over a chosen period, then multiplying that figure by the square root of the number of periods in a year. For daily equity data, that multiplier is √252, or roughly 15.87. The whole procedure breaks into four steps: gather closing prices, convert them to log returns, compute the standard deviation of those returns, and annualize the result.
Step 1: Gather Adjusted Closing Prices
Start with a chronological series of adjusted closing prices, oldest to newest. “Adjusted” means the figures already account for stock splits, dividends, and other corporate actions that would otherwise create false jumps in the series. Yahoo Finance, Bloomberg, and similar platforms supply these adjusted prices directly. If you use raw unadjusted data, a 2-for-1 split will look like a 50% crash and your volatility number will be garbage.
How many prices should you pull? That’s your lookback window, usually written as “n.” Common choices are 20 trading days (about a month), 30, 60, or 90 days. Short windows react quickly to recent shocks but produce noisy estimates. Long windows smooth the number out but can hide a genuine shift in the asset’s behavior. A 20-to-30-day window suits near-term risk work; 90 days or more gives you a better read on the asset’s baseline character. There is no single correct window — it depends on what the number is for.
Check for gaps. A missing day stretches one return across two days of actual price movement and distorts the result. Commercial feeds usually handle holidays and halts cleanly, but manually pulled data needs a quick scan for skipped dates.
Step 2: Convert Prices to Logarithmic Returns
For each consecutive pair of closing prices, divide today’s price by yesterday’s and take the natural logarithm of the ratio:
return = ln(Pt / Pt−1)
If the stock closed at $180.50 yesterday and $182.75 today, the log return is ln(182.75 / 180.50) = 0.0124, or about 1.24%.
Why log returns rather than simple percentage changes? Two reasons. Log returns are additive across time, so the five-day log return equals the sum of the five daily log returns, which is what makes the annualization step work cleanly. And sums of normally distributed log returns remain normally distributed, a property simple percentage returns don’t share. The statistical machinery underneath volatility analysis assumes normality, so log returns fit the framework better.
Because each return needs two prices, your return series is always one shorter than your price series. Thirty-one closing prices give you thirty log returns.
Step 3: Take the Standard Deviation of the Returns
Average your log returns. That arithmetic mean is the asset’s typical daily move over the window. Then subtract the mean from each individual return to get the deviations, which will be a mix of positive and negative numbers.
Square each deviation. Squaring strips off the sign so pluses and minuses don’t cancel, and it penalizes large outliers more heavily than small ones. Sum all the squared deviations, then divide by n − 1, where n is the number of returns. Dividing by n − 1 rather than n is Bessel’s correction: because you estimated the mean from the same data, plain n would systematically understate the true variance, and subtracting one degree of freedom offsets that bias. The result is the variance.
Take the square root of the variance. You now have the standard deviation of daily log returns, which is your periodic (not yet annualized) historical volatility. One number, describing how widely daily returns scatter around their average.
Step 4: Annualize the Standard Deviation
A daily standard deviation isn’t directly comparable to the volatility figures quoted in options markets, fund documents, or research reports, which are almost always annualized. To convert, multiply the daily standard deviation by the square root of the number of trading days in a year. U.S. equity markets average about 252 trading days, so the multiplier is √252 ≈ 15.87.
The square root (rather than a straight multiplication by 252) comes from how variance scales with time. If daily returns are independent, variance over 252 days equals 252 times the daily variance. Standard deviation is the square root of variance, so annualized standard deviation equals daily standard deviation times √252. The same logic applies to any starting period: for weekly returns, multiply by √52; for monthly returns, by √12.
Markets with different session structures use different multipliers. Cryptocurrency trades every day of the year, so the convention is √365. Foreign exchange runs around the clock across roughly 252 weekdays; some practitioners stick with √252, others adjust for the continuous session. Pick a convention and apply it consistently when comparing assets.
A Worked Example
Say you have six consecutive adjusted closing prices for a stock: $100.00, $102.00, $101.50, $103.00, $102.50, and $104.00.
First, the five log returns:
- ln(102.00 / 100.00) = 0.01980
- ln(101.50 / 102.00) = −0.00492
- ln(103.00 / 101.50) = 0.01469
- ln(102.50 / 103.00) = −0.00487
- ln(104.00 / 102.50) = 0.01456
The mean of those returns is (0.01980 − 0.00492 + 0.01469 − 0.00487 + 0.01456) / 5 = 0.00785.
Subtract the mean from each return, square the result, and sum: the squared deviations total roughly 0.000572. Divide by n − 1 = 4 to get the variance, 0.000143. Square-root that to get the daily standard deviation, about 0.01196, or roughly 1.2% per day.
To annualize: 0.01196 × √252 ≈ 0.01196 × 15.87 ≈ 0.1898, or about 19.0%. That’s the annualized historical volatility of the stock over this five-day window. A real calculation would use a much longer lookback, but the mechanics are identical.
Reading the Annualized Number
A 20% annualized historical volatility describes a range. Under a normal distribution, about 68% of the time the annual return would fall within one standard deviation of its mean. For a $100 stock at 20% volatility, that’s roughly 68% odds of landing between $80 and $120 over the year, ignoring any mean drift. About 95% of outcomes would stay within two standard deviations ($60 to $140) and 99.7% within three ($40 to $160).
These ranges are useful for sanity-checking whether a position fits your risk tolerance. A 40% volatility figure produces a one-standard-deviation range twice as wide as a 20% figure. The number says nothing about direction, only about the size of the swings.
Where This Model Falls Short
Knowing where historical volatility breaks down matters more than knowing the formula.
The biggest problem is the normality assumption. Log returns come closer to a normal distribution than simple returns, but real market returns have “fat tails”: extreme moves happen more often than a bell curve predicts. The 2008 financial crisis included multiple daily moves that a normal distribution would treat as near-impossible. If you lean on a historical volatility figure to picture your worst case, you will underestimate the probability of a catastrophic loss.
Historical volatility is also direction-blind. A stock with 15% annualized volatility could be steadily rising, steadily falling, or chopping sideways. The number captures the magnitude of fluctuations, not whether those fluctuations made money. Low volatility doesn’t mean safe. A stock in a strong uptrend with wide but mostly positive swings will still register high volatility.
And past volatility is not a forecast. Markets can go from calm to chaotic in a single session. A stock showing 12% annualized volatility over the last 60 days can easily deliver 40% volatility over the next 60. The lookback window describes a period that has already ended. Treating that number as a prediction of what comes next is the single most common mistake people make with the metric.