curatedapi

Bond duration and convexity calculator

The price of a coupon bond at a yield, with its Macaulay and modified duration, convexity and DV01, for any settlement date.

Settlement date (when the buyer gets the bond).
Maturity date.
Annual coupon rate in percent of face value.
Annual yield to maturity in percent, compounded at the coupon frequency.
Amount repaid at maturity per 100 of face value.
Coupons per year: 1, 2 or 4.
How days are counted for accrued interest. Options: 30/360: US (NASD) 30/360; actual/actual: actual days over the actual length of the coupon period; actual/360: actual days over a 360-day year; actual/365: actual days over a 365-day year; 30e/360: European 30/360
More options: rounding and decimals
Precision and rounding
Rounding mode applied once to each result. Default half_even.
Round results to this many digits after the decimal point.
Round results to this many significant digits.

Examples

Example: A 10-year 5% semiannual bond at a 6% yield, on a coupon date

Clean price
Price per 100 of face value without accrued interest.
92.561263 rounded
Accrued interest
Coupon earned since the last coupon date.
0.000000 exact
Dirty price
What the buyer pays: clean price + accrued interest.
92.561263 rounded
Macaulay duration
Weighted average time to the payments, in years.
7.894997 rounded
Modified duration
Macaulay duration ÷ (1 + yield ÷ frequency).
7.665046 rounded
Convexity
The second derivative of price to yield, divided by price.
71.785398 rounded
Dv01
Fall in price per 100 of face value for a rise of 0.01% in yield.
0.070949 rounded
Coupons remaining
Coupons from settlement to maturity.
20

Rounding: Half even, 6 decimal places. Calculator finance/bond-duration-convexity@1.

How it is calculated

P = Σ CF_k·v^t_k, v = 1/(1 + y/f), t_k = k − 1 + days to next coupon ÷ days in period; Macaulay = Σ t_k·CF_k·v^t_k ÷ P ÷ f; modified = Macaulay·v; convexity = Σ t_k·(t_k + 1)·CF_k·v^(t_k + 2) ÷ (P·f²); DV01 = modified × P ÷ 10000

Prices a bond that pays periodic coupons by discounting each payment at the yield, and measures how the price reacts when the yield moves. Modified duration is the percentage fall in price for a rise of one percentage point in yield; convexity is the correction for larger moves; DV01 is the change in price, per 100 of face value, for one basis point. Between coupon dates the price is split into the clean price and accrued interest.

  • Every payment is discounted with compound interest, including when only one coupon is left. Excel's PRICE switches to simple interest in that last period, so its price differs slightly there.
  • Yield and convexity are in the bond's own compounding: a yield of 6% with two coupons a year is 3% per half-year.
  • Dates from 1900-03-01. Coupon dates are counted back from maturity.

References

Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.

Use it from your code

POST /v1/calc/finance/bond-duration-convexityVersion 1
curl https://api.curatedapi.com/v1/calc/finance/bond-duration-convexity \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "settlement": "2026-03-15",
    "maturity": "2036-03-15",
    "coupon_rate_percent": "5",
    "yield_percent": "6"
  }'
The same call in Python
import os

import requests

payload = {
    "settlement": "2026-03-15",
    "maturity": "2036-03-15",
    "coupon_rate_percent": "5",
    "yield_percent": "6",
}
response = requests.post(
    "https://api.curatedapi.com/v1/calc/finance/bond-duration-convexity",
    headers={"Authorization": f"Bearer {os.environ['CURATEDAPI_KEY']}"},
    json=payload,
    timeout=10,
)
print(response.json()["result"])
The same call in JavaScript
const payload = {
    "settlement": "2026-03-15",
    "maturity": "2036-03-15",
    "coupon_rate_percent": "5",
    "yield_percent": "6",
};
const response = await fetch("https://api.curatedapi.com/v1/calc/finance/bond-duration-convexity", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.CURATEDAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});
console.log((await response.json()).result);

MCP tool calc_finance_bond_duration_convexity at https://mcp.curatedapi.com. Inputs, outputs and errors in the API reference.

Put it on your website

<div data-curatedapi-widget="finance/bond-duration-convexity" data-key="capi_public_…"></div>
<script src="https://widgets.curatedapi.com/v1/widget.js" async></script>

Use a public key registered for your site. Calculations are billed like API calls. How widgets work.

Related calculators

Add this calculator to your website

Paste two lines into your page and your visitors get this calculator. Each use counts as one call on your plan, the same as the API.

Free for up to 1,000 uses a month. 50,000 uses a month cost $9.00 on the Starter plan.