Article — Yield to Maturity (YTM) Calculator
Yield to maturity calculator: solve for the total return on a bond
Yield to maturity is the discount rate that sets the present value of a bond's coupons and final principal equal to its current price. A 10-year $1,000 bond paying a 5% semi-annual coupon, bought today at $950, has a YTM of about 5.67% — the coupon plus the gradual recovery of the $50 discount. YTM is the bond market's version of the internal rate of return, and it is the single most-quoted yield in fixed income.
The calculator solves for YTM with Newton-Raphson iteration. Below: where the formula comes from, how the three common yields differ, and why headline YTM rarely matches the return investors actually realise.
What is yield to maturity?
Yield to maturity is the annualised return an investor earns on a bond bought at today's market price and held all the way to maturity, assuming every coupon is reinvested at the same rate. It is one number that combines coupon income, the capital gain or loss between price and par, and the time value of money.
For a bond at par, YTM equals the coupon rate. Elsewhere they diverge. A 5% coupon bond at $1,050 has YTM below 5% (overpaying by $50, only $1,000 back at maturity). The same bond at $950 yields above 5% (the $50 discount is recovered over the life).
The US Treasury market quotes prices and yields on a semi-annual coupon basis by convention. A "4.50% 10-year Treasury" pays $22.50 every six months on a $1,000 face value bond, not $45 once a year. That convention matters: a 5% nominal YTM with semi-annual compounding is 5.0625% as an effective annual rate.
The yield to maturity formula
The bond price equation states that price equals the present value of all coupon payments plus the present value of the face amount:
P = sum[ C/2 / (1+y/2)^t ] + F / (1+y/2)^(2n)P = market price F = face valueC = annual coupon $ y = YTM (annualised)That equation has no closed-form solution beyond one period — y appears inside an exponent and a geometric sum simultaneously. The calculator iterates: pick a guess, compute the implied price, adjust y until the implied price matches the market price.
An approximation accurate to about 0.1 percentage points for bonds near par: YTM ≈ (annual coupon + (face − price) / years) ÷ ((face + price) / 2). For the default $950 bond, (50 + 5) / 975 = 5.64%, close to the iterative 5.67%.
YTM vs coupon rate vs current yield
Three numbers describe the income from a bond, and they are routinely confused. The coupon rate is the stated interest, fixed at issuance. The current yield is the annual coupon divided by today's price. YTM is the total annualised return until maturity. For a discount bond, coupon rate < current yield < YTM. For a premium bond, the order reverses.
YTM for the same bond is 5.67%. The 0.41 pp gap is the annualised value of recovering the $50 discount over 10 years. Confusing current yield with YTM is the most common error in newsroom bond coverage.
Premium, par, and discount bonds
A bond's price relative to par puts it into one of three categories, each with a predictable yield ordering. The categories are not labels — they are arithmetic consequences of the bond pricing equation.
- Premium bond: price > face. YTM < current yield < coupon rate. Buyer pays extra, loses some at maturity.
- Par bond: price = face. YTM = current yield = coupon rate. The trivial case.
- Discount bond: price < face. YTM > current yield > coupon rate. Buyer pays less, gains at maturity.
- Zero-coupon bond: no coupons, only a final principal payment. YTM has a closed form: y = (F/P)^(1/n) − 1.
- Why premiums exist: market yields have fallen since issuance, so the old high coupon is worth more than current rates.
- Why discounts exist: market yields have risen since issuance, so the old low coupon needs a price discount to compete.
The Newton-Raphson YTM solver
The bond pricing equation is non-linear in y, so the calculator uses Newton-Raphson iteration. The method picks a starting estimate (the approximate-YTM formula above), computes the implied price at that yield, computes the derivative of price with respect to yield, and steps toward the true answer. Each iteration roughly doubles the number of correct digits.
For nearly all coupon bonds, the solver converges in three to six iterations to within a billionth of a dollar. The hard cases — deep premiums, very short tenors, or near-zero yields — sometimes need a smaller initial step. The implementation here caps at 200 iterations and falls back to a half-step if Newton overshoots.
The derivative used is the negative of modified duration times price — no coincidence, since duration is the percentage price change per percentage-point yield change.
YTM and interest rate risk
YTM tells you the return if rates do not move. Most of the time, they do. When market yields rise, bond prices fall — an existing 5% coupon bond becomes less attractive next to new bonds offering 6%, so its price must drop until its YTM matches the new market level. The mechanism is purely arithmetic, set by the same pricing equation that defines YTM.
Modified duration measures the sensitivity. A 10-year bond at par typically has duration around eight years — a 100 basis-point rise cuts the price by roughly 8%. A 2-year note moves about 1.9% for the same shock.
YTM assumes you hold to maturity and reinvest every coupon at the same rate. Sell early and you may realise more or less depending on where rates have moved. Spend the coupons rather than reinvesting and your actual realised return drops below the headline YTM — sometimes substantially over a long holding period.
Assumptions and limits of YTM
YTM is a useful summary statistic, but it carries several baked-in assumptions worth keeping in mind. The bond is held to maturity, every coupon is reinvested at the YTM itself, and the issuer makes every payment in full and on time. None of those is guaranteed in practice.
For callable bonds, YTM understates risk. If rates fall, the issuer redeems early and the investor loses high-yield future coupons. Yield to call (YTC) and yield to worst (YTW) handle these cases. Mortgage-backed securities carry similar prepayment risk.
Common YTM mistakes
The most common error is annualisation confusion. US bond quotes use a nominal annual yield based on the per-period rate times the number of periods per year. So a semi-annual yield of 2.5% per period is quoted as "5%" YTM, not 5.0625%. Software that compounds the per-period rate into an effective annual yield will produce slightly different numbers. Both are correct; they answer different questions.
A second mistake is comparing YTMs across maturities without thinking about duration. A 30-year bond at 5% is far more rate-sensitive than a 2-year bond at 4.8%. The yield curve slopes up to price that risk. The third mistake is treating YTM as guaranteed when it is conditional on assumptions that rarely all hold.