HomeInvesting & Real Estate › Bond Duration Calculator

Bond Duration Calculator

Prices a fixed-coupon bond from its yield to maturity and computes Macaulay duration, modified duration, convexity, DV01 and the estimated price change for a 1 percentage-point rise in yield.

When to use

You want to know how sensitive a bond's price is to interest-rate changes, or need duration and convexity for hedging or portfolio matching.

Do not use when: You know the price and want the yield (use bond-yield), or the bond is callable, floating-rate or amortizing. Informational only; not financial advice.

Formula

y = yield/m per period, n = years × m, C = face × coupon/m; P = Σ_{t=1..n} CF_t/(1+y)^t; D_mac = Σ t·PV_t / (P·m); D_mod = D_mac / (1 + y); convexity = Σ t(t+1)·PV_t / (P·(1+y)²·m²); ΔP/P ≈ −D_mod·Δy + ½·convexity·Δy²

Standard bond mathematics with level coupons at the end of each period and settlement on a coupon date (no accrued interest); the yield is nominal annual compounded m times a year. Informational mathematics only; not financial advice.

Inputs

ParameterTypeUnitRequiredDescription
face_valuenumberdefault 1000Amount repaid at maturity. Range: > 0, ≤ 1000000000000
coupon_rate_percentnumber% per yearyesAnnual coupon as a percent of face value. Range: ≥ 0, ≤ 100
yield_to_maturity_percentnumber% per yearyesNominal annual yield, compounded once per coupon period. Range: ≥ -10, ≤ 100
years_to_maturitynumberyearsyesTime until redemption; rounded to whole coupon periods. Range: > 0, ≤ 100
coupons_per_yearenum: annual | semiannual | quarterly | monthlydefault semiannualCoupon payment frequency (2 for US Treasuries and most corporates, 1 for many European bonds).

Outputs

OutputTypeUnitDescription
pricenumberPresent value of coupons and face value at the yield.
number_of_couponsintegerround(years_to_maturity × coupons per year).
macaulay_duration_yearsnumberyearsPV-weighted average time to each cash flow.
modified_duration_yearsnumberyearsMacaulay duration / (1 + y/m): percent price change per 1 unit (100 %) change in yield.
convexitynumberyears²Σ t(t+1)·PV_t / (P·(1 + y/m)²·m²).
dv01numbermodified_duration × price × 0.0001: price change per 0.01 % yield move.
price_change_for_1pct_yield_rise_percentnumber%−modified_duration × 1.
price_change_for_1pct_yield_rise_with_convexity_percentnumber%(−modified_duration × 0.01 + ½ × convexity × 0.01²) × 100.
current_yield_percentnumber%Annual coupon / price × 100.

Example

5 % annual coupon, 5 % yield, 3 years, face 1,000: {"face_value":1000,"coupon_rate_percent":5,"yield_to_maturity_percent":5,"years_to_maturity":3,"coupons_per_year":"annual"}{"price":1000,"number_of_coupons":3,"macaulay_duration_years":2.8594,"modified_duration_years":2.7232,"convexity":10.2056,"dv01":0.2723,"price_change_for_1pct_yield_rise_percent":-2.72,"price_change_for_1pct_yield_rise_with_convexity_percent":-2.67,"current_yield_percent":5}

6 % semiannual coupon, 8 % yield, 10 years: {"face_value":1000,"coupon_rate_percent":6,"yield_to_maturity_percent":8,"years_to_maturity":10,"coupons_per_year":"semiannual"}{"price":864.1,"number_of_coupons":20,"macaulay_duration_years":7.4543,"modified_duration_years":7.1675,"convexity":65.044,"current_yield_percent":6.94}

GET https://tttkmbb.com/api/v1/calculate/bond-duration?face_value=1000&coupon_rate_percent=5&yield_to_maturity_percent=5&years_to_maturity=3&coupons_per_year=annual

Machine access

Sources

FAQ

What is the difference between Macaulay and modified duration?

Macaulay duration is a weighted average time in years; modified duration divides it by (1 + y/m) and gives the percentage price change for a 1-point yield change, which is what risk managers use.

Why add convexity?

Duration is a straight-line estimate; the price-yield curve bends upward, so the duration-only estimate overstates losses when yields rise and understates gains when they fall. Convexity corrects part of that error.

Related calculators