Bond YTM calculator
A 1,000 bond with a 5% coupon, bought at 950 with 10 years left, yields 5.668718% to maturity, above its coupon because you also collect the 50 discount. Enter face, coupon, price, years and coupons per year. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Face value
- 1,000
- Coupon rate
- 5
- Price
- 950
- Years
- 10
- Frequency
- 1
- Periods
- 10
- Coupon payment
- 50
- Annual coupon
- 50
Yield to maturity is the single constant annualized discount rate that makes a bond's remaining coupons and its redeemed face value equal the price you would pay today. Traders, advisors, and students ask for that rate whenever a quoted price sits away from par: a discount bond must yield more than its coupon, a premium bond less, and a zero-coupon bond's entire return is the pull to face. This bond yield to maturity calculator accepts face value, annual coupon rate as a percent, current market price, and years remaining to maturity, then solves the standard present-value identity for the annualized yield.
What yield to maturity means and how the cash-flow identity is solved
Yield to maturity is the constant internal rate of return earned by buying a fixed-coupon bond at today's price and holding it to redemption, reinvesting every coupon at that same rate. It is the unique annualized discount rate that equates the present value of remaining coupon payments plus face value at maturity to the current market price.
With annual coupons the identity is price equals the coupon annuity C times one minus one plus y to the minus n, all over y, plus face divided by one plus y to the n. When coupons arrive m times per year the same identity is written in period units: the period coupon equals the annual coupon divided by m, the period count N equals years times m, and the period rate r satisfies the discounted cash-flow sum.
The annualized yield this calculator returns is r times m, the bond-equivalent nominal quote used on most term sheets. A bond trading below face has a yield above its coupon rate; a bond trading above face has a yield below its coupon rate; a bond at par has a yield equal to its coupon rate. A zero-coupon bond is the special case C equals zero, so the closed form is r equals face over price to the one over N, minus one.
Because price falls as yield rises, the map is strictly monotone for ordinary nonnegative coupons and a positive face, so the solver has exactly one economically meaningful root greater than minus one hundred percent per period.
What you enter and what you get back
Optional frequency defaults to one for annual coupons and must be one, two, four, or twelve. Optional decimals is an integer from zero through twelve (default six) controlling half-up rounding on numeric outputs. Example: face one thousand, five percent coupon, price nine hundred fifty, ten years, annual frequency yields a discount bond whose annualized YTM sits above five percent because the buyer also earns the pull from nine hundred fifty up to par.
Price and years are the two fields the product contract singles out: a zero or negative price or maturity is never silently replaced with an absolute value or a default tenor.
Where a bond yield to maturity calculator earns its keep
Wealth advisors and treasury desks use the same figure when a client asks whether a premium municipal or a discount corporate is the cheaper hold once the pull to par is included, not just the current coupon over price. Educators and LMS platforms need a deterministic oracle for fixed-income homework that asks students to back out y from P, C, F, and n without a full Bloomberg terminal, including the zero-coupon closed form and the par-bond identity that yield equals the coupon rate.
Content teams can contrast current yield with true YTM on a discount bond so readers see why the simple coupon-over-price shortcut understates the return when the bond also accretes to face. Failed validation does not consume balance. Keep price and years strictly positive, pin the rounded yield fields in tests, and you get reproducible annualized YTMs for widgets, classrooms, and production without standing up a fixed-income library of your own.
What you can do with it
Quoted-price hold-to-maturity checks
Turn a broker dirty price, face, coupon, and remaining years into the annualized YTM a buyer actually earns if the bond is held to redemption.
Discount versus premium comparison
Compare a bond below par with one above par on true yield to maturity, not just current yield, before choosing which coupon structure to hold.
Fixed-income homework and LMS keys
Mark problems that ask students to solve for y in the bond price identity, including zero-coupon and par-bond special cases, with a deterministic oracle.
FAQ
How is bond yield to maturity calculated?
YTM is the annualized rate y that solves P = Σ C/(1+r)^k + F/(1+r)^N, where C is the period coupon, N is years times frequency, r is the period yield, and y = r × frequency. The calculator uses Newton–Raphson with a bisection fallback.
What is the difference between YTM and current yield?
Current yield is only the annual coupon divided by today's price. YTM also includes the gain or loss as the price accretes or amortizes to face at maturity, so a discount bond's YTM is higher than its current yield.
Can I model a zero-coupon bond or a par bond?
If price equals face on a coupon bond, YTM equals the coupon rate.
Can I calculate yield to maturity for bonds with semiannual or monthly coupons?
Yes. Choose 1, 2, 4 or 12 coupon payments a year. The yield is worked out per payment period and then multiplied by the number of payments, which gives the annual figure quoted on most term sheets.
Does the YTM calculator look up live bond prices?
No. It solves the yield from the price you enter, so use the quote from your broker or term sheet. It does not apply day-count calendars or credit spreads, which keeps the result the same every time for the same inputs.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/fin/bond-ytm \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"face_value":1000,"coupon_rate":5,"price":950,"years":10}'const res = await fetch("https://api.kit.forhosting.com/fin/bond-ytm", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"face_value": 1000,
"coupon_rate": 5,
"price": 950,
"years": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/fin/bond-ytm",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"face_value": 1000,
"coupon_rate": 5,
"price": 950,
"years": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/fin/bond-ytm", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"face_value":1000,"coupon_rate":5,"price":950,"years":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"face_value":1000,"coupon_rate":5,"price":950,"years":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/fin/bond-ytm", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"face_value": 1000,
"coupon_rate": 5,
"price": 950,
"years": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "fin.bond_ytm",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Price or years that are not positive fail with invalid_input instead of inventing a rate.
What yield to maturity means and how the cash-flow identity is solved
This endpoint does not fetch live quotes, day-count calendars, or credit spreads; it solves the cash-flow identity you supply so homework keys, landing-page widgets, and automation share one auditable number.
Input contract, response shape, and error behaviour
POST a JSON body with four required finite numbers: face_value greater than zero (aliases face, par, and par_value); coupon_rate as an annual percent such as five for five percent, finite and at least zero so a true zero-coupon bond is allowed (aliases coupon_rate_percent and coupon); price, the current market dirty price in the same currency, which must be greater than zero (aliases current_price and market_price); and years remaining to maturity, which must be greater than zero and at most two hundred (aliases years_to_maturity and n). On success the body echoes the inputs and adds periods (years times frequency), coupon_payment per period, annual_coupon, ytm as a decimal, ytm_percent, current_yield_percent (annual coupon over price), premium_discount (price minus face), and a formula string restating the cash-flow identity. Missing fields, non-finite values, a non-positive face, price, or years, a negative coupon_rate, or an invalid frequency fail with invalid_input naming the field and are not billed.
Where a bond yield to maturity calculator earns its keep
Integrators wire the endpoint into notebooks, n8n flows, or edge workers to pin goldens whenever a pricing spreadsheet changes.
Technical questions
What happens if price or years are not positive?
The task fails with invalid_input. A zero or negative market price or remaining maturity is not a well-posed discounting problem, so no yield is invented and the call is not billed.
What does the bond YTM calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.