{
  "id": "sharpe-ratio",
  "version": "f1e9309ad3a7",
  "status": "published",
  "name": "Sharpe Ratio Calculator",
  "question": "What is my Sharpe ratio?",
  "summary": "Computes the Sharpe ratio of a portfolio, its return above the risk-free rate per unit of standard deviation, from summary figures or from a list of period returns, with the annualized ratio.",
  "category": "finance",
  "subcategory": "investing",
  "url": "https://www.acalculator.org/finance/sharpe-ratio-calculator",
  "markdown": "https://www.acalculator.org/finance/sharpe-ratio-calculator.md",
  "kind": "function",
  "method": "S = (Rp − Rf) ÷ σp. From returns: Dₜ = Rₜ − Rf ÷ m, S = D̄ ÷ σ_D with σ_D = √(Σ (Dₜ − D̄)² ÷ (n − 1)), annual S = √m × S, where m is the periods per year.",
  "assumptions": [
    "Returns and the risk-free rate are for the same period; a yearly risk-free rate is divided evenly over the periods of a year.",
    "Annualizing by √(periods per year) assumes the excess returns of different periods are not correlated.",
    "Arithmetic is exact on the typed decimals; the standard deviation uses a floating-point square root."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "from": {
        "title": "Data",
        "description": "Type the average return and standard deviation, or a list of returns for each period.",
        "type": "string",
        "enum": [
          "summary",
          "series"
        ]
      },
      "rp": {
        "title": "Portfolio return",
        "description": "The return of the portfolio or fund over the period, for example a year.",
        "type": "number",
        "x-unit": "percent",
        "minimum": -100,
        "maximum": 1000
      },
      "rf": {
        "title": "Risk-free rate",
        "description": "The return on a riskless investment, such as a Treasury bill, over the same period.",
        "type": "number",
        "x-unit": "percent",
        "minimum": -100,
        "maximum": 1000
      },
      "sd": {
        "title": "Standard deviation of the return",
        "description": "How much the portfolio’s return varies, as a standard deviation over the same period.",
        "type": "number",
        "x-unit": "percent",
        "exclusiveMinimum": 0,
        "maximum": 1000
      },
      "returns": {
        "title": "Returns for each period (%)",
        "description": "The portfolio’s return in each period, in percent, separated by spaces or new lines.",
        "type": "array",
        "items": {
          "type": "number"
        }
      },
      "rfy": {
        "title": "Risk-free rate per year",
        "description": "The yearly return on a riskless investment; it is divided by the periods per year.",
        "type": "number",
        "x-unit": "percent",
        "minimum": -100,
        "maximum": 1000
      },
      "per": {
        "title": "Periods per year",
        "description": "12 for monthly returns, 52 for weekly, 252 for trading days, 1 for yearly.",
        "type": "integer",
        "minimum": 1,
        "maximum": 366
      }
    }
  },
  "outputs": {
    "sharpe": {
      "label": "Sharpe ratio",
      "description": "Excess return ÷ standard deviation; from a list of returns, the per-period ratio × √(periods per year).",
      "format": "number"
    },
    "perPeriod": {
      "label": "Sharpe ratio per period",
      "description": "List of returns: mean excess return ÷ its sample standard deviation.",
      "format": "number"
    },
    "excess": {
      "label": "Excess return",
      "description": "Return − risk-free rate; from a list, the mean excess return per period.",
      "format": "percent"
    },
    "sdExcess": {
      "label": "Standard deviation of excess returns",
      "description": "List of returns: √(Σ (Dₜ − D̄)² ÷ (n − 1)), per period.",
      "format": "percent"
    },
    "count": {
      "label": "Periods",
      "description": "How many returns are in the list.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "from": "summary",
      "rp": 20,
      "rf": 3,
      "sd": 26,
      "returns": "2 -1 3 1.5 -0.5 2",
      "rfy": 2.4,
      "per": 12
    },
    "outputs": {
      "sharpe": 0.6538461538461539,
      "excess": 17
    },
    "text": "The Sharpe ratio is 0.65."
  },
  "examples": [
    {
      "given": {
        "from": "summary",
        "rp": 20,
        "rf": 3,
        "sd": 26
      },
      "expect": {
        "sharpe": 0.6538461538461539,
        "excess": 17
      },
      "source": "OpenStax, Principles of Finance, 15.4 Applications in Performance Measurement (Sharpe ratio = (R_P − R_f) ÷ σ_P; McKinley: 17% ÷ 26% = 0.65; Mr. Wong 1.5, Ms. Petrov 1.4). https://openstax.org/books/principles-finance/pages/15-4-applications-in-performance-measurement: 17% ÷ 26% = 0.65"
    },
    {
      "given": {
        "from": "summary",
        "rp": 14,
        "rf": 2,
        "sd": 8
      },
      "expect": {
        "sharpe": 1.5
      },
      "source": "OpenStax, Principles of Finance, 15.4 Applications in Performance Measurement (Sharpe ratio = (R_P − R_f) ÷ σ_P; McKinley: 17% ÷ 26% = 0.65; Mr. Wong 1.5, Ms. Petrov 1.4). https://openstax.org/books/principles-finance/pages/15-4-applications-in-performance-measurement: (14% − 2%) ÷ 8% = 1.5"
    },
    {
      "given": {
        "from": "summary",
        "rp": 16,
        "rf": 2,
        "sd": 10
      },
      "expect": {
        "sharpe": 1.4
      },
      "source": "OpenStax, Principles of Finance, 15.4 Applications in Performance Measurement (Sharpe ratio = (R_P − R_f) ÷ σ_P; McKinley: 17% ÷ 26% = 0.65; Mr. Wong 1.5, Ms. Petrov 1.4). https://openstax.org/books/principles-finance/pages/15-4-applications-in-performance-measurement: (16% − 2%) ÷ 10% = 1.4"
    },
    {
      "given": {
        "from": "summary",
        "rp": 6,
        "rf": 0,
        "sd": 15
      },
      "expect": {
        "sharpe": 0.4
      },
      "source": "William F. Sharpe, \"The Sharpe Ratio\", The Journal of Portfolio Management, Fall 1994: Dₜ = R_Ft − R_Bt (3), D̄ = Σ Dₜ ÷ T (4), σ_D = √(Σ (Dₜ − D̄)² ÷ (T − 1)) (5), S_h = D̄ ÷ σ_D (6), and over T periods σ grows as √T (9), so the ratio does too; an annual excess return of 6% with a 15% standard deviation gives about 0.40. https://web.stanford.edu/~wfsharpe/art/sr/sr.htm: about 0.40"
    },
    {
      "given": {
        "from": "series",
        "returns": [
          2,
          -1,
          3,
          1.5,
          -0.5,
          2
        ],
        "rfy": 2.4,
        "per": 12
      },
      "expect": {
        "perPeriod": 0.6154907219681128,
        "sharpe": 2.1321224040720423,
        "excess": 0.9666666666666667,
        "sdExcess": 1.570562531918633,
        "count": 6
      },
      "source": "William F. Sharpe, \"The Sharpe Ratio\", The Journal of Portfolio Management, Fall 1994: Dₜ = R_Ft − R_Bt (3), D̄ = Σ Dₜ ÷ T (4), σ_D = √(Σ (Dₜ − D̄)² ÷ (T − 1)) (5), S_h = D̄ ÷ σ_D (6), and over T periods σ grows as √T (9), so the ratio does too; an annual excess return of 6% with a 15% standard deviation gives about 0.40. https://web.stanford.edu/~wfsharpe/art/sr/sr.htm; hand calculation in content.mdx: D̄ = 5.8 ÷ 6 = 0.9667, σ_D = √(12.3333 ÷ 5) = 1.5706, 0.9667 ÷ 1.5706 = 0.6155, × √12 = 2.13"
    }
  ],
  "sources": [
    "William F. Sharpe, \"The Sharpe Ratio\", The Journal of Portfolio Management, Fall 1994 (author’s web edition): the differential return Dₜ = R_Ft − R_Bt, its mean D̄, its standard deviation σ_D = √(Σ (Dₜ − D̄)² ÷ (T − 1)), the ex post ratio S_h = D̄ ÷ σ_D, the √T growth of the standard deviation over T periods, and the 6% ÷ 15% = 0.40 example. https://web.stanford.edu/~wfsharpe/art/sr/sr.htm (retrieved 2026-10-18)",
    "OpenStax, Principles of Finance, 15.4 Applications in Performance Measurement: Sharpe ratio = (R_P − R_f) ÷ σ_P, Treynor ratio = (R_P − R_f) ÷ β_P; McKinley Investment Management (17% ÷ 26% = 0.65) and Mr. Wong (1.5) against Ms. Petrov (1.4). https://openstax.org/books/principles-finance/pages/15-4-applications-in-performance-measurement (retrieved 2026-10-18)"
  ],
  "related": [
    "beta",
    "expected-return",
    "volatility",
    "standard-deviation",
    "rate-of-return"
  ],
  "changelog": []
}
