What the Sharpe ratio calculator does
The Sharpe ratio measures return per unit of risk: how much a strategy earned above a risk-free rate for each unit of volatility it carried. Introduced by William Sharpe in 1966, it is the most common way to compare strategies, funds and backtests that run at different levels of risk. The Sortino ratio is a variant that only counts downside volatility, so large gains do not count against a strategy. This calculator computes both from your own periodic returns and annualizes them, along with the volatility, the average and compounded returns, and a range that shows how precise the estimate is.
How to use it
- Paste your returns in percent, one per period — monthly returns from a broker statement or a backtest report, for example. Values can sit on separate lines or be separated by commas, spaces or semicolons. A column copied from Excel or Google Sheets works too, including values with a decimal comma.
- Choose the period of the returns: daily, weekly or monthly. For daily returns, pick 252 trading days a year for stocks and forex, or 365 for crypto, which trades every day.
- Enter the annual risk-free rate, such as the yield of a short-term government bill in your currency. Use 0 to compare strategies without it.
If you only know the mean and standard deviation of your returns, switch the input to "Mean & st. dev.": the Sharpe ratio still works, but the Sortino ratio needs the full list.
The formula
With n returns r per period, P periods per year and an annual risk-free rate rf:
risk-free per period rfp = rf ÷ P
mean m = Σ r ÷ n
standard deviation s = √( Σ (r − m)² ÷ (n − 1) )
downside deviation dd = √( Σ min(0, r − rfp)² ÷ n )
Sharpe (annualized) = (m − rfp) ÷ s × √P
Sortino (annualized) = (m − rfp) ÷ dd × √P
Annualizing with √P assumes returns are independent from one period to the next. The downside deviation uses the risk-free rate as the target return, so the two ratios can be compared directly. The approximate 95% range uses Andrew Lo's standard error for a Sharpe ratio measured on n returns, √((1 + SR² ÷ 2) ÷ n) per period, scaled by √P.
Worked example
Twelve monthly returns: 2.1, −1.4, 3.0, 0.8, −2.2, 1.7, 0.5, −0.9, 2.6, 1.2, −1.8 and 1.9%, with a 4% risk-free rate, or 0.333% a month:
- Mean: 7.5 ÷ 12 = 0.625% a month — 7.5% a year, or 7.58% compounded
- Standard deviation: 1.788% a month, so 1.788 × √12 = 6.19% a year
- Monthly Sharpe: (0.625 − 0.333) ÷ 1.788 = 0.163; annualized: 0.163 × √12 = 0.57
- Downside deviation: four months fall below 0.333%, by 1.733, 2.533, 1.233 and 2.133 points. The sum of their squares divided by 12, square-rooted, is 1.136%
- Sortino: (0.625 − 0.333) ÷ 1.136 × √12 = 0.89
- Approximate 95% range of the Sharpe: −1.41 to 2.54
That range is the real lesson. One year of monthly data cannot tell a strategy with a Sharpe of 0.57 from one with no edge at all — or from an excellent one.
Reading the result
As a rough guide to annualized Sharpe ratios after costs: below 0, the strategy did worse than cash; a broad stock index held for decades has typically landed around 0.3 to 0.5; above 1 sustained over several years is strong; and values above 2 or 3 are rare enough to deserve suspicion. Check high readings for overfitting, look-ahead bias or missing costs before trusting them. If the strategy was the best of many you tried, the deflated Sharpe ratio calculator shows how high a Sharpe ratio luck alone would produce.
- Short samples are noisy. The range row shows how wide the uncertainty is. It narrows only slowly, with the square root of the number of returns.
- Volatility is not the only risk. Strategies that sell options or average down can show a smooth equity curve and a high Sharpe for years, then lose heavily in one event. Look at the maximum drawdown too, with the drawdown calculator.
- Annualization assumes independence. Returns that trend from one period to the next, or valuations smoothed over time, make the √P scaling misleading.
- Compare like with like. Use the same period, the same frequency, the same costs and the same risk-free rate.
Common mistakes
- Mixing frequencies. Annualize daily returns with daily periods and monthly with monthly. Applying √12 to daily data understates the annual figure by a wide margin.
- Counting deposits as returns. A balance that grows because you added money did not earn that money. Use returns on equity before deposits and withdrawals.
- Leaving out costs. Commissions, spreads, swaps and slippage all lower the mean without lowering the volatility much.
- Trusting a spectacular Sortino. With few losing periods, the downside deviation rests on a handful of numbers and the ratio can look far better than the strategy is. Read it next to the Sharpe and the sample size. The expectancy calculator gives a per-trade view of the same edge.