The Price-Yield Relationship and Why It Curves
For a bond paying periodic cash flows , discounted at the periodic factor , where is the nominal annual yield compounded times per year, the full price is
Here is face value, is the decimal annual coupon rate, and is years to maturity, with , for , and . Every term is a decreasing, convex function of for , and a positive-weighted sum of convex functions is convex. That single fact is the origin of convexity: the price-yield curve bends upward, and, for otherwise comparable bonds, it bends more for longer-dated, lower-coupon bonds because more weight sits at larger .
Bond Convexity Formula: Derivation from Cash-Flow Moments
Differentiate the price with respect to the nominal yield. Since ,
Modified duration is the negative normalized first derivative, and annual convexity is the normalized second derivative:
Here is the time in years of cash flow , so the duration numerator is the present-value-weighted first moment of the cash-flow timing, and the convexity numerator is a weighted second moment, since . Two conventions matter for anyone comparing outputs across systems:
- No embedded one-half. The reported is the pure normalized second derivative. The factor belongs to the Taylor term, not to the definition. Some textbooks and data vendors publish "convexity" with the half already absorbed, which halves the number; check the convention before comparing.
- The scaling. The sums above are in coupon-period units. Dividing by converts period curvature into curvature with respect to the decimal annual yield, so the result is in . Per-period convexity equals . Duration is converted the same way by dividing by (years instead of periods).
The calculator evaluates these expressions in IEEE 754 double precision and displays four decimal places.
Worked example: the two-year par bond
Take , , , , annual coupons (, ). The present values are and , so .
This is the calculator's built-in par preset.
Zero-coupon closed form
With the only cash flow is at , and the formulas collapse to
Convexity of a zero grows roughly with , while duration grows linearly. A 30-year zero at a 5% annual yield has years and years², so long zeros can contribute strongly to portfolio convexity when their market-value weights are material.
From Convexity Formula to Price Estimate: The Taylor Expansion
Expanding about the current yield gives
Substituting the normalized quantities, with in decimals ():
The fractional price change is therefore approximately ; multiply by 100 for a percentage. For the par preset under , the estimates are (duration only), (convexity-adjusted) and (exact). The convexity term, price units, recovers nearly all of the duration error. The residual of comes from third- and higher-order terms.
Because for any option-free bond with positive cash flows, the quadratic term is positive for either sign of a nonzero . Gains from falling yields exceed the duration tangent, and losses from rising yields are smaller than the tangent predicts. The duration-only estimate therefore understates the exact price of a straight bond for nonzero shocks that keep : it is a tangent line lying below a convex curve. At zero shock, the estimates and exact price coincide.
Duration-only vs convexity-adjusted vs exact repricing
Two-year 5% annual-pay bond, , , , :
| Shock (bp) | Duration only | Duration + convexity | Exact repriced | Duration error | Convexity-adjusted error |
|---|---|---|---|---|---|
| −300 | 105.5782 | 105.8154 | 105.8247 | −0.2465 | −0.0093 |
| −200 | 103.7188 | 103.8242 | 103.8269 | −0.1081 | −0.0027 |
| −100 | 101.8594 | 101.8858 | 101.8861 | −0.0267 | −0.0003 |
| −50 | 100.9297 | 100.9363 | 100.9363 | −0.0066 | −0.0000 |
| 0 | 100.0000 | 100.0000 | 100.0000 | 0.0000 | 0.0000 |
| +50 | 99.0703 | 99.0769 | 99.0768 | −0.0065 | +0.0000 |
| +100 | 98.1406 | 98.1669 | 98.1666 | −0.0260 | +0.0003 |
| +200 | 96.2812 | 96.3866 | 96.3840 | −0.1028 | +0.0026 |
| +300 | 94.4218 | 94.6589 | 94.6502 | −0.2284 | +0.0087 |
Errors are estimate minus exact. Note the sign asymmetry in the convexity-adjusted column: for falling yields the quadratic estimate slightly undershoots the exact price, and for rising yields it slightly overshoots, because the omitted cubic term is negative for (the third derivative of price is negative) and positive for .
The same exercise for a ten-year 5% bond at a 5% yield (, ) shows how quickly the approximation degrades with longer maturity:
| Shock (bp) | Duration only | Duration + convexity | Exact repriced | Duration error | Convexity-adjusted error |
|---|---|---|---|---|---|
| −300 | 123.1652 | 126.5401 | 126.9478 | −3.7826 | −0.4077 |
| −200 | 115.4435 | 116.9434 | 117.0604 | −1.6169 | −0.1170 |
| −100 | 107.7217 | 108.0967 | 108.1109 | −0.3892 | −0.0142 |
| −50 | 103.8609 | 103.9546 | 103.9564 | −0.0955 | −0.0017 |
| 0 | 100.0000 | 100.0000 | 100.0000 | 0.0000 | 0.0000 |
| +50 | 96.1391 | 96.2329 | 96.2312 | −0.0921 | +0.0017 |
| +100 | 92.2783 | 92.6533 | 92.6399 | −0.3616 | +0.0133 |
| +200 | 84.5565 | 86.0565 | 85.9528 | −1.3963 | +0.1036 |
| +300 | 76.8348 | 80.2097 | 79.8698 | −3.0350 | +0.3399 |
A 300 bp fall on this bond leaves the duration-only estimate nearly 3.8 price units short, while the convexity term recovers about 90% of that gap. Both approximations are local derivatives at the current yield. In Advanced mode the calculator raises a large-shift warning when , and for shocks that large the exact repricing, not the Taylor estimate, is the number to use.
What Moves Duration and Convexity: Maturity, Coupon and Yield
The reference grid below was computed with the same engine formulas (, annual coupons).
| Maturity (yrs) | Coupon | Yield | Full price | Modified duration (yrs) | Convexity (yrs²) |
|---|---|---|---|---|---|
| 1 | 0% | 5% | 95.2381 | 0.9524 | 1.8141 |
| 2 | 0% | 5% | 90.7029 | 1.9048 | 5.4422 |
| 5 | 0% | 5% | 78.3526 | 4.7619 | 27.2109 |
| 10 | 0% | 5% | 61.3913 | 9.5238 | 99.7732 |
| 20 | 0% | 5% | 37.6889 | 19.0476 | 380.9524 |
| 30 | 0% | 5% | 23.1377 | 28.5714 | 843.5374 |
| 1 | 5% | 5% | 100.0000 | 0.9524 | 1.8141 |
| 2 | 5% | 5% | 100.0000 | 1.8594 | 5.2694 |
| 5 | 5% | 5% | 100.0000 | 4.3295 | 23.9360 |
| 10 | 5% | 5% | 100.0000 | 7.7217 | 74.9977 |
| 20 | 5% | 5% | 100.0000 | 12.4622 | 211.3345 |
| 30 | 5% | 5% | 100.0000 | 15.3725 | 350.4667 |
| 2 | 8% | 5% | 105.5782 | 1.8360 | 5.1804 |
| 10 | 8% | 5% | 123.1652 | 7.1828 | 67.5881 |
| 30 | 8% | 5% | 146.1174 | 14.1184 | 303.6199 |
| 2 | 5% | 2% | 105.8247 | 1.9154 | 5.5889 |
| 10 | 5% | 2% | 126.9478 | 8.1865 | 82.6224 |
| 30 | 5% | 2% | 167.1894 | 18.9217 | 478.2216 |
| 2 | 5% | 8% | 94.6502 | 1.8066 | 4.9763 |
| 10 | 5% | 8% | 79.8698 | 7.2645 | 67.8768 |
| 30 | 5% | 8% | 66.2266 | 12.1874 | 245.3451 |
| 2 | 8% | 8% | 100.0000 | 1.7833 | 4.8900 |
| 10 | 8% | 8% | 100.0000 | 6.7101 | 60.5313 |
| 30 | 8% | 8% | 100.0000 | 11.2578 | 212.4325 |
Reading the grid:
- Maturity. Convexity scales roughly with the square of the weighted-average cash-flow time. Moving a 5% par bond from 10 to 30 years raises duration about 2.0 times but convexity about 4.7 times.
- Coupon. Larger coupons pull cash flow toward earlier dates, shortening the weighted timing. At 5% yield, a 10-year zero has duration 9.5238 and convexity 99.7732, versus 7.7217 and 74.9977 for the 5% coupon bond. Convexity is more sensitive to coupon than duration is.
- Yield level. Lower yields raise both measures, because the discounting that shrinks distant cash flows relative to near ones is weaker. The 10-year 5% bond has convexity 82.6224 at a 2% yield and 67.8768 at 8%. This is why convexity risk and convexity value are largest in low-rate environments.
- Zeros are the extreme case. For equal maturity, yield and compounding frequency, a zero-coupon bond has the highest duration and convexity among these bullet bonds with non-negative coupons.
Compounding frequency
Holding the 10-year 5% nominal-yield par bond fixed and changing only gives different measures, because the same nominal yield implies a different effective annual yield and a different cash-flow grid:
| Frequency | Modified duration (yrs) | Convexity (yrs²) |
|---|---|---|
| 1 (annual) | 7.7217 | 74.9977 |
| 2 (semiannual) | 7.7946 | 73.6287 |
| 4 (quarterly) | 7.8317 | 72.9085 |
Duration rises slightly with frequency and convexity falls, because the same nominal yield compounds into a higher effective annual yield and the cash-flow grid is finer. The differences are modest but not negligible for long bonds. Compare convexity figures only across bonds quoted on the same compounding convention, and keep the calculator's frequency setting consistent with how the yield was quoted. The maturity guard requires to be a whole number of at least 1, so a 2.25-year bond is valid for quarterly coupons but not for annual or semiannual ones.
Effective Convexity Formula for Bonds with Embedded Options
The analytical expressions above assume cash flows that do not change when yields change. A callable bond, putable bond or mortgage pass-through violates this: the expected cash flows depend on the rate path. Differentiating a fixed-cash-flow price formula is no longer meaningful, so risk is measured by revaluing the instrument with a pricing model (typically a lattice or Monte Carlo model with option exercise) after a symmetric parallel shift of the benchmark curve.
Given (current full price), (price after a downward shift of ) and (price after an upward shift of ), the central-difference estimates are
These are the three-point finite-difference approximations of and , using the same normalization and no embedded one-half as the cash-flow mode. In the calculator's prices method, is the bump input, in basis points divided by 10,000.
Using the calculator defaults (, , , ):
Negative effective convexity
A callable bond trading near its call price behaves differently. Suppose , (capped near the call price as yields fall) and , with :
The price gains less when yields fall than it loses when yields rise, so the price-yield curve is concave in that region. Duration shortens as rates fall (the issuer is more likely to call) and lengthens as rates rise (the call is less likely to be exercised), which is the opposite of the straight bond's behavior. A holder is effectively short convexity. The calculator flags this with a negative-convexity note whenever . If you see it, confirm that , and came from one pricing model with identical parameters (volatility, prepayment or call assumptions, option-adjusted spread held fixed) and symmetric parallel shifts. Inconsistent inputs produce spurious curvature that looks identical to genuine negative convexity.
In effective mode the chart plots only the three supplied points and the local linear and quadratic approximations. It does not draw an exact curve between them, because none exists without the underlying model.
Choosing the bump size
Finite-difference estimates trade truncation error against model noise. A very small amplifies numerical noise in the pricing model, since divides a small difference of prices by . A large mixes higher-order terms and, for callables, can straddle the call-exercise boundary. Compare estimates across several bump sizes and follow the pricing model's risk convention rather than assuming one bump fits every instrument. The calculator accepts bumps from 1 to 200 bp.
Duration vs Convexity, and Modified vs Effective Measures
| Attribute | Modified duration / convexity | Effective duration / convexity |
|---|---|---|
| Definition | Analytical first and second derivatives of price with respect to yield, holding cash flows fixed | Numerical sensitivities from full revaluation after parallel benchmark curve shifts |
| Formulas | , | , |
| Inputs | Face, coupon, maturity, yield, frequency | , , , bump size |
| Applicability | Option-free fixed-rate bullet bonds | Callable, putable, prepayable and other rate-contingent cash flows; any externally priced instrument |
| Embedded options | Not handled: cash flows are assumed independent of yield | Captured through the pricing model's option exercise logic |
| Sign of convexity | Always positive for positive cash flows | Can be negative (call or prepayment compression) |
| Accuracy | Exact derivatives; Taylor estimates degrade for large shocks | Central-difference approximations; depend on model quality and bump size |
| Yield measure | Bond's own yield to maturity | Benchmark curve shift, with other model inputs held constant |
For a straight bond with a small bump in its own quoted yield, the two approaches converge: repricing the two-year par bond at and applying the effective formulas reproduces and to within numerical rounding. Benchmark-curve sensitivities need not match yield-to-maturity sensitivities when they represent different risk factors.
Convexity in Portfolio Management and Immunization
When all sensitivities refer to the same parallel risk-factor shift and compounding convention, portfolio duration and convexity are market-value-weighted averages of the holdings' measures, so they aggregate linearly. Let be the total market value of holding , including its quantity:
Classical local immunization against a single liability matches the present value and the modified duration of assets and liabilities on that common risk basis. That neutralizes first-order exposure to a parallel yield shift but leaves the second-order term. Requiring asset convexity to be at least liability convexity, while holding PV and duration matched, makes the surplus non-negative to second order under a small parallel shift of either sign. Convexity can be valuable to the holder and may command a price premium or yield concession, with other risks and bond features held comparable; equal duration alone does not determine relative yields.
Two portfolios with identical duration can have very different convexity. On a common flat-yield and compounding basis, a barbell of short and long zeros has higher convexity than a bullet zero concentrated at the target duration, because spreading the cash-flow timing raises its second moment. For equal starting market value and duration, higher convexity improves the local second-order response to a parallel shift in either direction. It does not guarantee total-return outperformance for large shifts or over a holding period: higher-order effects, curve changes, carry and any yield concession also matter.
Matching duration and convexity still protects only against parallel shifts. Non-parallel deformations require key-rate durations or cash-flow matching, neither of which this tool computes.
Scope and Assumptions
The calculator is deterministic and runs entirely in your browser in IEEE 754 double precision. It does not transmit inputs. Interpret results within these limits:
- Valuation date. The bond is valued immediately after a coupon payment, so clean and full prices coincide. There is no accrued interest, day-count convention (30/360, Actual/Actual) or settlement date between coupons.
- Instrument type. In cash-flow mode, only option-free bullet bonds with constant fixed coupons and a whole number of coupon periods. No sinking funds, amortization, payment-in-kind or floating rates. Use the effective method for bonds with embedded options.
- Yield curve. A flat yield and parallel shifts. Key-rate duration, steepening, flattening and twist are out of scope.
- Credit. Promised cash flows are assumed to be paid with certainty. Rating migration, recovery and changes in option-adjusted spread are not modeled.
- Time. Scenario estimates are instantaneous (). They are not holding-period returns and exclude roll-down and coupon reinvestment.
- Units. Prices are in consistent arbitrary price units (per 100 par or a total currency position). Duration is in years, convexity in years², and a yield shift of equals .
- Display. Outputs are shown to four decimal places, and magnitudes below display as
0.0000.
The interactive chart in cash-flow mode plots the exact repriced curve, the duration tangent line and the convexity-adjusted parabola, with a marker at the selected scenario. You can pan, drag and zoom the viewport, and the copy and print functions export the active inputs, units, results and assumptions for review documentation.
Read the formula definitions, supported input ranges, and limitations before using this estimate.