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.
avg_return = 10risk_free = 4.5volatility = 12
- 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
Ready to run the numbers?
Open Sharpe Ratio Calculator