Bond Yield & Duration Calculator

Bond Yield & Duration Calculator

Compute yield-to-maturity, price, duration, convexity, and accrued interest. Runs entirely in your browser — no data leaves this page.

Enter a bond, then click Compute. The result will appear here.

Examples

About Bond Yield & Duration Calculator

A bond's price and yield are two sides of the same coin: the yield is the discount rate that makes the present value of all future cash flows equal to the observed price, and the price is the present value of the same cash flows at a known yield. This tool lets you move freely between the two views and computes the standard interest-rate sensitivity numbers (Macaulay, modified, effective duration, and convexity) that fixed-income professionals use to size the price impact of a rate move.

The five modes

  • YTM — solves yield-to-maturity from a market price using Newton-Raphson with bisection fallback. Use this when you have a price (e.g., a Bloomberg quote or a broker statement) and want to know the implicit yield.
  • Price from Yield — the inverse: given a yield, compute the clean (flat) and dirty (invoice) price. Use this to build a price ladder across yields.
  • Duration — Macaulay (time-weighted cash-flow average in years), modified (the linear price sensitivity per 1bp), and effective (the actual price change for a ±10bp shock, useful for bonds with embedded options).
  • Convexity — the second-derivative price sensitivity. Combined with duration, it gives the standard duration+convexity price estimate for a parallel yield shock.
  • Accrued Interest — the interest accumulated since the last coupon date, for any selected day-count convention. The foundation of the dirty price (clean + accrued).

Day-count conventions

A day-count convention is a standardized way to count days and years in the accrued-fraction and year-fraction calculations. The three conventions supported here are the three most common for retail bond math:

  • 30/360 (Bond Basis) — the US corporate bond convention. Each month is treated as 30 days, each year as 360. End-of-month rules apply.
  • Actual/Actual (ISDA) — counts the actual calendar days, and the year fraction is the sum of per-year fractions split at calendar-year boundaries. Used by US Treasuries and most international government bonds.
  • Actual/360 — actual days over 360. The money-market convention (US Treasury bills, commercial paper).

Zero-coupon and perpetuals

The tool handles two special cases that show up in every fixed-income curriculum:

  • Zero-coupon bond — coupon rate is 0%, only the face value is paid at maturity. The Macaulay duration equals time-to-maturity; the modified duration is shorter by the (1+y/freq) factor. Try the "Zero-coupon 5y" preset to see this in action.
  • Perpetual — a bond with no maturity that pays coupons forever. Enable the "Treat as perpetuity" checkbox in the Advanced disclosure; the tool switches to the closed-form price = coupon / yield and Macaulay duration = (1+y/freq)/y. The cash-flow display is truncated at 50 years for visualization, but the math uses the exact perpetuity formula.

The solver

The YTM solver uses Newton-Raphson (3–7 iterations from a good initial guess) with bisection fallback when Newton diverges, when the derivative is non-positive, or when the price is outside the bracketed range. You can configure the search bracket in the Advanced disclosure (defaults: −99% to +1000%), which covers every economically meaningful bond. If no yield exists in the bracket, the tool reports a localized error naming the active range so you can widen it.

Common use cases

  • Verifying a broker's quoted yield against the published price.
  • Computing the price impact of a 100bp rate shock on a portfolio position.
  • Comparing the implied yield of two bonds with different coupon rates but similar maturities.
  • Understanding the relationship between clean and dirty price (and how accrued interest accrues daily).
  • Teaching or learning the standard fixed-income formulas without the overhead of a Bloomberg terminal.

Yield unit toggle

The yield field accepts either percent (e.g., 7 for 7%) or decimal (e.g., 0.07 for 7%). The active unit is part of the share-link state, so a permalink captures both the inputs and the unit. The YTM result is always shown in both units regardless of which one you typed.

Educational only. Not investment advice.

All computation runs in the browser. No bond inputs, prices, or yields are sent to any server. The tool does not roll settlement or coupon dates to business days — real-world settlement follows the bond's business-day calendar (e.g., NYSE for US Treasuries, TARGET2 for European bonds). Verify any trading decision with your broker before execution.

Comments

Please accept the "Functionality" cookie category to view and post comments.