Bond Immunization & Duration Matching Calculator

Enter one future liability and two candidate bonds to solve the market-value allocations that match the liability present value and Macaulay duration. The result also shows face amounts, convexity cushion, and exact coverage after parallel rate shocks.

Your numbers
Enter the single amount that must be available at the end of the liability horizon.
Enter the number of years until the liability must be paid.
Use the annual nominal yield appropriate for discounting the future liability.
Use the payment frequency shared by the two candidate bonds and the yield convention.
Enter the principal repaid by one bond at maturity.
Enter Bond A's stated annual coupon rate.
Enter Bond A's nominal annual yield to maturity using the selected compounding frequency.
The shorter-duration candidate will normally mature before or near the liability horizon.
Enter Bond B's stated annual coupon rate.
Enter Bond B's nominal annual yield to maturity using the selected compounding frequency.
The longer-duration candidate will normally mature after the liability horizon.
Enter the upward and downward yield shift used to reprice the bonds and liability.

What this calculator leaves out

  • This calculator is an educational fixed-income model, not investment advice or a recommendation to buy either bond.
  • It assumes fixed, default-free cash flows and parallel yield shocks; real bonds can have settlement, tax, credit, liquidity, and curve-shape effects not modeled here.
  • Quoted yields, accrued interest, bid-ask spreads, commissions, taxes, and minimum trade denominations are excluded.

By using this calculator you agree to the Terms of Use. Results are estimates, not professional advice.

Immunization resultFeasible: present value and duration match, allocations are nonnegative, and convexity is positive.

Liability present value
$80,051.01
Bond A price per bond
$986.00
Bond B price per bond
$1,000.00
Bond A Macaulay duration
2.87 years
Bond B Macaulay duration
6.69 years
Bond A investment
$35,449.81
Bond B investment
$44,601.21
Bond A face amount
$35,953.28
Bond B face amount
$44,601.21
Immunized portfolio duration
5 years
Convexity cushion
6.22
Coverage after rates fall
100.03%
Coverage after rates rise
100.04%
Duration matching breakdown
ItemValue or priceMacaulay durationConvexityFace amount
Liability$80,051.015 years26.3
Bond A$986.002.87 years9.52$35,953.28
Bond B$1,000.006.69 years50.8$44,601.21

Assumes fixed, option-free bond cash flows and settlement exactly on a coupon date.

Face amounts are theoretical and may not match actual trading denominations.

How to use this calculator

  1. Enter the future liability amount, its horizon, and the discount rate used for that liability.
  2. Choose the coupon and compounding frequency shared by the two candidate bonds.
  3. Enter coupon rate, yield, and maturity for each bond.
  4. Review the solved investments, face amounts, convexity cushion, and shocked coverage ratios.

How the immunizing allocation is calculated

Single-liability immunization starts by valuing the liability today, then building an asset portfolio with the same present value and the same Macaulay duration. With two bonds, that gives two equations and two unknown investments. This calculator solves those equations directly instead of asking you to use a spreadsheet optimizer.

For each bond, let F be face value, m be payments per year, T be years to maturity, N = m * T, c be the annual coupon rate, and y be the annual nominal yield. Each coupon is F * c / m, with face value added to the final cash flow. The price is:

P = sum(CF[k] / (1 + y / m)^k)

Macaulay duration weights each discounted cash flow by its payment time:

D = sum((k / m) * PV(CF[k])) / P

Convexity is calculated as K = sum(k * (k + 1) * CF[k] / (m^2 * (1 + y / m)^(k + 2))) / P. The liability present value is V = L / (1 + yL / m)^(mH), its duration is the horizon H, and its convexity is mH * (mH + 1) / (m^2 * (1 + yL / m)^2).

The solved dollar investments are:

xA = V * (DB - H) / (DB - DA)

xB = V * (H - DA) / (DB - DA)

The face amount for each bond is x / P * F. The portfolio convexity is the market-value-weighted average of the two bond convexities. A positive convexity cushion means the asset convexity is above the liability convexity, which is the local Redington condition after present value and duration are matched.

What moves the result most

The two bond durations drive the allocation. The liability horizon should fall strictly between them; otherwise the equations require a negative investment in one bond. Yields also matter because they change bond prices, durations, convexity, and the liability present value. Coupon rates matter mainly by changing how much cash flow arrives before maturity.

What this calculator leaves out

The model assumes fixed, default-free cash flows with no calls, puts, floating coupons, prepayments, or credit-spread changes. It excludes accrued interest, settlement dates, taxes, bid-ask spreads, commissions, reinvestment income, and minimum trade denominations. The shock test reprices the entered bonds and liability for parallel yield changes only; nonparallel curve moves can break a duration match.

Worked example

Suppose a $100,000 liability is due in five years and is discounted at 4.5% with semiannual compounding. Bond A has a 3.5% coupon, 4% yield, and three years to maturity. Bond B has a 5% coupon, 5% yield, and eight years to maturity. With $1,000 face value bonds, the liability present value is about $80,051.

The calculator prices Bond A at about $986.00 with a 2.87-year Macaulay duration. Bond B prices at about $1,000.00 with a 6.69-year duration. Solving the two equations gives about $35,450 in Bond A and $44,601 in Bond B, equal to roughly $35,953 of Bond A face amount and $44,601 of Bond B face amount.

The combined portfolio duration is 5.00 years and the convexity cushion is about 6.22. With a 1% parallel shock, exact repricing gives about 100.03% coverage after rates fall and about 100.04% coverage after rates rise.

Common questions

What does bond immunization mean?

Bond immunization is a way to fund a known liability by matching asset present value and duration to the liability. The match is local, meaning it is designed around the starting yields and normally needs rebalancing as time and yields change.

Why must the two bond durations straddle the liability horizon?

The two-bond solution is a weighted average of the two bond durations. A nonnegative weighted average can only land between the two durations. If the liability horizon is outside that range, the formula requires short selling or leverage.

What is the difference between Macaulay and modified duration?

Macaulay duration is the present-value-weighted average time of the cash flows. Modified duration adjusts Macaulay duration for the yield convention and estimates price sensitivity to a small yield change. This calculator matches Macaulay duration because it is matching the timing of assets to a dated liability.

Why does an immunized portfolio need positive excess convexity?

Duration matching handles the first-order price effect of a small rate move. Positive excess convexity gives the asset portfolio more curvature than the liability, which helps the portfolio remain at or above the liability value for small rate moves in either direction.

Can zero-coupon bonds be used for immunization?

Yes. A zero-coupon bond has all of its cash flow at maturity, so its Macaulay duration equals its maturity. A zero-coupon bond maturing exactly at the liability date can fund the liability directly, while two zero-coupon bonds on either side can form a duration-matched mix.

Does duration matching protect against nonparallel yield-curve changes?

Not by itself. This calculator assumes a parallel shift in all relevant yields. Key-rate duration, curve steepening or flattening, credit-spread changes, and liquidity changes can all make the realized result differ from the duration-matched estimate.

Put this calculator on your site

Paste the snippet below where you want the calculator to appear. It stays up to date automatically and links back here.

<iframe src="https://countfolk.com/embed/bond-immunization-duration-matching-calculator/" title="Bond Immunization & Duration Matching Calculator" width="100%" height="640" style="border:0;max-width:44rem" loading="lazy"></iframe>