function calculateDTI() {
// Get Inputs
var annualIncome = parseFloat(document.getElementById('annualIncome').value);
var rentMortgage = parseFloat(document.getElementById('rentMortgage').value);
var carLoan = parseFloat(document.getElementById('carLoan').value);
var studentLoan = parseFloat(document.getElementById('studentLoan').value);
var creditCards = parseFloat(document.getElementById('creditCards').value);
var otherDebt = parseFloat(document.getElementById('otherDebt').value);
// Validation: Check if income is valid
if (isNaN(annualIncome) || annualIncome <= 0) {
alert("Please enter a valid Gross Annual Income greater than zero.");
return;
}
// Handle empty debt fields as 0
if (isNaN(rentMortgage)) rentMortgage = 0;
if (isNaN(carLoan)) carLoan = 0;
if (isNaN(studentLoan)) studentLoan = 0;
if (isNaN(creditCards)) creditCards = 0;
if (isNaN(otherDebt)) otherDebt = 0;
// Calculations
var monthlyIncome = annualIncome / 12;
var totalMonthlyDebt = rentMortgage + carLoan + studentLoan + creditCards + otherDebt;
var dtiRatio = (totalMonthlyDebt / monthlyIncome) * 100;
var finalDTI = dtiRatio.toFixed(2);
// Display Logic
var resultDiv = document.getElementById('dtiResult');
var percentDisplay = document.getElementById('dtiPercentDisplay');
var statusDisplay = document.getElementById('dtiStatusDisplay');
var messageDisplay = document.getElementById('dtiMessage');
resultDiv.style.display = 'block';
percentDisplay.innerHTML = finalDTI + "%";
// Logic for Tiered Results
if (dtiRatio 36 && dtiRatio 43 && dtiRatio <= 50) {
statusDisplay.className = "dti-status status-warning";
statusDisplay.innerHTML = "High Risk";
messageDisplay.innerHTML = "Your DTI is higher than the standard 43% cutoff for many Qualified Mortgages. You may still find lenders, but you might face higher interest rates or stricter down payment requirements.";
} else {
statusDisplay.className = "dti-status status-bad";
statusDisplay.innerHTML = "Critical";
messageDisplay.innerHTML = "With a DTI over 50%, borrowing options are severely limited. Lenders view this as a high risk of default. Focus on aggressive debt repayment or increasing income before applying for new credit.";
}
}
Understanding Your Debt-to-Income (DTI) Ratio
Your Debt-to-Income (DTI) ratio is one of the most critical metrics lenders use to assess your financial health. Unlike your credit score, which measures your history of paying debts, your DTI measures your capacity to repay new debt based on your current income.
What is a Good DTI Ratio?
While requirements vary by lender and loan type, here are the general benchmarks used in the financial industry:
36% or Less (Ideal): This is the "gold standard." Most of your income is free for savings and living expenses. You represent a low risk to lenders.
36% to 43% (Acceptable): This is often the maximum range for a Qualified Mortgage. You are still a good candidate, but you have less wiggle room in your monthly budget.
43% to 50% (High Risk): Some FHA loans or specialized lenders may approve you, but you will likely face higher interest rates and scrutiny.
Above 50% (Critical): At this level, more than half your gross income goes to debt. It is very difficult to qualify for a mortgage until this number is reduced.
Front-End vs. Back-End Ratio
There are actually two types of DTI ratios that mortgage lenders look at:
Front-End Ratio: This only calculates your housing costs (mortgage, insurance, property taxes) divided by your gross income. Lenders typically prefer this to be under 28%.
Back-End Ratio: This includes housing costs plus all other monthly debt payments (credit cards, student loans, car notes). This is what the calculator above computes. Lenders typically prefer this to be under 36% (the "28/36 rule").
How to Lower Your DTI
If your calculation shows a high percentage, you can lower it by attacking the equation from both sides:
Reduce Debt: Focus on paying off debts with high monthly payments first. Even if the total balance is lower, eliminating a $300/month car payment impacts your DTI more than paying down a credit card with a $25 minimum payment.
Increase Income: Since DTI is based on gross (pre-tax) income, a raise, a second job, or a side hustle can immediately improve your ratio, making you more attractive to lenders.
Disclaimer: This calculator is for educational purposes only and does not constitute a loan approval or financial advice. Consult with a qualified loan officer for specific lending requirements.