Bond price, yield and duration calculator (YTM)
Enter a bond's face value, coupon and years to maturity. Turn a yield into a price, Macaulay and modified duration and the price after a one-point move, or turn a price into the yield to maturity.
Prefilled with: the YTM post's fictional 7% five-year bond bought at ₹960 (no real bond).
What it does
A bond’s price and its yield are the same fact said two ways. Enter the face value, the coupon and the years to maturity. Then either give a yield and see the price, the duration and what a one-point move in yields does to the price, or give a price and see the yield to maturity it implies.
It starts from the YTM post’s fictional bond: ₹1,000 face value, a 7% coupon, five years, bought at ₹960. Reset to the post’s example puts those back.
The formula
Price = Σ coupon / (1 + y)^t + face / (1 + y)^n
Macaulay duration = Σ t × PV(cash flow t) / Price
Modified duration = Macaulay duration / (1 + y)
There is no closed form for the yield given a price, so the calculator searches for the rate that makes the discounted cash flows equal the price.
What it leaves out
One annual coupon and whole years, as in the posts; Indian government bonds usually pay half-yearly, so a real bond’s figures differ a little. Price excludes accrued interest, tax, charges and any call or put feature. Modified duration is a straight-line estimate, which is why it misses the actual price change a little for larger moves. The calculator is arithmetic on a bond you type in. It doesn’t say whether any real bond is worth buying.
How it works
The method, step by step, with the worked example this tool reproduces: YTM: what a bond actually pays if you hold it to the end.