How to use the bond duration calculator
The page has three tools.
Duration & convexity takes a single bond:
- Enter the face value and the coupon rate from the bond’s description.
- Enter the yield to maturity, the market yield shown with the bond’s quote.
- Enter the years to maturity and choose the coupon frequency (semiannual for most US bonds).
The results show Macaulay and modified duration, DV01 per bond and per $1 million of face value, and convexity. The bar chart shows the present value of each payment with the Macaulay duration marked as their balance point.
Rate shock takes the same bond plus a change in yield in basis points (100 bp = 1 percentage point) and compares three answers: the exact new price, the duration-only estimate and the duration-plus-convexity estimate. The chart draws all three from −300 to +300 bp.
Portfolio duration takes a list of holdings with their market values and modified durations. For a bond fund, use the duration from its factsheet.
The formulas
Modified duration Dmod = D ÷ (1 + y ÷ f)
DV01 = Dmod × P × 0.0001
Convexity C = Σ CFk × (tk2 + tk ÷ f) ÷ (1 + y ÷ f)f tk + 2 ÷ Ptk is the time to cash flow k in years, PV(CFk) its present value at the yield y, P the bond's price (including accrued interest) and f the coupons per year. Duration is in years and convexity in years squared.
Duration and convexity are the first two terms of a Taylor expansion of the price around the current yield:
A worked example
A $1,000 bond with a 4.5% semiannual coupon and 10 years to maturity yields 5%, which puts its price at $961.03.
Weighted by present value, its cash flows arrive on average after 8.117 years: that is the Macaulay duration. Dividing by 1.025 (one plus the yield per half-year) gives a modified duration of 7.919, so each basis point of yield moves the price by about $0.7611, or $761.05 per $1 million of face value. Convexity is 75.30.
Now let yields jump by 150 bp. Duration alone predicts a price change of -$114.16. Adding convexity gives -$106.02. Repricing the bond at 6.50% gives the exact change of -$106.42, so duration alone was off by $7.74 and duration plus convexity by only $0.40.
What makes duration longer or shorter
Duration grows with maturity and shrinks with the coupon, because a higher coupon returns more of the money sooner:
| Bond (yield 5%) | Macaulay duration | Modified duration | Convexity |
|---|---|---|---|
| 2 years, 4.5% coupon | 1.935 | 1.887 | 4.55 |
| 10 years, 4.5% coupon | 8.117 | 7.919 | 75.30 |
| 10 years, 8% coupon | 7.393 | 7.212 | 65.82 |
| 10 years, zero coupon | 10.000 | 9.756 | 99.94 |
| 30 years, 4.5% coupon | 16.189 | 15.795 | 364.86 |
A zero-coupon bond has a Macaulay duration exactly equal to its maturity, since it has only one payment. Every coupon bond’s duration is shorter than its maturity. Note also how slowly duration grows for long bonds: tripling the maturity from 10 to 30 years only about doubles the duration, because distant payments are worth little today. Convexity rises much faster, almost fivefold over the same step, which is why long bonds benefit most from it.
How good is the duration estimate?
Duration draws a straight line through a curve, so its error grows quickly with the size of the move:
| Yield move | Exact change | Duration only | Duration + convexity |
|---|---|---|---|
| −300 bp | +27.53% | +23.76% | +27.15% |
| −150 bp | +12.77% | +11.88% | +12.73% |
| −50 bp | +4.06% | +3.96% | +4.05% |
| +50 bp | -3.87% | -3.96% | -3.87% |
| +150 bp | -11.07% | -11.88% | -11.03% |
| +300 bp | -20.69% | -23.76% | -20.37% |
For moves of 50 bp, duration alone is close enough for most purposes. At 300 bp it misses by several percentage points, always in the same direction: it overstates losses and understates gains. Adding convexity removes most of that error. What remains comes from higher-order terms, which is why risk systems reprice bonds in full for stress tests.
Using DV01 to compare and hedge positions
Duration is a percentage; DV01 is money, which makes it the more practical number when positions differ in size or price. Two positions with the same DV01 gain or lose the same amount for a small parallel move in yields, whatever their maturities.
That is how rate hedges are sized. The 10-year bond in the example has a DV01 of $761.05 per $1 million. The 2-year bond in the table above has $186.97, so offsetting $1 million of the 10-year bond would take about four times as much face value of the 2-year; the 30-year bond, at $1,457.41, would need only about half as much. A hedge sized this way protects against parallel moves only. If the yield curve steepens or flattens, the two legs move by different amounts.
Portfolio duration
For a portfolio, weight each holding’s modified duration by its market value:
Portfolio DV01 = Σ MVi × Dmod,i × 0.0001
The example portfolio of $250,000 has a duration of 5.10 and a DV01 of $127.60. The table under the tool shows which holding carries the most rate risk; it is not always the largest one, because a small position in a long bond can contribute as much duration as a large position in a short one.
Matching duration to the date you need the money is the idea behind immunization: if a portfolio’s duration equals your horizon, a small parallel change in rates roughly balances price changes against reinvestment income.
What this calculator does not include
- Parallel shifts only. Duration assumes every yield moves by the same amount. When short and long rates move differently, key-rate durations give a better picture.
- Option-free bonds. Callable bonds, putable bonds and mortgage-backed securities need effective duration and convexity from a model that lets cash flows change with rates. Callable bonds can show negative convexity.
- Credit spreads. The yield change applies to the bond’s whole yield; spread duration is not separated from Treasury rate duration.
- Price between coupon dates. Duration and convexity use the dirty price, which is the standard convention; rate-shock changes are shown on that basis.
- The passage of time. Each result is an instant shock. As the bond ages, its duration shortens and its price is pulled toward par.