Calculate the current market price of a bond based on its coupon payments, face value, yield to maturity, and time to maturity.
Calculated Bond Price
—
Understanding Bond Pricing
Bonds are debt instruments where an issuer owes the holders a debt and is obliged to pay interest (the coupon) and to repay the principal at a later date (the maturity). The price of a bond is not static; it fluctuates in the secondary market based on various economic factors, primarily changes in interest rates.
The price of a bond is essentially the present value of all its future cash flows. These cash flows consist of two parts:
Coupon Payments: Periodic interest payments made to the bondholder.
Face Value (Par Value): The principal amount repaid to the bondholder at maturity.
The discount rate used to calculate the present value of these future cash flows is the investor's required rate of return, often represented by the Yield to Maturity (YTM).
The Bond Pricing Formula
The price of a bond can be calculated using the following formula:
In practice, this is often broken down into the present value of an ordinary annuity (for the coupon payments) and the present value of a lump sum (for the face value).
Periodic Coupon Payment (C) = (Annual Coupon Rate * Face Value) / Coupon Frequency
Periodic Yield to Maturity (r) = Annual Yield to Maturity / Coupon Frequency
Total Number of Periods (n) = Years to Maturity * Coupon Frequency
The formula can be expressed as:
Bond Price = C * [1 - (1 + r)^-n] / r + FV / (1 + r)^n
Interpreting the Results
Bond Price = Face Value: This occurs when the coupon rate equals the YTM. The bond is trading at par.
Bond Price < Face Value: This happens when the YTM is higher than the coupon rate. Investors demand a higher return than the coupon payments provide, so the bond sells at a discount to attract buyers.
Bond Price > Face Value: This occurs when the YTM is lower than the coupon rate. The bond's coupon payments are more attractive than the current market rates, so investors are willing to pay a premium for it.
This calculator helps investors quickly assess the fair value of a bond in the secondary market, crucial for making informed investment decisions.
function calculateBondPrice() {
var faceValue = parseFloat(document.getElementById("faceValue").value);
var couponRate = parseFloat(document.getElementById("couponRate").value);
var yieldToMaturity = parseFloat(document.getElementById("yieldToMaturity").value);
var yearsToMaturity = parseFloat(document.getElementById("yearsToMaturity").value);
var couponFrequency = parseInt(document.getElementById("couponFrequency").value);
var resultElement = document.getElementById("result-value");
resultElement.textContent = "–"; // Reset result
// Input validation
if (isNaN(faceValue) || faceValue <= 0 ||
isNaN(couponRate) || couponRate < 0 ||
isNaN(yieldToMaturity) || yieldToMaturity < 0 ||
isNaN(yearsToMaturity) || yearsToMaturity <= 0 ||
isNaN(couponFrequency) || couponFrequency 0. A common approach when r=0 is to sum PV of coupons.
// For practical financial calculators, YTM=0 is often an edge case that might return FV or indicate an issue.
// Let's sum the PV of coupons individually if periodicYield is 0
for (var i = 1; i <= numberOfPeriods; i++) {
bondPrice += periodicCouponPayment;
}
bondPrice += faceValue; // Add the face value at maturity
} else {
// Calculate Present Value of Annuity (Coupon Payments)
var pvAnnuity = periodicCouponPayment * (1 – Math.pow(1 + periodicYield, -numberOfPeriods)) / periodicYield;
// Calculate Present Value of Face Value
var pvFaceValue = faceValue / Math.pow(1 + periodicYield, numberOfPeriods);
// Total Bond Price
bondPrice = pvAnnuity + pvFaceValue;
}
// Display the result, formatted to two decimal places
resultElement.textContent = "$" + bondPrice.toFixed(2);
}