Sharpe & Sortino Ratio Calculator
100% private — runs on your device, never uploaded. Works offline once loaded.
Paste a list of periodic returns (as percentages) and set your risk-free rate and periods per year to compute the Sharpe and Sortino ratios, both per-period and annualized, alongside the mean return and standard deviation. Everything runs on your device.
What the Sharpe ratio measures
The Sharpe ratio, developed by Nobel laureate William Sharpe, measures how much return a strategy earns for each unit of risk it takes. The formula is (mean return − risk-free rate) ÷ standard deviation of returns. The numerator is your excess return over a safe asset; the denominator is the volatility you endured to get it.
A higher Sharpe means more reward per unit of risk. Because it is expressed per unit of volatility, it lets you compare strategies with very different return and risk profiles on a level footing. This tool computes it from a raw series of periodic returns, so you can paste monthly, weekly or daily figures directly.
Why Sortino refines the picture
The Sharpe ratio has a well-known flaw: it treats upside and downside volatility identically. A strategy that occasionally produces huge gains is penalised for that "volatility" even though investors love it. The Sortino ratio fixes this by dividing excess return by the downside deviation — the standard deviation computed from only the returns that fell below the risk-free rate.
Because it ignores upside swings, Sortino often gives a more favourable and arguably fairer reading of strategies with positive skew. When downside deviation is small relative to overall volatility, Sortino will be noticeably higher than Sharpe. If no returns fell below the risk-free rate, downside deviation is undefined and Sortino cannot be calculated.
- Sharpe = (mean − risk-free) ÷ standard deviation of all returns
- Sortino = (mean − risk-free) ÷ downside deviation
- Downside deviation uses only returns below the risk-free rate
- Annualized ratio = per-period ratio × √(periods per year)
Getting the inputs right
Consistency is everything. The risk-free rate must be expressed per the same period as your returns: if you paste monthly returns, use the monthly risk-free rate, not the annual one. Many analysts simply set the risk-free rate to zero for short-horizon comparisons, which is a defensible simplification.
The periods-per-year figure drives annualization. Use 252 for trading-day returns, 12 for monthly, 52 for weekly and 4 for quarterly. Standard deviation here is the sample (n−1) version, appropriate when your history is a sample of possible outcomes. Bear in mind that both ratios assume returns are roughly independent and identically distributed — fat tails and autocorrelation can flatter or distort them.
Frequently asked questions
Should the risk-free rate be annual or per period?
Per period, matching your returns. If your returns are monthly, enter the monthly risk-free rate. Using an annual rate against monthly returns would understate the ratio.
What standard deviation does the tool use?
The sample standard deviation with the n−1 (Bessel's) denominator, both for overall volatility and for downside deviation computed on the negative excess returns.
Why is my Sortino ratio blank?
Sortino requires at least a couple of returns that fall below the risk-free rate. If every return beat the risk-free rate, downside deviation is undefined, so the ratio cannot be computed.
How many returns do I need?
At least two, but more is far better. Ratios computed from a handful of periods are extremely noisy; a few dozen observations give a much more stable estimate.
Can the ratio be negative?
Yes. A negative ratio means the strategy's average return was below the risk-free rate over the period — you took risk and were not compensated for it.
Is my data uploaded anywhere?
No. All parsing and calculation happen locally in your browser, so the return series you paste never leaves your device.
Advertisement