Historical VaR and Expected Shortfall Calculator (CVaR)

Compute historical VaR and expected shortfall from an actual return series, and compare both with the normal assumption.

Historical VaR at 95% 58,000 -5.80% of a 1,000,000 book in one period
Expected shortfall (CVaR) 65,500
Average loss beyond VaR -6.55%
Parametric VaR, same confidence 35,536
Inputs
Try:
Amounts are treated in the selected currency; no foreign-exchange conversion is applied.
%
One return per period, separated by commas. Daily or monthly both work; 40 or more observations is a sensible minimum.
%
95% is the common desk convention; 99% is usual for regulatory reporting.
$
Used to convert the percentage loss into money.
Results & Graph
Historical VaR at 95%
58,000
-5.80% of a 1,000,000 book in one period
Expected shortfall (CVaR)
65,500
Average loss beyond VaR
-6.55%
Parametric VaR, same confidence
35,536
Worst single period observed
-7.30%
Observations in the tail
2 of 40

Where the Losses Actually Fall

Graph 1 • Where the Returns Actually Fell Bars left of the VaR line are the observations the threshold did not cover.
-7.3% to -6.7%: 1-6.7% to -6.1%: 0-6.1% to -5.5%: 1-5.5% to -4.9%: 0-4.9% to -4.3%: 0-4.3% to -3.7%: 1-3.7% to -3.1%: 1-3.1% to -2.5%: 1-2.5% to -1.9%: 0-1.9% to -1.3%: 2-1.3% to -0.7%: 4-0.7% to -0.1%: 5-0.1% to 0.5%: 50.5% to 1.1%: 81.1% to 1.7%: 51.7% to 2.3%: 5 VaR -5.80% ES -6.55%
Graph 2 • What the Normal Assumption Misses The same confidence level, read off the observations and then assumed normal.
Expected shortfall -6.55% Historical VaR -5.80% Parametric VaR -3.55%
Graph 3 • The Series the Tail Was Read From Each point is one period. The tail is estimated from the handful of worst ones.
-7.3% -2.4% 2.5% P1: 0.8 % 0.8 P1 P2: 1.2 % P3: -0.4 % -0.4 P3 P4: 0.6 % P5: 2.1 % 2.1 P5 P6: -1.9 % P7: 0.3 % 0.3 P7 P8: 1.5 % P9: -0.7 % -0.7 P9 P10: 0.9 % P11: -3.4 % -3.4 P11 P12: 1.1 % P13: 0.4 % 0.4 P13 P14: -0.2 % P15: 1.8 % 1.8 P15 P16: 0.7 % P17: -1.1 % -1.1 P17 P18: 2.3 % P19: -0.5 % -0.5 P19 P20: 0.2 % P21: -5.8 % -5.8 P21 P22: 1.4 % P23: 0.6 % 0.6 P23 P24: -0.9 % P25: 1.7 % 1.7 P25 P26: 0.1 % P27: -2.6 % -2.6 P27 P28: 0.8 % P29: 1.3 % 1.3 P29 P30: -0.3 % P31: 0.5 % 0.5 P31 P32: -4.2 % P33: 1.9 % 1.9 P33 P34: 0.7 % P35: -1.4 % -1.4 P35 P36: 2 % P37: 0.4 % 0.4 P37 P38: -0.8 % P39: 1.1 % 1.1 P39 P40: -7.3 % -7.3 P40
Summary: VaR sits at -5.80% and the average of the 2 worst observations is -6.55%.
Summary: On 40 observations, 95% of periods lost less than 5.80%. When that threshold broke, the average loss was 6.55%, or 65,500. The normal assumption puts the same threshold at 3.55%, so it understates what this series actually did.
Interactive chart & math engine powered by CalculatorGraph

Formula: Historical VaR and Expected Shortfall

VaRa = the (1 - a) quantile of the sorted return series
ESa = mean of all returns at or below VaRa
VaR_a = the (1 - a) quantile of the sorted return series ; ES_a = mean of all returns at or below VaR_a
  • a: Confidence level, so 95% leaves 5% of observations in the tail
  • VaRa: The loss that is not exceeded in a% of periods
  • ESa: Expected shortfall: the average loss in the periods that did exceed VaR

Rounding: Percentages to two decimal places; money to whole units. VaR uses nearest-rank on the sorted series.

Worked example: Example: 40 period returns at 95% confidence on a $1,000,000 book

A return series containing a -7.3% period and three other losses beyond -2.5%.

  1. Sort the 40 returns from worst to best.
  2. At 95% confidence, 5% of 40 observations is 2, so the VaR is the second worst return.
  3. Expected shortfall averages every observation at or below that point, which is where the fat tail shows up.
  4. The parametric figure is computed from the same mean and standard deviation under a normal assumption, for comparison.
Result: The historical VaR is -5.80% or $58,000, while expected shortfall is -6.55% or $65,500. The normal assumption puts VaR at -3.55%, or $35,536, understating the observed tail by $22,464.

Frequently Asked Questions

Why is expected shortfall better than VaR?

VaR tells you a threshold and then stops. Two portfolios can share the same 95% VaR while one loses slightly more beyond it and the other loses everything, and VaR cannot tell them apart. Expected shortfall averages the losses that actually breach the threshold, so it describes the severity of the tail rather than just its edge. That is why the Basel framework moved from VaR to expected shortfall for market risk.

Why does the historical figure differ so much from the parametric one?

Because returns are not normal. Real series have fatter tails and more negative skew than a bell curve allows, so a normal model systematically under-prices large losses. If the parametric number here is much smaller than the historical one, the series contains losses a normal distribution says should essentially never happen, and that is the finding rather than an error.

How many observations do I need?

More than most people use. At 95% confidence only one observation in twenty sits in the tail, so 40 periods gives you a two-point estimate. 250 daily observations, roughly a trading year, gives 12 or 13 tail points and is a reasonable floor. Below about 100 observations treat the result as indicative of shape rather than a number to size positions on.

Can I scale a daily VaR to ten days?

The common practice is to multiply by the square root of ten, and it is wrong in a useful way. That scaling assumes each day is independent of the last, whereas losses cluster: bad days follow bad days. Square-root scaling therefore understates the ten-day figure precisely when it matters. Where possible, compute the figure directly from ten-day returns.

Why does VaR stay at 73,000 from 97.5% upwards?

Because the series has only 40 observations. At 97.5% the tail is exactly one observation, and above that it would be less than one, which the engine rounds up. The VaR is therefore the worst return, minus 7.3%, for every level from 97.5% to 99.5%. More data, not a higher confidence setting, is what changes that figure.

Does expected shortfall include the VaR observation itself?

Yes. The engine averages every return at or below the VaR threshold, so at 95% on the default series it averages the two worst returns, minus 7.3 and minus 5.8, to get minus 6.55%. Some definitions average only losses strictly beyond the threshold, which on a short series can give a noticeably different number.

Is the parametric figure using the sample or population standard deviation?

The sample version, dividing by the number of observations minus one. On the default series that is about 2.08% against about 2.06% for the population version. The difference changes the 95% parametric VaR only slightly, from 35,536 to a little lower, and it shrinks as the series grows.

Can historical VaR be lower than parametric VaR?

Yes. If the worst observed returns are milder than a normal distribution with the same standard deviation would predict, the historical figure will be smaller. That can happen on a short or unusually calm sample. It is not reassurance; it may simply mean the series has not yet included a bad enough period.

How do I get daily VaR from monthly returns?

You cannot do it reliably from monthly data. The page computes VaR for whatever period length you enter, so monthly returns give a monthly VaR. Converting downwards needs assumptions about how returns behave within the month. If you need a daily figure, enter daily returns for the same history instead.

Should I remove outliers like the minus 7.3% before running it?

Only if the observation is an error, such as a mispriced day or a missing dividend adjustment. A real loss of 7.3% is exactly the information historical VaR exists to capture. Removing it leaves 39 returns and a single tail observation, so expected shortfall falls to 5.80% and the parametric figure drops sharply, describing a safer strategy than the one you ran.

Why does the page show the number of observations in the tail?

Because the reliability of the estimate depends almost entirely on it. On the default, 2 of 40 observations determine both VaR and expected shortfall. A figure resting on two points can move a lot when one more bad period is added, so the count is a built-in warning about how much weight to put on the result.

Can I use prices instead of returns?

No. The engine expects period returns in percent. Convert a price series first by taking each price divided by the previous one, minus one, times a hundred. Feeding raw prices would treat each price level as a return and produce meaningless figures, even though the page would still calculate them.

What does the currency setting change?

Only the symbol on the money figures. The engine does no conversion, so a series of returns on a euro portfolio with the display set to dollars still produces the right numbers in euros. Set it to match the portfolio so that anyone reading the result is not misled about which currency the 58,000 is in.

How does the portfolio value interact with leverage?

The engine simply multiplies the percentage result by the portfolio value you enter. If the returns are on a leveraged position, enter the equity you have at risk and returns measured on that equity. Entering gross exposure with returns on equity, or the reverse, will overstate or understate the money loss by the leverage factor.

Why does the interpretation say the normal model understates the risk?

It compares the historical VaR with the parametric figure at the same confidence level. On the default, 5.80% historical against 3.55% parametric means the series actually lost more at the 95% point than the bell curve allows. When the historical figure is the smaller of the two, the sentence says the normal model overstates the loss instead.

Does the order of the returns matter to the result?

Not to any figure on this page. VaR, expected shortfall and the parametric line all depend only on the set of values, so shuffling the list gives identical output. Order matters a great deal for drawdowns and for how a portfolio feels to hold, which is why a separate drawdown measure is worth running alongside.

A 58,000 VaR on a one million book

The default series is 40 period returns, with a 95% confidence level applied to a $1,000,000 portfolio. The headline reads a historical VaR of 58,000, which is a loss of 5.80% of the book in one period. In plain terms, 95% of the observed periods lost less than that.

The supporting lines add the tail. Expected shortfall, the average loss in the periods at or beyond the VaR threshold, is 65,500, an average of 6.55%. The worst single period in the sample lost 7.30%. Only 2 of the 40 observations sit in the tail, and the engine shows that count so you cannot miss how thin the estimate is.

The last line is the comparison the page is built around. A normal distribution fitted to the same mean and standard deviation puts the 95% VaR at 35,536, about 3.55% of the book. The historical figure is roughly 60% larger, because the actual series contains losses the bell curve treats as very unlikely.

Checking the 5.80% by sorting the returns

Historical VaR is simple enough to verify by hand. Sort the 40 returns from worst to best. The six worst are minus 7.3, minus 5.8, minus 4.2, minus 3.4, minus 2.6 and minus 1.9.

At 95% confidence, 5% of the observations fall in the tail, and 5% of 40 is 2. The engine uses nearest rank without interpolation, so the VaR is the second worst return, minus 5.8%. On a book of $1,000,000 that is the 58,000 in the headline.

Expected shortfall then averages every observation at or below that threshold. Here that is the two worst returns: minus 7.3 and minus 5.8 average to minus 6.55, which is the 65,500 figure. Because the threshold observation itself is included, ES can never be smaller than VaR, and when only one observation is in the tail the two are equal.

If your own figures differ from a spreadsheet, the usual reason is the quantile method. Spreadsheet percentile functions interpolate between neighbouring observations and would put the 95% point somewhere between minus 5.8 and minus 4.2, giving a smaller VaR. Neither method is wrong, but they are not interchangeable, and with a short series the gap can be large.

Where the 35,536 parametric figure comes from

The parametric line uses the same 40 returns, but only through two summary numbers. Their mean is about minus 0.13% a period and their sample standard deviation about 2.08%. Under a normal assumption the 95% one sided threshold is 1.645 standard deviations below the mean, which works out to a loss of 3.55%, or 35,536 on the default book.

The gap between 35,536 and 58,000 is the finding. The two worst returns in the series, minus 7.3 and minus 5.8, sit roughly 3.4 and 2.7 standard deviations below the mean. A normal distribution expects moves that large in well under one period in a hundred, yet this short sample contains two of them.

That is what a fat left tail looks like in practice. The standard deviation is pulled up a little by those losses, but not nearly enough to account for them, so the normal model understates the risk exactly where it matters. When the historical number is well above the parametric one, take the historical one seriously and ask what produced those observations.

Moving the confidence level from 90% upwards

Lowering confidence to 90% widens the tail. 10% of 40 is 4, so nearest rank makes the VaR the fourth worst return, minus 3.4%, which the page shows as 34,000 on the default book. Expected shortfall averages the four worst returns to 5.17%, or 51,750. The parametric figure at the same level is 2.80%, so the gap between history and the normal model persists, and ES now sits well beyond VaR because the tail holds a wider spread of losses.

Going upwards is where the method runs out of data. At 97.5%, 2.5% of 40 is exactly 1, so the VaR jumps to the worst observation, 7.30%. At 99% and at 99.5% the tail would be less than one observation, the engine rounds it up to one, and the answer stays at 7.30%, or 73,000 on the default book. Expected shortfall equals VaR in each case.

Meanwhile the parametric figure keeps climbing: 4.21% at 97.5%, 4.97% at 99%, and about 5.49% at 99.5%. The historical number is capped by the worst loss you happen to have seen; the normal one keeps extrapolating. Neither is reliable at those levels on 40 points. If you need a 99% figure, you need a much longer series or a model of the tail.

What expected shortfall adds on this series

VaR at 95% tells you that the threshold is 5.80%. It says nothing about the size of losses beyond it, and on this series the worst was 7.30%. Expected shortfall puts a number on that tail: 6.55% on average when the threshold breaks.

The difference between the two, 0.75 percentage points of the book, is small here because the tail contains only two observations that happen to be fairly close together. On a longer series with a genuine crash in it, ES can sit far beyond VaR, which is precisely the information a risk limit based on VaR alone would miss.

Because ES averages the tail, it is also more stable than VaR as observations are added. A single new bad period changes the average a little rather than redefining the cut-off, though on 2 observations even that stability is limited.

Entering the return series and book size

Returns are entered as percentages separated by commas, so minus 2.6 means a 2.6% loss. Entering decimal fractions such as minus 0.026 would shrink every figure by a factor of a hundred and the page would not warn you.

Every return should cover the same length of period, whether days, weeks or months, and the VaR then applies to that period length. Mixing daily and monthly returns in one list produces a number that describes neither.

The engine refuses series shorter than 20 returns, on the grounds that a shorter list cannot describe a tail. Twenty is a minimum for the page to run, not a sensible sample; at 95% it leaves a single observation in the tail.

Portfolio value is only a multiplier. Halve the book and every money figure halves, while the percentages stay at 5.80% and 6.55%. The engine accepts confidence levels from 80% up to just under 99.9% and rejects anything lower, because below about 80% the cut-off return can be a gain rather than a loss. The conventional choices are 90%, 95% and 97.5% or 99%.

Splitting the default series into two halves

Every observation in the list carries equal weight, however old it is. A quick way to see how much that matters is to run the two halves of the default series separately, each of which is 20 returns and just meets the minimum.

The first 20 returns are calm. Their worst period is minus 3.4%, so the 95% VaR is 3.40% of the book, and with a single observation in the tail the expected shortfall is the same. The second 20 contain all of the large losses, minus 5.8, minus 4.2 and minus 7.3, and the 95% VaR jumps to 7.30%, or 73,000 on the default book.

The full 40 period figure of 5.80% sits between them, and which half you consider more representative of the next period is a judgement the page cannot make for you. If the strategy changed partway through, or market conditions did, a window covering only the relevant regime may be more honest than the longest history available. If you shorten the window, though, accept that the tail estimate rests on fewer points still.

Running a few windows like this is cheap and often more informative than any single figure. A VaR that roughly doubles depending on which half of the history you pick is a warning that the number is describing the sample as much as the strategy.

Using the number in a position or limit decision

A historical VaR is most useful as a sanity check on a risk limit and as a way to compare portfolios on the same history. If a strategy's 95% VaR from its own record is 5.80% a period and your limit is 3%, either the position is too large or the limit was set using a model that does not describe this strategy.

Backtesting is the honest next step. Count how often the realised loss in later periods exceeded the VaR you computed beforehand; at 95% it should be around one period in twenty. Far more breaches than that suggests the history you used was too calm.

The figure also ignores the order of returns. A series where the bad periods arrive together, as they often do, has the same VaR as one where they are spread out, but very different drawdown. For that, look at drawdown measures alongside this page.

This page describes the risk in a series you provide. It is not financial advice, and sizing real positions or setting regulatory capital should involve a risk professional and a longer, independently sourced history.