Bond convexity calculator
For a 10-year bond with a 5% coupon priced at a 4% yield, a 100 basis point rise pulls the estimated price from above par down to about 1,000. Duration and convexity come from the same cash flows. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Face value
- 1,000
- Coupon rate percent
- 5
- Ytm percent
- 4
- Years to maturity
- 10
- Frequency
- 2
- Yield change bp
- 100
- Periods
- 20
- Coupon payment
- 25
- Price
- 1,081.757167
- Macaulay duration
- 8.080936
Bond prices do not move in a straight line when market yields jump. Duration captures the first-order slope of that price-yield curve; convexity captures the curvature that duration alone understates for large rate moves. This bond convexity calculator prices a fixed-coupon bond from face value, annual coupon rate, yield to maturity, years to maturity, and payment frequency, then returns Macaulay duration, modified duration, and annualized convexity from the same cash-flow schedule. Optionally pass a parallel yield shift in basis points to see the duration effect, the convexity effect, and an estimated new price under the classic Taylor expansion. Use it for rate-risk notes, fixed-income homework, portfolio what-if checks, and automation that must refine price-change predictions beyond a pure duration approximation.
What bond convexity measures and why duration is not enough
Modified duration estimates the percentage price change of a bond for a small parallel move in yield: roughly minus modified duration times the yield change. That linear approximation works well for a few basis points, but it systematically understates price gains when yields fall and overstates price losses when yields rise, because the true price-yield relationship is convex for plain fixed-coupon bonds. Convexity quantifies that curvature.
With annualized convexity Conv and an annual yield shift Δy expressed as a decimal, the second-order refinement is one-half times Conv times (Δy) squared, added to the duration term. The combined formula is percentage price change approximately equal to minus modified duration times Δy plus one-half times convexity times (Δy) squared. Larger maturity, lower coupon, and lower yield each tend to raise convexity for otherwise similar bonds, which is why long zero-coupon bonds are especially sensitive to large rate swings beyond what duration alone predicts.
This calculator does not fetch live quotes or credit spreads; it measures geometry of a user-supplied cash-flow schedule so risk notes, homework keys, and automation share one auditable identity. Pairing duration with convexity is standard fixed-income practice whenever scenario shocks are tens or hundreds of basis points rather than a single tick.
Input contract, formulas, rounding, and worked examples
Optional frequency defaults to two for semiannual coupons and must be one, two, four, or twelve; years times frequency must equal a positive integer number of coupon periods. Optional decimals is an integer from zero through twelve (default six) controlling half-up rounding on numeric outputs. Internally the period rate is r equals ytm divided by frequency, the coupon payment is face times coupon rate divided by frequency, and price is the present value of all coupons plus face at maturity.
Macaulay duration in years is the present-value-weighted average payment time; modified duration is Macaulay divided by one plus r; annualized convexity is the sum of cash-flow times k times (k plus one) discounted, divided by price times (one plus r) squared times frequency squared.
Where a bond convexity calculator earns its keep
Portfolio managers and risk desks use a bond convexity calculator when a rate-shock memo must show both the linear duration impact and the second-order convexity add-on for a hundred-basis-point parallel move, so stakeholders see why long bonds recover more on the way down than a duration-only table suggests. Wealth advisors and treasury teams compare coupon bonds against zeros when explaining why two positions with similar modified duration can still diverge under large yield moves.
Educators and LMS platforms need a deterministic oracle for fixed-income homework that asks students to compute price, Macaulay duration, modified duration, and convexity from first principles without a full Bloomberg terminal. Failed validation does not consume balance. Keep face and years positive, pin rounded fields in tests, and you get reproducible convexity figures for notebooks and production without standing up a fixed-income library of your own.
What you can do with it
Rate-shock price refinement
Combine modified duration and convexity to estimate bond price change for large parallel yield moves in basis points, not just a linear duration guess.
Compare coupon vs zero structures
Hold modified duration roughly constant and inspect convexity to see which cash-flow shape cushions large rate swings more.
Fixed-income homework and LMS keys
Mark problems that ask for price, Macaulay duration, modified duration, and annualized convexity with a deterministic cash-flow oracle.
FAQ
How is bond convexity calculated?
From the bond’s cash flows: Conv = Σ[CF_k · k · (k+1) / (1+r)^k] / [P · (1+r)² · m²], where r is the period yield, m is payments per year, and P is dirty price from the same schedule.
How does convexity improve the price-change estimate?
Duration alone is linear. Adding ½ · Conv · (Δy)² captures curvature so large yield increases look less severe and large decreases look more favorable for plain fixed-coupon bonds.
When is duration alone not enough to estimate a bond's price change?
When rates move by tens or hundreds of basis points. Duration is a straight-line estimate that works for small moves, but it understates gains when yields fall and overstates losses when they rise.
Why are long zero-coupon bonds so sensitive to large rate swings?
Because a longer maturity, a lower coupon and a lower yield all raise convexity. A long bond that pays no coupon combines the first two, so its price curves the most as yields move.
Which coupon frequencies does the calculator accept?
Annual, semiannual, quarterly or monthly payments, with semiannual as the starting choice. Years to maturity times payments per year must give a whole number of coupon periods, such as 20 for a 10-year semiannual bond.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/finance/bond-convexity \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"face_value":1000,"coupon_rate_percent":5,"ytm_percent":4,"years_to_maturity":10}'const res = await fetch("https://api.kit.forhosting.com/finance/bond-convexity", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"face_value": 1000,
"coupon_rate_percent": 5,
"ytm_percent": 4,
"years_to_maturity": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/finance/bond-convexity",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"face_value": 1000,
"coupon_rate_percent": 5,
"ytm_percent": 4,
"years_to_maturity": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/finance/bond-convexity", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"face_value":1000,"coupon_rate_percent":5,"ytm_percent":4,"years_to_maturity":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"face_value":1000,"coupon_rate_percent":5,"ytm_percent":4,"years_to_maturity":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/finance/bond-convexity", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"face_value": 1000,
"coupon_rate_percent": 5,
"ytm_percent": 4,
"years_to_maturity": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "finance.bond_convexity",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Invalid input fails with invalid_input and is not billed.
Input contract, formulas, rounding, and worked examples
POST a JSON body with four required finite numbers: face_value greater than zero, coupon_rate_percent greater than or equal to zero (zero models a pure discount bond), ytm_percent as the annual yield compounded at the coupon frequency, and years_to_maturity greater than zero. Optional yield_change_bp is the parallel yield shift in basis points used for the Taylor estimate. Example: face one thousand, five percent coupon, four percent yield, ten years, semiannual frequency yields a premium price above par, multi-year modified duration, and positive convexity; adding yield_change_bp of one hundred returns duration_effect, convexity_effect, estimated_price_change, estimated_price, and estimated_percent_change. Missing fields, non-finite values, non-positive face or maturity, negative coupon, invalid frequency, too-negative yield that makes one plus r non-positive, or a non-integer period count fail with invalid_input and are not billed.
Technical questions
What inputs does the bond convexity calculator need?
Required: face_value, coupon_rate_percent, ytm_percent, years_to_maturity. Optional: frequency (default 2), yield_change_bp for the Taylor estimate, and decimals for rounding.
Can I model a zero-coupon bond?
Yes. Set coupon_rate_percent to zero. The only cash flow is face_value at maturity; duration and convexity follow from that single payment.
What does the bond convexity calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.