{
  "id": "bond",
  "version": "491926a156ee",
  "status": "published",
  "name": "Bond Calculator",
  "question": "What is this bond’s price or yield?",
  "summary": "Computes a fixed-coupon bond’s price from its yield to maturity, or its yield from its price, on any settlement date, with accrued interest by day count, current yield and duration.",
  "category": "finance",
  "subcategory": "investing",
  "url": "https://www.acalculator.org/finance/bond-calculator",
  "markdown": "https://www.acalculator.org/finance/bond-calculator.md",
  "kind": "function",
  "method": "Full price = Σ C ÷ (1 + y ÷ f)^(w + k) + F ÷ (1 + y ÷ f)^(w + N − 1), k = 0 … N − 1; accrued = C × (1 − w); clean price = full price − accrued. C = F × coupon ÷ f; w is the part of a coupon period from settlement to the next coupon, by the day count.",
  "assumptions": [
    "Coupons are fixed and paid on schedule, and the face value is repaid at maturity; the bond is not called early.",
    "The yield is compounded as often as the coupons are paid, and the same compound discounting is used when one coupon is left.",
    "Coupon dates are not moved for weekends or holidays.",
    "This is an estimate, not investment advice."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "find": {
        "title": "Find the",
        "description": "Whether to work out the price from a yield, or the yield to maturity from a price.",
        "type": "string",
        "enum": [
          "price",
          "ytm"
        ]
      },
      "face": {
        "title": "Face value",
        "description": "The amount repaid at maturity (par), on which the coupons are paid.",
        "type": "number",
        "x-unit": "USD",
        "exclusiveMinimum": 0,
        "maximum": 1000000000
      },
      "coupon": {
        "title": "Coupon rate (yearly)",
        "description": "The yearly coupon as a percent of the face value.",
        "type": "number",
        "x-unit": "percent",
        "minimum": 0,
        "maximum": 100
      },
      "freq": {
        "title": "Coupons a year",
        "description": "How often the coupon is paid: once, twice, four times or twelve times a year.",
        "type": "string",
        "enum": [
          "1",
          "2",
          "4",
          "12"
        ]
      },
      "ytm": {
        "title": "Yield to maturity",
        "description": "The yearly yield, compounded as often as the coupons are paid.",
        "type": "number",
        "x-unit": "percent",
        "minimum": -50,
        "maximum": 100
      },
      "price": {
        "title": "Price (clean)",
        "description": "The quoted price for the whole face value, without accrued interest.",
        "type": "number",
        "x-unit": "USD",
        "exclusiveMinimum": 0,
        "maximum": 10000000000
      },
      "settle": {
        "title": "Settlement date",
        "description": "The day the buyer pays and gets the bond.",
        "type": "string",
        "format": "date"
      },
      "maturity": {
        "title": "Maturity date",
        "description": "The day the face value is repaid with the last coupon.",
        "type": "string",
        "format": "date"
      },
      "basis": {
        "title": "Day count",
        "description": "How the part of a coupon period that has passed is counted, for the accrued interest.",
        "type": "string",
        "enum": [
          "30/360",
          "actual/actual",
          "30e/360"
        ]
      }
    }
  },
  "outputs": {
    "price": {
      "label": "Price (clean)",
      "description": "The quoted price for the whole face value: the full price minus the accrued interest.",
      "format": "money"
    },
    "ytm": {
      "label": "Yield to maturity",
      "description": "The yearly yield, compounded as often as the coupons are paid, at which the price is the value of the cash flows.",
      "format": "percent"
    },
    "pricePct": {
      "label": "Price per $100 of face value",
      "description": "The clean price as a percent of the face value, as bond prices are quoted.",
      "format": "number"
    },
    "dirty": {
      "label": "Full (dirty) price",
      "description": "What the buyer pays: the clean price plus the accrued interest.",
      "format": "money"
    },
    "accrued": {
      "label": "Accrued interest",
      "description": "The part of the current coupon earned by the seller: coupon × part of the period passed.",
      "format": "money"
    },
    "current": {
      "label": "Current yield",
      "description": "The yearly coupon as a percent of the clean price.",
      "format": "percent"
    },
    "macaulay": {
      "label": "Macaulay duration (years)",
      "description": "The average time to each cash flow, weighted by its present value.",
      "format": "number"
    },
    "modified": {
      "label": "Modified duration",
      "description": "The percent change in price for a 1 point change in yield: Macaulay duration ÷ (1 + yield ÷ coupons a year).",
      "format": "number"
    },
    "payment": {
      "label": "Coupon payment",
      "description": "Face value × coupon rate ÷ coupons a year.",
      "format": "money"
    },
    "coupons": {
      "label": "Coupons left",
      "description": "The coupons still to be paid, including the one at maturity.",
      "format": "integer"
    },
    "next": {
      "label": "Next coupon date",
      "description": "The first coupon date after settlement.",
      "format": "date"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "find": "price",
      "face": 1000,
      "coupon": 5,
      "freq": "2",
      "ytm": 6,
      "price": 950,
      "settle": "2026-09-30",
      "maturity": "2036-09-30",
      "basis": "30/360"
    },
    "outputs": {
      "price": 925.6126256977225,
      "pricePct": 92.56126256977225,
      "dirty": 925.6126256977225,
      "accrued": 0,
      "current": 5.401827785388108,
      "macaulay": 7.894997340182342,
      "modified": 7.665045961342079,
      "payment": 25,
      "coupons": 20,
      "next": "2027-03-30"
    },
    "text": "A 5% bond maturing September 30, 2036 is priced at $925.61 for a yield to maturity of 6%."
  },
  "examples": [
    {
      "given": {
        "find": "price",
        "face": 100,
        "coupon": 5.75,
        "freq": "2",
        "ytm": 6.5,
        "settle": "2008-02-15",
        "maturity": "2017-11-15",
        "basis": "30/360"
      },
      "expect": {
        "price": 94.63436162132211,
        "accrued": 1.4375,
        "coupons": 20,
        "next": "2008-05-15"
      },
      "source": "Microsoft Excel PRICE function example: $94.63 (https://support.microsoft.com/en-us/office/price-function-3ea9deac-8dfa-436f-a7c8-17ea02c21b0a); Python 3 cross-check"
    },
    {
      "given": {
        "find": "ytm",
        "face": 100,
        "coupon": 5.75,
        "freq": "2",
        "price": 95.04287,
        "settle": "2008-02-15",
        "maturity": "2016-11-15",
        "basis": "30/360"
      },
      "expect": {
        "ytm": 6.5
      },
      "source": "Microsoft Excel YIELD function example: 6.5% (https://support.microsoft.com/en-us/office/yield-function-f5f5ca43-c4bd-434f-8bd2-ed3c9727a4fe); the price is rounded to 7 digits there",
      "tolerance": 0.000001
    },
    {
      "given": {
        "find": "price",
        "face": 100,
        "coupon": 8,
        "freq": "2",
        "ytm": 9,
        "settle": "2018-07-01",
        "maturity": "2048-01-01",
        "basis": "actual/actual"
      },
      "expect": {
        "macaulay": 10.919145281591932
      },
      "source": "Microsoft Excel DURATION function example: 10.9191453 (https://support.microsoft.com/en-us/office/duration-function-b254ea57-eadc-4602-a86a-c8e369334038); Python 3 cross-check"
    },
    {
      "given": {
        "find": "price",
        "face": 100,
        "coupon": 8,
        "freq": "2",
        "ytm": 9,
        "settle": "2008-01-01",
        "maturity": "2016-01-01",
        "basis": "actual/actual"
      },
      "expect": {
        "modified": 5.735669813918838,
        "accrued": 0
      },
      "source": "Microsoft Excel MDURATION function example: 5.736 (https://support.microsoft.com/en-us/office/mduration-function-b3786a69-4f20-469a-94ad-33e5b90a763c); Python 3 cross-check"
    },
    {
      "given": {
        "find": "price",
        "face": 1000,
        "coupon": 6,
        "freq": "2",
        "ytm": 6,
        "settle": "2026-01-15",
        "maturity": "2036-01-15",
        "basis": "actual/actual"
      },
      "expect": {
        "price": 1000,
        "pricePct": 100,
        "current": 6,
        "accrued": 0
      },
      "source": "the Microsoft Excel PRICE formula with the yield equal to the coupon on a coupon date (https://support.microsoft.com/en-us/office/price-function-3ea9deac-8dfa-436f-a7c8-17ea02c21b0a); hand calculation in content.mdx",
      "tolerance": 1e-12
    }
  ],
  "sources": [
    "Microsoft, Excel PRICE, YIELD, DURATION and MDURATION functions, with worked examples. https://support.microsoft.com/en-us/office/price-function-3ea9deac-8dfa-436f-a7c8-17ea02c21b0a",
    "International Swaps and Derivatives Association, 2006 ISDA Definitions, section 4.16: the 30/360 and 30E/360 day count fractions.",
    "Securities Industry and Financial Markets Association (SIFMA), Standard Securities Calculation Methods (1993): bond price, yield and accrued interest formulas.",
    "U.S. Securities and Exchange Commission, Investor.gov: Bonds. https://www.investor.gov/introduction-investing/investing-basics/investment-products/bonds-or-fixed-income-products/bonds"
  ],
  "related": [
    "present-value",
    "financial",
    "rate-of-return",
    "npv",
    "cd"
  ],
  "changelog": []
}
