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}).
  • 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

  1. Paste closing prices in chronological order, oldest first. Commas, spaces and newlines all work.
  2. Leave 'periods per year' at 252 for daily data. Use 52 for weekly closes, 12 for monthly.
  3. Read the daily standard deviation — that is the typical size of a one-day log return.
  4. Read the annualised volatility. This is the number directly comparable to an implied volatility quoted on the option chain.
  5. 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

What this calculator assumes. Every number it produces is only as good as the assumptions below, and each of them is wrong to some degree in a real market. The output is a model's opinion, not a measurement.
  • 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?
Convert closing prices to daily log returns, take the sample standard deviation of those returns, and multiply by the square root of 252. This calculator does all three steps and shows the intermediate values.
Why multiply by the square root of 252?
Because variance scales linearly with time under independent returns, so volatility — its square root — scales with the square root of time. There are about 252 trading days in a year, so a daily standard deviation is scaled to annual by √252 ≈ 15.87.
Why 252 and not 365?
A closed market does not move, so counting weekends and holidays would understate the daily volatility needed to reach a given annual figure. Note that option pricing formulas use calendar days ÷ 365 for time to expiry, because interest accrues on weekends. The inconsistency is deliberate and universal.
Should I use log returns or percentage returns?
Log returns. They add across time, which is exactly what makes the square-root-of-time rule valid. For daily equity data the two agree closely; for large moves they diverge.
Why divide by n−1 and not n?
Because the sample mean has been estimated from the same data, using up one degree of freedom. That is what a spreadsheet's STDEV() does. Some finance texts use a zero-mean estimator dividing by n; the difference is under one percent for a typical window.
What window length should I use?
There is no correct answer, which is the point. A 10-day window reacts fast and is noisy; a 60-day window is stable and slow. Compute several and look at them together — that is what a volatility cone does.
Can I use this for weekly or monthly data?
Yes. Change 'periods per year' to 52 for weekly closes or 12 for monthly. The scaling is √(periods per year) in every case.
Why does my answer differ from my broker's?
Almost always because of the window, the estimator or the annualisation factor. Ask which window they used, whether they used log or simple returns, whether they subtract the mean, and whether they annualise on 252 or 365.

Voice search & related questions

How do you calculate volatility from prices?
Take the natural log of each price divided by the previous price to get daily returns, compute the standard deviation of those returns, and multiply by the square root of 252 to annualise.
What is the standard deviation of NIFTY returns?
It depends entirely on the window. NIFTY's daily log-return standard deviation typically runs around 0.6% to 0.9%, which annualises to roughly 10% to 14%. In stress it is several times that.
Is standard deviation the same as volatility?
In finance, volatility IS the standard deviation of returns, annualised. The word volatility carries the extra convention that it refers to returns rather than prices, and that it is scaled to a one-year horizon.

Last reviewed 10 July 2026. Educational content only — not investment advice.

Educational content only — not investment advice. This calculator is a teaching device. Its output is a model's opinion under stated assumptions, not a forecast, and not a reason to enter a trade. See our Methodology.