Home Calculators Categories Category: Finance & Business

Bond convexity calculator

An option-free bond with positive cash flows has a price that is a convex function of its yield. Modified duration is the negative price-normalized slope at the current yield; convexity is the price-normalized curvature. Duration alone predicts a straight-line price response that is accurate to first order for small yield moves. Convexity supplies the second-order term that corrects the linear estimate, and for option-free bonds that correction is positive for any nonzero yield move. This calculator computes full price, modified duration and annual convexity for a fixed-rate bullet bond, compares duration-only, convexity-adjusted and exact repriced values for a yield shock, and also derives effective duration and effective convexity from prices you supply for bonds with embedded options.

Input

Fixed-rate, option-free bullet bond, valued just after a coupon. No accrued interest; full regular coupon periods. Yield is nominal annual, compounded at the coupon frequency. Prices use your face-value units.

Load the two-year annual 5% coupon bond at a 5% yield, then adjust its inputs.
Use 100 for a quote per 100 par, or the total redemption amount for a position. All calculated prices use this scale.
price units
Annual fixed coupon as a percentage of face value. Enter 0 for a zero-coupon bond.
%
Remaining years from just after a coupon. Maturity must contain whole coupon periods.
years
Nominal annual yield in percent, compounded at the coupon frequency. Type a precise value or use the 0.1-point slider.
% nominal
Payments per year also set the yield compounding basis: 1 annual, 2 semiannual, 4 quarterly.

Maturity must be a whole number of coupon periods. Use coupon = 0 for a zero-coupon bond.

Visual
Bond price sensitivityPrice against yield change: fixed-cash-flow repricing, duration tangent and convexity-adjusted estimate. Effective mode shows only local estimates and supplied prices.
Output
Annual convexity
—

Annual yield basis; the ½ factor is applied only in price estimates.

—
Full bond price
—
Modified duration

The Price-Yield Relationship and Why It Curves

For a bond paying nn periodic cash flows CFkCF_k, discounted at the periodic factor q=1+y/mq = 1 + y/m, where yy is the nominal annual yield compounded mm times per year, the full price is

P=∑k=1nCFk q−k=∑k=1nCFk(1+ym)−kP = \sum_{k=1}^{n} CF_k \, q^{-k} = \sum_{k=1}^{n} CF_k \left(1 + \frac{y}{m}\right)^{-k}

Here FF is face value, cc is the decimal annual coupon rate, and TT is years to maturity, with n=T⋅mn = T \cdot m, CFk=Fc/mCF_k = F c / m for k<nk < n, and CFn=Fc/m+FCF_n = F c / m + F. Every term q−kq^{-k} is a decreasing, convex function of yy for q>0q > 0, 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 kk.

Bond Convexity Formula: Derivation from Cash-Flow Moments

Differentiate the price with respect to the nominal yield. Since dq/dy=1/mdq/dy = 1/m,

dPdy=−1m∑k=1nk CFk q−k−1\frac{dP}{dy} = -\frac{1}{m}\sum_{k=1}^{n} k \, CF_k \, q^{-k-1}
d2Pdy2=1m2∑k=1nk(k+1) CFk q−k−2\frac{d^2P}{dy^2} = \frac{1}{m^2}\sum_{k=1}^{n} k(k+1) \, CF_k \, q^{-k-2}

Modified duration is the negative normalized first derivative, and annual convexity is the normalized second derivative:

Dmod=−1PdPdy=∑k=1nk PVkP⋅m⋅qD_{\text{mod}} = -\frac{1}{P}\frac{dP}{dy} = \frac{\sum_{k=1}^{n} k \, PV_k}{P \cdot m \cdot q}
C=1Pd2Pdy2=∑k=1nk(k+1) PVkP⋅m2⋅q2,PVk=CFk q−kC = \frac{1}{P}\frac{d^2P}{dy^2} = \frac{\sum_{k=1}^{n} k(k+1)\, PV_k}{P \cdot m^2 \cdot q^2}, \qquad PV_k = CF_k \, q^{-k}

Here tk=k/mt_k = k/m is the time in years of cash flow kk, 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 k(k+1)=k2+kk(k+1) = k^2 + k. Two conventions matter for anyone comparing outputs across systems:

  • No embedded one-half. The reported CC is the pure normalized second derivative. The factor 12\tfrac{1}{2} 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 m2m^2 scaling. The sums above are in coupon-period units. Dividing by m2m^2 converts period curvature into curvature with respect to the decimal annual yield, so the result is in years2\text{years}^2. Per-period convexity equals m2Cm^2 C. Duration is converted the same way by dividing by mm (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 F=100F = 100, c=5%c = 5\%, T=2T = 2, y=5%y = 5\%, annual coupons (m=1m = 1, q=1.05q = 1.05). The present values are PV1=5/1.05=4.7619PV_1 = 5/1.05 = 4.7619 and PV2=105/1.1025=95.2381PV_2 = 105/1.1025 = 95.2381, so P=100.0000P = 100.0000.

Dmod=1(4.7619)+2(95.2381)100×1.05=195.2381105=1.8594 years  (=820441)D_{\text{mod}} = \frac{1(4.7619) + 2(95.2381)}{100 \times 1.05} = \frac{195.2381}{105} = 1.8594 \text{ years} \;\left(=\tfrac{820}{441}\right)
C=2(4.7619)+6(95.2381)100×1.052=580.9524110.25=5.2694 years2  (=4880926.1)C = \frac{2(4.7619) + 6(95.2381)}{100 \times 1.05^2} = \frac{580.9524}{110.25} = 5.2694 \text{ years}^2 \;\left(=\tfrac{4880}{926.1}\right)

This is the calculator's built-in par preset.

Zero-coupon closed form

With c=0c = 0 the only cash flow is at k=nk = n, and the formulas collapse to

Dmod=T1+y/m,C=n(n+1)m2(1+y/m)2D_{\text{mod}} = \frac{T}{1 + y/m}, \qquad C = \frac{n(n+1)}{m^2 (1 + y/m)^2}

Convexity of a zero grows roughly with T2T^2, while duration grows linearly. A 30-year zero at a 5% annual yield has Dmod=28.5714D_{\text{mod}} = 28.5714 years and C=843.5374C = 843.5374 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 P(y+Δy)P(y + \Delta y) about the current yield gives

P(y+Δy)=P+dPdyΔy+12d2Pdy2(Δy)2+⋯P(y+\Delta y) = P + \frac{dP}{dy}\Delta y + \frac{1}{2}\frac{d^2P}{dy^2}(\Delta y)^2 + \cdots

Substituting the normalized quantities, with Δy\Delta y in decimals (100 bp=0.01100 \text{ bp} = 0.01):

PD=P(1−Dmod Δy)P_D = P\left(1 - D_{\text{mod}}\,\Delta y\right)
PD+C=P(1−Dmod Δy+12 C (Δy)2)P_{D+C} = P\left(1 - D_{\text{mod}}\,\Delta y + \tfrac{1}{2}\,C\,(\Delta y)^2\right)
Pexact=∑k=1nCFk(1+y+Δym)−kP_{\text{exact}} = \sum_{k=1}^{n} CF_k \left(1 + \frac{y+\Delta y}{m}\right)^{-k}

The fractional price change is therefore approximately −DmodΔy+12C(Δy)2-D_{\text{mod}}\Delta y + \tfrac{1}{2}C(\Delta y)^2; multiply by 100 for a percentage. For the par preset under +100 bp+100\text{ bp}, the estimates are 98.140698.1406 (duration only), 98.166998.1669 (convexity-adjusted) and 98.166698.1666 (exact). The convexity term, 12(5.2694)(0.01)2×100=0.0263\tfrac{1}{2}(5.2694)(0.01)^2 \times 100 = 0.0263 price units, recovers nearly all of the 0.02600.0260 duration error. The residual of 0.00030.0003 comes from third- and higher-order terms.

Because C>0C > 0 for any option-free bond with positive cash flows, the quadratic term is positive for either sign of a nonzero Δy\Delta y. 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 q>0q > 0: 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, y=5%y = 5\%, P=100P = 100, Dmod=1.8594D_{\text{mod}} = 1.8594, C=5.2694C = 5.2694:

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 16P′′′(Δy)3\tfrac{1}{6}P'''(\Delta y)^3 is negative for Δy>0\Delta y > 0 (the third derivative of price is negative) and positive for Δy<0\Delta y < 0.

The same exercise for a ten-year 5% bond at a 5% yield (Dmod=7.7217D_{\text{mod}} = 7.7217, C=74.9977C = 74.9977) 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 ∣Δy∣>100 bp|\Delta y| > 100\text{ bp}, 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 (F=100F = 100, 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 mm gives different measures, because the same nominal yield implies a different effective annual yield and a different cash-flow grid:

Frequency mm 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 n=T⋅mn = T \cdot m 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 hh of the benchmark curve.

Given P0P_0 (current full price), P−P_- (price after a downward shift of hh) and P+P_+ (price after an upward shift of hh), the central-difference estimates are

Deff=P−−P+2 P0 hD_{\text{eff}} = \frac{P_- - P_+}{2\,P_0\,h}
Ceff=P−+P+−2P0P0 h2=(P−−P0)+(P+−P0)P0 h2C_{\text{eff}} = \frac{P_- + P_+ - 2P_0}{P_0\,h^2} = \frac{(P_- - P_0) + (P_+ - P_0)}{P_0\,h^2}

These are the three-point finite-difference approximations of −1PdPdy-\frac{1}{P}\frac{dP}{dy} and 1Pd2Pdy2\frac{1}{P}\frac{d^2P}{dy^2}, using the same normalization and no embedded one-half as the cash-flow mode. In the calculator's prices method, hh is the bump input, in basis points divided by 10,000.

Using the calculator defaults (P0=100P_0 = 100, P−=102P_- = 102, P+=98.1P_+ = 98.1, h=100 bp=0.01h = 100\text{ bp} = 0.01):

Deff=102−98.12×100×0.01=1.9500,Ceff=102+98.1−200100×0.0001=10.0000D_{\text{eff}} = \frac{102 - 98.1}{2 \times 100 \times 0.01} = 1.9500, \qquad C_{\text{eff}} = \frac{102 + 98.1 - 200}{100 \times 0.0001} = 10.0000

Negative effective convexity

A callable bond trading near its call price behaves differently. Suppose P0=101P_0 = 101, P−=102P_- = 102 (capped near the call price as yields fall) and P+=99P_+ = 99, with h=100 bph = 100\text{ bp}:

Deff=102−992×101×0.01=1.4851,Ceff=102+99−202101×0.0001=−99.0099D_{\text{eff}} = \frac{102 - 99}{2 \times 101 \times 0.01} = 1.4851, \qquad C_{\text{eff}} = \frac{102 + 99 - 202}{101 \times 0.0001} = -99.0099

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 Ceff<0C_{\text{eff}} < 0. If you see it, confirm that P−P_-, P0P_0 and P+P_+ 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 hh amplifies numerical noise in the pricing model, since CeffC_{\text{eff}} divides a small difference of prices by h2h^2. A large hh 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 Dmod=∑k PVkP m qD_{\text{mod}} = \dfrac{\sum k\,PV_k}{P\,m\,q},   C=∑k(k+1) PVkP m2q2\;C = \dfrac{\sum k(k+1)\,PV_k}{P\,m^2 q^2} Deff=P−−P+2P0hD_{\text{eff}} = \dfrac{P_- - P_+}{2P_0 h},   Ceff=P−+P+−2P0P0h2\;C_{\text{eff}} = \dfrac{P_- + P_+ - 2P_0}{P_0 h^2}
Inputs Face, coupon, maturity, yield, frequency P0P_0, P−P_-, P+P_+, bump size hh
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 ±1 bp\pm 1\text{ bp} and applying the effective formulas reproduces 1.85941.8594 and 5.26945.2694 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 ViV_i be the total market value of holding ii, including its quantity:

Dp=∑iwiDi,Cp=∑iwiCi,wi=Vi∑jVjD_p = \sum_i w_i D_i, \qquad C_p = \sum_i w_i C_i, \qquad w_i = \frac{V_i}{\sum_j V_j}

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 (Δt=0\Delta t = 0). 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 100 bp100\text{ bp} equals 0.010.01.
  • Display. Outputs are shown to four decimal places, and magnitudes below 0.000050.00005 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.

Calculation Methodology Documented

Read the formula definitions, supported input ranges, and limitations before using this estimate.

Review Methodology
Debjeet Bhowmick
Author Debjeet Bhowmick AWS Certified Solutions Architect • Cloud & DevOps Consultant

AWS Certified Solutions Architect Professional and Senior Cloud & DevOps Consultant with over 14 years of hands-on expertise architecting resilient cloud infrastructure across AWS, GCP, and Azure. Specializes in infrastructure as code, continuous delivery automation, and telemetry across Terraform, Ansible, Docker, Kubernetes, ELK, Python, and SQL. Creator of OrangeCalc, delivering client-side high-precision computational tools.