Bond Duration Cash-Flow Visualizer
Macaulay duration is the present-value-weighted average time to receipt of a bond's cash flows. Rather than a single maturity date, think of a bond as a stream of payments that arrive at different times. Duration answers the question: if you had to represent all those payments by a single date, what would it be? Formally, for a bond with \(n\) cash flows:
$$D_{\text{Mac}} = \frac{\displaystyle\sum_{t=1}^{n} t \cdot \frac{CF_t}{(1 + y/m)^t}}{P}$$where \(CF_t\) is the cash flow at period \(t\), \(y\) is the yield to maturity, \(m\) is the coupon frequency, and \(P\) is the bond price. The numerator weights each time \(t\) by the present value of the cash flow received at that time; dividing by price gives a weighted average expressed in periods, then converted to years.
Modified duration is \(D_{\text{Mod}} = D_{\text{Mac}} / (1 + y/m)\). It measures the percentage price sensitivity to a small yield change: a 1 percentage-point rise in yield decreases the bond's price by approximately \(D_{\text{Mod}}\) percent.
The visualization
The bars show each cash flow as a fraction of the bond's total price (its present-value weight). Taller bars represent cash flows that matter more to the bond's current value. The orange dashed line marks the Macaulay duration — the literal "centre of gravity" of the cash-flow weights.
Bond Metrics
Modified duration: DMod = DMac / (1 + y/m)
Price sensitivity: ΔP ≈ −DMod × P × Δy (linear approximation)
Zero-coupon bond: DMac = maturity. Coupon bond: DMac < maturity.
Key takeaways
- Duration is not maturity. A coupon bond's duration is always shorter than its maturity because some cash flows arrive before the final repayment.
- Zero-coupon bonds are the exception. A zero-coupon bond has Macaulay duration exactly equal to its maturity because there is only one cash flow — the face value at maturity.
- Higher coupon rates shorten duration. Larger coupons shift the centre of gravity of cash flows earlier in time, reducing duration.
- Higher yields shorten duration. Discounting at a higher rate penalises distant cash flows more heavily, placing greater relative weight on near-term payments.
- Longer maturity increases duration, but with diminishing returns. At very long maturities (for coupon bonds) duration asymptotes — it does not grow without bound.