Bond Price & YTM Calculator — Duration and Convexity
Price a bond from its yield, solve yield-to-maturity from a price, and get Macaulay and modified duration, convexity, and DV01 with full cash-flow detail.
Bond Yield & Pricing Calculator
A clear path from inputs to results.
Built for bond investors, fixed-income analysts, and finance students who need to check a bond quote or understand its interest-rate risk. It prices any coupon or zero-coupon bond from a yield, inverts a market price back to yield-to-maturity, and reports Macaulay and modified duration, convexity, and DV01 alongside the full cash-flow schedule. Use it to decide whether a quoted price is rich or cheap against your own yield view, and how much the position moves for a given rate change.
How to use
- Pick the bond style: coupon bond or zero-coupon. Zero-coupon mode forces the coupon rate to zero so only the principal payment is discounted.
- Set the face value, coupon rate, maturity in years, and coupon frequency (1 to 12 payments per year) with the sliders.
- Enter the market yield to price the bond: each coupon plus principal is discounted at (1 + y/m)^k, and the cash-flow table shows every period, amount, discount factor, and present value.
- Enter the quoted clean price and any accrued interest; the solver inverts the pricing equation to recover the yield-to-maturity implied by that dirty price (clean plus accrued).
- Read the risk block: Macaulay and modified duration, convexity, DV01, current yield, and the premium or discount versus par.
- Use the matrix and 3D surface views to scan prices across coupon-yield combinations and maturities, and watch the integrity panel (model price minus dirty price) to confirm the yield solve converged.
The formula
Reference: Frank J. Fabozzi, Bond Markets, Analysis, and Strategies — present-value pricing of bonds and the measurement of duration and convexity.
Worked example
3-year, 5% annual-pay bond priced at a 6% yield
- Face value 100, coupon rate 5% paid annually (frequency 1x per year), maturity 3 years, market yield 6%, clean price 97, accrued interest 0.
- 1
The cash flows are 5 at t = 1, 5 at t = 2, and 105 at t = 3. Discounting each at 1.06^k gives 5/1.06 = 4.7170, 5/1.06^2 = 4.4500, and 105/1.06^3 = 88.1600, which sum to a price of 97.3270 per 100 of par. Macaulay duration is the PV-weighted average time: (1 x 4.7170 + 2 x 4.4500 + 3 x 88.1600) / 97.3270 = 2.8573 years. Modified duration divides by 1.06: 2.8573 / 1.06 = 2.6956. Convexity from the second derivative of price with respect to yield is 10.00. At this clean price the current yield is 5 / 97.327 = 5.14%.
Price 97.3270 per 100 of par (a discount, because the 6% yield exceeds the 5% coupon); Macaulay duration 2.8573 years; modified duration 2.6956; convexity 10.00.
Interpreting the result
A price below par means the market yield exceeds the coupon rate, and vice versa. Modified duration is the first-order percentage price change per unit change in yield: at 2.70, a one-percentage-point rise in yield cuts the price by roughly 2.70% before convexity. DV01 converts that into dollars: about 0.026 per 100 of face value here. Compare the solved yield-to-maturity with yields available on similar bonds to judge whether a quote is rich or cheap, and use duration and convexity to size the interest-rate risk you are accepting.
Assumptions & limitations
- Discrete compounding at the selected frequency: the periodic rate is y/m and discounting uses (1 + y/m)^k for k = maturity x m periods. Day-count conventions such as 30/360 or actual/365 are not modeled.
- A single flat yield discounts every cash flow; the yield curve is not modeled.
- The yield-to-maturity solve matches the model price to clean price plus accrued interest (the dirty price), assuming coupons fall exactly on the period grid with no settlement-date stubs.
- Duration, convexity, and DV01 are local approximations that are accurate only for small yield changes; DV01 is computed as your clean-price input times modified duration times 0.0001.
- No taxes, transaction costs, call features, credit spreads, or default risk: the bond is a fixed set of deterministic cash flows.
Frequently asked questions
Why does a bond price fall when yields rise?
Every term in the pricing sum is divided by (1 + y/m)^k, so each discounted cash flow shrinks as the yield grows, making price a strictly decreasing function of yield. The relationship is also convex: modified duration says a small yield rise of dy cuts the price by roughly D_mod x dy, and convexity cushions losses as yields climb. Long-maturity, low-coupon bonds have the largest durations and therefore the biggest price swings.
Why is yield-to-maturity solved numerically instead of with a formula?
Setting the price equal to the discounted cash-flow sum produces a polynomial of degree N in (1 + y/m), and polynomials beyond the fourth degree have no general closed-form solution. The calculator brackets the root and refines it with Newton steps backed by bisection, which converges to near machine precision in a few dozen iterations. That is also what lets it handle zero and negative yield inputs robustly.
What does DV01 tell me?
DV01 is the dollar change in a position value for a one-basis-point (0.01%) move in yield, approximated as clean price x modified duration x 0.0001. For a holding priced at 97.33 with modified duration 2.70, DV01 is about 0.026 per 100 of face value. Traders use it to size hedges: divide the DV01 you need to neutralize by the DV01 of the hedging instrument.
What is the difference between Macaulay and modified duration?
Macaulay duration is the present-value-weighted average time until the bond cash flows are received, measured in years. Modified duration divides it by (1 + y/m) and turns it into a price sensitivity: the percentage price change for a small yield move is approximately negative modified duration times the yield change. A modified duration of 2.70 means roughly a 2.7% price drop for a one-percentage-point yield rise, before convexity.
What is the difference between clean price, accrued interest, and dirty price?
The clean price is the quoted price excluding the interest earned since the last coupon date; accrued interest is that earned-but-unpaid amount; the dirty price is their sum and is what actually changes hands in a trade. The yield-to-maturity solver matches the model price to the dirty price, so entering accrued interest shifts the solved yield even though the clean quote is unchanged.
Does a zero-coupon bond have duration equal to its maturity?
Yes. With a single cash flow at maturity, the present-value-weighted average time to payment is exactly the maturity, so Macaulay duration equals T and modified duration is T / (1 + y/m). That makes zeros the most rate-sensitive bonds for a given maturity, which you can verify directly by switching the bond style selector to zero-coupon.
Methodology last reviewed 2026-10-06. Results are informational and not financial or engineering advice — see our disclaimer.