function calculateDTI() {
// Get input values
var grossAnnual = parseFloat(document.getElementById("grossAnnualIncome").value) || 0;
var housing = parseFloat(document.getElementById("monthlyHousing").value) || 0;
var cards = parseFloat(document.getElementById("creditCards").value) || 0;
var auto = parseFloat(document.getElementById("autoLoans").value) || 0;
var student = parseFloat(document.getElementById("studentLoans").value) || 0;
var other = parseFloat(document.getElementById("otherDebts").value) || 0;
// Basic validation
if (grossAnnual <= 0) {
alert("Please enter a valid Gross Annual Income greater than zero.");
return;
}
// Calculations
var monthlyGross = grossAnnual / 12;
var totalMonthlyDebt = housing + cards + auto + student + other;
var dtiRatio = (totalMonthlyDebt / monthlyGross) * 100;
var disposable = monthlyGross – totalMonthlyDebt;
// Update UI
document.getElementById("resultBox").style.display = "block";
document.getElementById("dtiOutput").innerHTML = dtiRatio.toFixed(2) + "%";
document.getElementById("monthlyIncomeResult").innerHTML = "$" + monthlyGross.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById("monthlyDebtResult").innerHTML = "$" + totalMonthlyDebt.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById("disposableResult").innerHTML = "$" + disposable.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
// Determine Status Color and Message
var statusEl = document.getElementById("dtiStatus");
var dtiVal = document.getElementById("dtiOutput");
statusEl.className = "status-indicator"; // reset classes
if (dtiRatio 36 && dtiRatio <= 43) {
statusEl.classList.add("status-warning");
statusEl.innerHTML = "Good/Fair: You may qualify, but lenders might check closer.";
dtiVal.style.color = "#856404";
} else {
statusEl.classList.add("status-bad");
statusEl.innerHTML = "High Risk: You may have difficulty securing new credit.";
dtiVal.style.color = "#dc3545";
}
}
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 and ability to repay borrowed money. Unlike your credit score, which tracks your payment history, your DTI measures your current capacity to manage monthly payments relative to your gross income.
Lenders, specifically mortgage underwriters, use DTI to determine risk. A lower DTI indicates that you have sufficient income to cover your debts plus potential new loan payments. A high DTI suggests that you might be overextended, increasing the likelihood of default if your financial situation changes.
Most lenders have strict cut-off points:
36% or less: Considered ideal. Most lenders view borrowers in this range as low-risk.
37% to 43%: Manageable. You will likely qualify for loans, though terms might be slightly less favorable.
43% to 50%: The "danger zone" for many Qualified Mortgages. Some FHA loans allow this, but conventional loans may be denied.
Above 50%: High risk. Obtaining financing becomes significantly difficult without a co-signer or substantial assets.
Front-End vs. Back-End Ratio
When applying for a mortgage, lenders actually look at two different DTI numbers:
Front-End Ratio (Housing Ratio): This only calculates your housing costs (principal, interest, taxes, insurance, and HOA fees) divided by your gross income. Lenders typically prefer this to be under 28%.
Back-End Ratio (Total Debt): This is the number calculated above. It includes housing costs plus all other minimum debt payments (credit cards, student loans, car loans). Lenders prefer this to be under 36% (known as the 28/36 rule).
How to Lower Your DTI
If your DTI is higher than you'd like, there are two mathematical ways to improve it: increase your income or decrease your debt.
Pay off small balances: Eliminate credit card balances completely to remove the minimum monthly payment from the equation.
Refinance loans: Extending the term of a car loan or student loan can lower the monthly obligation, thereby lowering your DTI (though you may pay more interest over time).
Increase Income: Documented side hustles, raises, or co-borrower income can increase the denominator in the calculation, lowering the percentage.
What is Not Included in DTI?
It is important to note that DTI only counts debts found on your credit report plus housing expenses. It typically does not include:
Grocery bills
Utility payments (gas, electric, water)
Cell phone bills
Health insurance premiums (if deducted from paycheck)
Entertainment or subscription costs
Because these living expenses aren't included, a DTI of 40% might actually feel like 80% of your take-home pay is spoken for. Always budget based on your net income, not just the lender's gross income requirements.