Sharpe Ratio Calculator Formula
Understand the math behind the sharpe ratio calculator. Each variable explained with a worked example.
Formulas Used
Sharpe Ratio
sharpe = volatility > 0 ? (avg_return - risk_free) / volatility : 0Excess Return
excess_return = avg_return - risk_freeReward-to-Variability
risk_premium_per_vol = volatility > 0 ? (avg_return - risk_free) / volatility * 100 : 0Variables
| Variable | Description | Default |
|---|---|---|
avg_return | Average Annual Return(%) | 10 |
risk_free | Risk-Free Rate (Treasury)(%) | 4.5 |
volatility | Annual Volatility (Std Dev)(%) | 12 |
How It Works
The Sharpe Ratio
Developed by Nobel laureate William Sharpe, this ratio measures the excess return per unit of total risk.
Formula
Sharpe Ratio = (Rp - Rf) / Std Dev
Where:
Interpreting Results
The higher the Sharpe ratio, the better the risk-adjusted performance. Use it to compare investments, not in isolation.
Limitations
Worked Example
10% average return, 4.5% risk-free rate, 12% volatility.
- 01Excess return = 10% - 4.5% = 5.5%
- 02Sharpe ratio = 5.5% / 12% = 0.458
- 03This is a moderate risk-adjusted return
- 04For comparison, the S&P 500 has a long-run Sharpe near 0.4-0.5
Frequently Asked Questions
What risk-free rate should I use?
Use the yield on a 3-month US Treasury bill for short-term analysis, or the 10-year Treasury yield for long-term comparisons. The risk-free rate should match the investment period being evaluated.
Can the Sharpe ratio be negative?
Yes. A negative Sharpe ratio means the investment returned less than the risk-free rate. You would have been better off in Treasury bills with less risk.
How do I calculate standard deviation?
Standard deviation measures the spread of returns around the average. Most brokerage and financial data sites report it. For a fund, check the fund fact sheet or Morningstar page for trailing volatility figures.
Ready to run the numbers?
Open Sharpe Ratio Calculator