Standard deviation & historical volatility calculator
Paste a series of closing prices and get the daily standard deviation of returns and the annualised historical volatility.
Quick answer: The standard deviation calculator takes a series of closing prices, converts them to daily log returns, computes the sample standard deviation of those returns, and annualises it by multiplying by the square root of 252 — which is exactly how historical volatility is defined.
Standard Deviation Calculator
Paste prices separated by commas, spaces or newlines. At least 3 prices are needed; 20 or more make the estimate meaningful.
Figures are per unit of the underlying and exclude brokerage, STT, exchange charges, stamp duty and GST.
How this calculator works
Why log returns and not simple returns
Log returns add across time: the log return over two days is the sum of the two daily log returns, which is exactly the property that makes the square-root-of-time rule work. Simple percentage returns do not add, they compound, and a volatility computed from them is subtly wrong in a way that grows with the size of the moves. For daily equity data the two agree to within a rounding error; for volatile assets they do not.
The n−1 denominator
This calculator uses the sample standard deviation, dividing by n−1 rather than n. That is what a spreadsheet's STDEV() gives, which is what most readers will check it against. Some finance texts prefer a zero-mean estimator, dividing by n and not subtracting the sample mean, on the grounds that over any window short enough to be useful the drift estimate is pure noise. The two differ by well under one percent for a twenty-day window.
The window is the question, not a detail
Run this on the last 10 days, the last 20 and the last 60 of the same series and you will get three different answers. All three are correct. A shock stays inside a 20-day window for exactly twenty more days, holding the reading up long after the market has calmed, and the subsequent 'decline in volatility' is the shock leaving the window rather than anything the market did.
What it cannot see
A close-to-close estimator is blind to everything that happened between the closes. A day that opened 2% down, recovered, and closed flat contributes nothing. The Parkinson high-low estimator sees that day; a five-minute realised-variance estimator sees far more of it, at the cost of picking up bid-ask bounce and other microstructure noise. Every estimator is a choice about what to ignore.
Historical volatility, annualised
σ_annual = √( Σ(r_i − r̄)² ÷ (n − 1) ) × √252
The inner quantity is the sample standard deviation of daily log returns. Multiplying by √252 rescales a one-day standard deviation to a one-year one, under the assumption that returns are independent across days.
- σ_annualAnnualised historical volatility, quoted as a percentage.
- r_iThe i-th daily log return, ln(P_i ÷ P_{i−1}).
- r̄The arithmetic mean of the log returns in the window.
- nThe number of returns — one fewer than the number of prices.
- 252Trading days in a year. A closed market does not move, so calendar days would understate volatility by about 20%.
Using it, step by step
- Paste closing prices in chronological order, oldest first. Commas, spaces and newlines all work.
- Leave 'periods per year' at 252 for daily data. Use 52 for weekly closes, 12 for monthly.
- Read the daily standard deviation — that is the typical size of a one-day log return.
- Read the annualised volatility. This is the number directly comparable to an implied volatility quoted on the option chain.
- Now vary the number of prices you paste. Watching the answer move is the fastest way to understand that the window is the question.
Worked example
NIFTY
Twenty NIFTY closes oscillating around 24,000 produce daily log returns with a sample standard deviation of roughly 0.55%. Annualised, that is 0.55% × √252 ≈ 8.7%. Set that against a 30-day at-the-money implied volatility of, say, 13%: the option market is charging about 4.3 volatility points more than this window realised. That gap is the volatility risk premium, and it is the right comparison only if the windows match — comparing this 20-day realised figure against a 30-day implied one compares two different periods and blames the difference on the option market.
Assumptions and limitations
- Returns are assumed independent across days. They are not: volatility clusters, so a shock raises tomorrow's expected volatility. Independence is what licenses the √252 scaling, and its failure is why the scaling breaks in trending and mean-reverting markets.
- Log returns are used, and the sample (n−1) standard deviation. A zero-mean estimator, common on trading desks, gives a slightly different number.
- 252 trading days is a convention. NSE trades roughly 250 days a year depending on holidays; the difference is under half a percent on the volatility.
- Close-to-close data ignores intraday movement entirely, including overnight gaps blended into a single figure.
- An estimate from twenty observations has a large standard error. Two people using different but reasonable windows on the same series will disagree, and neither will be wrong.
Common mistakes
- Pasting prices newest-first. The log returns invert sign, which does not change the standard deviation — so the answer looks fine and the mean return is backwards.
- Annualising with √365 instead of √252 and overstating volatility by about 20%.
- Comparing the output against an implied volatility from a different tenor and concluding that options are cheap or expensive.
- Reading a rise in the 20-day figure as a rise in volatility, when it is one large day entering the window, and a subsequent fall as calm, when it is that day leaving.
- Using too few observations. Five prices give four returns and a standard error so large the answer is nearly meaningless.
Frequently asked questions
How do I calculate historical volatility?
Why multiply by the square root of 252?
Why 252 and not 365?
Should I use log returns or percentage returns?
Why divide by n−1 and not n?
What window length should I use?
Can I use this for weekly or monthly data?
Why does my answer differ from my broker's?
Voice search & related questions
How do you calculate volatility from prices?
What is the standard deviation of NIFTY returns?
Is standard deviation the same as volatility?
Last reviewed 10 July 2026. Educational content only — not investment advice.