{
  "id": "roi",
  "version": "796b5e456838",
  "status": "published",
  "name": "ROI Calculator",
  "question": "What is my ROI on this investment?",
  "summary": "Computes return on investment (ROI) from the amount invested and the amount returned, and the annualized return over the years held.",
  "category": "finance",
  "subcategory": "investing",
  "url": "https://www.acalculator.org/finance/roi-calculator",
  "markdown": "https://www.acalculator.org/finance/roi-calculator.md",
  "kind": "function",
  "method": "ROI = (returned − invested) ÷ invested × 100; annualized return = ((returned ÷ invested)^(1 ÷ years) − 1) × 100.",
  "assumptions": [
    "The amount invested includes fees and commissions; the amount returned includes income received (dividends, interest, rent) and is after selling costs.",
    "The annualized return assumes one amount invested at the start and one amount returned at the end, compounding once a year. For money added or taken out along the way, use an internal rate of return instead.",
    "Tax and inflation are not included."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "invested": {
        "title": "Amount invested",
        "description": "Everything you put in: the price paid plus fees and commissions.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0.01,
        "maximum": 1000000000000
      },
      "returned": {
        "title": "Amount returned",
        "description": "Everything you got back: the sale value after selling costs, plus dividends or other income.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000000
      },
      "years": {
        "title": "Years held",
        "description": "How long the money was invested, in years (1.5 is a year and a half). Leave empty to skip the annualized return.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 100
      }
    }
  },
  "outputs": {
    "roi": {
      "label": "Return on investment",
      "description": "The gain as a percent of the amount invested: (returned − invested) ÷ invested × 100.",
      "format": "percent"
    },
    "gain": {
      "label": "Gain",
      "description": "The amount returned minus the amount invested. Negative for a loss.",
      "format": "money"
    },
    "annualized": {
      "label": "Annualized return",
      "description": "The yearly rate that grows the investment to the amount returned: (returned ÷ invested)^(1 ÷ years) − 1.",
      "format": "percent"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "invested": 10000,
      "returned": 12500,
      "years": 3
    },
    "outputs": {
      "roi": 25,
      "gain": 2500,
      "annualized": 7.721734501594186
    },
    "text": "Investing $10,000.00 and getting back $12,500.00 is a return on investment of 25% ($2,500.00)."
  },
  "examples": [
    {
      "given": {
        "invested": 2020,
        "returned": 2540,
        "years": 3
      },
      "expect": {
        "roi": 25.7,
        "gain": 520
      },
      "source": "FINRA, Calculating Your Investment Returns: a total return of about $520 or 25.7 percent (rounded, hence the tolerance); 520 ÷ 2,020 = 25.74%",
      "tolerance": 0.002
    },
    {
      "given": {
        "invested": 2020,
        "returned": 2540,
        "years": 3
      },
      "expect": {
        "roi": 25.742574257425744,
        "annualized": 7.934623858732492
      },
      "source": "hand calculation in content.mdx: (2,540 ÷ 2,020)^(1/3) − 1 = 7.93%"
    },
    {
      "given": {
        "invested": 10000,
        "returned": 15000,
        "years": 5
      },
      "expect": {
        "roi": 50,
        "gain": 5000,
        "annualized": 8.447177119769854
      },
      "source": "hand calculation in content.mdx: 5,000 ÷ 10,000 = 50%; 1.5^(1/5) − 1 = 8.45%"
    },
    {
      "given": {
        "invested": 5000,
        "returned": 4000
      },
      "expect": {
        "roi": -20,
        "gain": -1000
      },
      "source": "hand calculation in content.mdx: a loss: (4,000 − 5,000) ÷ 5,000 = −20%"
    },
    {
      "given": {
        "invested": 1000,
        "returned": 2000,
        "years": 7
      },
      "expect": {
        "roi": 100,
        "annualized": 10.408951367381224
      },
      "source": "hand calculation in content.mdx: money that doubles in 7 years: 2^(1/7) − 1 = 10.41% a year"
    }
  ],
  "sources": [
    "FINRA, Calculating Your Investment Returns (count fees, commissions and dividends; the $520, 25.7% example over three years; annualized return versus a simple average). https://www.finra.org/investors/insights/investment-returns",
    "Hand derivation of the annualized return from invested × (1 + a)^years = returned (shown in full below)."
  ],
  "related": [
    "npv",
    "compound-interest"
  ],
  "changelog": []
}
