function calculateTrackerMortgage() {
// 1. Get Input Values
var balance = document.getElementById("mortgageBalance").value;
var termYears = document.getElementById("mortgageTerm").value;
var baseRate = document.getElementById("baseRate").value;
var margin = document.getElementById("trackerMargin").value;
var resultDiv = document.getElementById("trackerResult");
// 2. Validation
if (balance === "" || termYears === "" || baseRate === "" || margin === "") {
alert("Please fill in all fields correctly.");
return;
}
var P = parseFloat(balance);
var years = parseFloat(termYears);
var base = parseFloat(baseRate);
var trackMargin = parseFloat(margin);
if (isNaN(P) || isNaN(years) || isNaN(base) || isNaN(trackMargin) || P <= 0 || years <= 0) {
alert("Please enter valid positive numbers for balance and term.");
return;
}
// 3. Calculation Logic
// Effective Rate Calculation
var effectiveRatePercent = base + trackMargin;
if (effectiveRatePercent < 0) effectiveRatePercent = 0; // Handle negative rates unlikely but possible math
// Monthly Payment Calculation (Amortization)
// Formula: M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1 ]
// i = monthly interest rate (annual / 12 / 100)
// n = total months
var monthlyRate = (effectiveRatePercent / 100) / 12;
var totalMonths = years * 12;
var monthlyPayment = 0;
var totalRepayment = 0;
var totalInterest = 0;
if (monthlyRate === 0) {
monthlyPayment = P / totalMonths;
} else {
monthlyPayment = (P * monthlyRate * Math.pow(1 + monthlyRate, totalMonths)) / (Math.pow(1 + monthlyRate, totalMonths) – 1);
}
totalRepayment = monthlyPayment * totalMonths;
totalInterest = totalRepayment – P;
// 4. Stress Test Logic (Base Rate + 1%)
var stressBase = base + 1.0;
var stressRatePercent = stressBase + trackMargin;
var stressMonthlyRate = (stressRatePercent / 100) / 12;
var stressPayment = 0;
if (stressMonthlyRate === 0) {
stressPayment = P / totalMonths;
} else {
stressPayment = (P * stressMonthlyRate * Math.pow(1 + stressMonthlyRate, totalMonths)) / (Math.pow(1 + stressMonthlyRate, totalMonths) – 1);
}
// 5. Update UI
document.getElementById("displayRate").innerHTML = effectiveRatePercent.toFixed(2) + "%";
document.getElementById("displayMonthly").innerHTML = "£" + monthlyPayment.toLocaleString('en-GB', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById("displayTotal").innerHTML = "£" + totalRepayment.toLocaleString('en-GB', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById("displayInterest").innerHTML = "£" + totalInterest.toLocaleString('en-GB', {minimumFractionDigits: 2, maximumFractionDigits: 2});
// Stress Test UI
document.getElementById("stressRate").innerHTML = stressRatePercent.toFixed(2) + "%";
document.getElementById("stressPayment").innerHTML = "£" + stressPayment.toLocaleString('en-GB', {minimumFractionDigits: 2, maximumFractionDigits: 2});
resultDiv.style.display = "block";
}
Understanding Tracker Rate Mortgages
A tracker mortgage is a type of variable rate mortgage where the interest rate you pay is directly linked to an external economic indicator—typically the Bank of England Base Rate. Unlike fixed-rate mortgages, where your payments remain static for a set period, a tracker rate moves up and down in line with the base rate.
How Tracker Rates Are Calculated
The formula for a tracker mortgage is straightforward but dynamic. It consists of two parts:
The Base Rate: This is the variable component (e.g., the Bank of England Base Rate).
The Margin: This is a fixed percentage set by your lender (e.g., +0.5%).
For example, if the Base Rate is 5.25% and your product has a margin of +0.5%, your effective interest rate is 5.75%. If the central bank raises rates by 0.25%, your mortgage rate immediately increases to 6.00%, raising your monthly repayment.
Benefits of a Tracker Mortgage
Borrowers often choose tracker rates for transparency. Because the rate only changes when the Base Rate changes, you are not subject to the lender's discretionary Standard Variable Rate (SVR). Additionally, when the economy slows and Base Rates are cut, tracker mortgage holders see an immediate reduction in their monthly payments.
Risks to Consider
The primary risk is uncertainty. Budgeting can be difficult because your monthly outgoings can change with little notice following a central bank announcement. This Tracker Rate Calculator includes a "Stress Test" feature to help you visualize what your payments would look like if the Base Rate were to increase by 1%, allowing you to plan for financial resilience.
Tracker Rate vs. Fixed Rate
While a fixed rate offers security and predictable budgeting, it can often be slightly more expensive initially than a tracker rate to account for the lender's risk. A tracker rate typically has no cap on how high it can go (unless specifically stated as a "capped tracker"), meaning in a high-inflation environment, costs can escalate significantly compared to locking in a fixed deal.
Using This Calculator
To use the calculator above, input your remaining mortgage balance and the remaining term of your loan. Enter the current Bank of England Base Rate and the specific "margin" or "spread" listed on your mortgage offer documents. The tool will calculate your current monthly obligation and total interest payable over the life of the loan.