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.
- Version 1
- Checked against 2 published values
- Free, no sign-up
Result: 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 ÷ 10000Prices 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
- Microsoft Excel DURATION function
- Microsoft Excel MDURATION function
- FINRA: Bond yield and return (yield to maturity and yield to call)
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
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
- Black-76 calculator for options on futures
- Black-Scholes option price and Greeks calculator
- Compound interest calculator
- EU and UK APRC calculator
- Extra mortgage payment calculator
- FHA mortgage insurance (MIP) calculator
- Implied volatility calculator
- Internal rate of return (IRR) calculator
- Loan EMI calculator
- Mortgage affordability calculator
- Mortgage calculator
- Net present value (NPV) calculator
- Refinance break-even calculator
- Rent or buy calculator
- Return on investment (ROI) calculator
- Savings goal calculator
- Simple interest calculator
- US APR calculator (Truth in Lending, Regulation Z)
- USDA loan guarantee fee calculator
- VA funding fee calculator
- Yield to call calculator
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.