If an investor purchases a bond and holds it until maturity, his return will be equal to the yield to maturity (YTM). On the other hand, if the investor does not hold the bond until maturity (a common practice for long-term bonds), the total return will be equal to the yield over the length of holding, or the holding period return. Due to uncertainty about interest rate fluctuations and holding period duration, the holding period return can be more difficult to calculate than YTM.

### Yield to Maturity

Yield to maturity reflects the yield an investor receives for holding a bond until it matures. The formula for calculating YTM is long and complex, but if done correctly, it should account for the present value of the bond's remaining coupon payments.

YTM is different from standard yield calculations because it adjusts for the time value of money. Since inverting time value of money values requires a lot of trial and error, YTM is best left for programs designed for that purpose.

### Holding Period Return

Bond investors are not obligated to take an issuer's bond and hold it until maturity. There is an active secondary market for bonds. This means that someone could buy a 30-year bond that was issued 12 years ago, hold it for a five-year period, then sell it again. In such a circumstance, the bondholder doesn't care what the yield of the 12-year old bond will be until it matures 18 years later. If he holds the bond for five years, he only cares what yield he will earn between years 12 and 17.

The bondholder ought to attempt to calculate the bond's five-year holding period return. This can be approximated by slightly modifying the YTM formula. The bondholder can substitute the sale price for the par value and change the term to equal the length of the holding period.