function calculateDTI() {
// 1. Get Income Values
var annualIncome = parseFloat(document.getElementById("annualIncome").value);
var otherMonthlyIncome = parseFloat(document.getElementById("otherMonthlyIncome").value);
// Validate inputs
if (isNaN(annualIncome)) annualIncome = 0;
if (isNaN(otherMonthlyIncome)) otherMonthlyIncome = 0;
// Calculate Total Monthly Gross Income
var monthlyGrossIncome = (annualIncome / 12) + otherMonthlyIncome;
// 2. Get Debt Values
var rent = parseFloat(document.getElementById("monthlyRentMortgage").value);
var car = parseFloat(document.getElementById("monthlyCarLoans").value);
var student = parseFloat(document.getElementById("monthlyStudentLoans").value);
var cards = parseFloat(document.getElementById("monthlyCreditCards").value);
var alimony = parseFloat(document.getElementById("monthlyAlimony").value);
var other = parseFloat(document.getElementById("monthlyOtherDebt").value);
// Handle NaN for debts
if (isNaN(rent)) rent = 0;
if (isNaN(car)) car = 0;
if (isNaN(student)) student = 0;
if (isNaN(cards)) cards = 0;
if (isNaN(alimony)) alimony = 0;
if (isNaN(other)) other = 0;
var totalMonthlyDebt = rent + car + student + cards + alimony + other;
// 3. Error Handling: No Income
if (monthlyGrossIncome <= 0) {
alert("Please enter a valid Annual Income greater than zero.");
return;
}
// 4. Calculate Ratio
var dtiRatio = (totalMonthlyDebt / monthlyGrossIncome) * 100;
dtiRatio = dtiRatio.toFixed(2); // Round to 2 decimals
// 5. Determine Status & Color
var resultBox = document.getElementById("dtiResultBox");
var statusText = document.getElementById("dtiStatusText");
var ratioDisplay = document.getElementById("dtiRatioDisplay");
var message = document.getElementById("dtiMessage");
var displayIncome = document.getElementById("displayMonthlyIncome");
var displayDebt = document.getElementById("displayTotalDebt");
var statusClass = "";
var statusLabel = "";
var advice = "";
if (dtiRatio 36 && dtiRatio <= 43) {
statusClass = "dti-warning";
statusLabel = "Manageable";
advice = "You may still qualify for loans, but lenders might require more documentation or offer slightly higher rates.";
} else {
statusClass = "dti-bad";
statusLabel = "High Risk";
advice = "You may have difficulty qualifying for a mortgage. Consider paying down debt before applying.";
}
// 6. Update DOM
resultBox.style.display = "block";
// Reset classes
ratioDisplay.className = "dti-ratio-display " + statusClass;
statusText.className = "dti-status-text " + statusClass;
statusText.innerHTML = statusLabel;
ratioDisplay.innerHTML = dtiRatio + "%";
message.innerHTML = advice;
// Format currency
displayIncome.innerHTML = "$" + monthlyGrossIncome.toLocaleString('en-US', {maximumFractionDigits:0});
displayDebt.innerHTML = "$" + totalMonthlyDebt.toLocaleString('en-US', {maximumFractionDigits:0});
}
What is a Debt-to-Income (DTI) Ratio?
Your Debt-to-Income (DTI) ratio is a personal finance measure that compares the amount of debt you have to your overall income. Lenders, including mortgage issuers and credit card companies, use this ratio to measure your ability to manage monthly payments and repay the money you plan to borrow.
Essentially, it tells lenders how much of your monthly pre-tax income is eaten up by debt obligations. A lower DTI ratio shows a good balance between debt and income.
How is DTI Calculated?
The calculation is relatively straightforward, but accuracy is key. The formula used by our calculator above is:
Step 1: Add up your monthly bills (rent/mortgage, student loans, auto loans, credit card minimums, etc.). Do not include variable expenses like groceries or utilities.
Step 2: Determine your gross monthly income (your income before taxes and deductions). If you are paid annually, divide your salary by 12.
Step 3: Divide the total debt by the gross income and multiply by 100 to get the percentage.
Interpreting Your DTI Score
Different lenders have different criteria, but there are general guidelines used in the financial industry, particularly for Qualified Mortgages.
DTI Ratio
Status
Lender Perception
36% or less
Healthy
Ideal range. Most lenders view this as affordable and low risk.
36% – 43%
Manageable
Acceptable for most mortgages, though you may be asked to pay down some debt. 43% is often the cut-off for Qualified Mortgages.
43% – 50%
High
Lenders may require a larger down payment, higher credit score, or cash reserves. FHA loans may still be an option.
Above 50%
Critical
Very difficult to obtain new credit. Indicates financial distress. Priority should be on debt reduction.
Front-End vs. Back-End Ratio
This calculator determines your Back-End Ratio, which includes all monthly debts. Mortgage lenders also look at your Front-End Ratio, which only calculates the percentage of your income that goes toward housing costs (mortgage principal, interest, taxes, and insurance).
A standard rule of thumb is the 28/36 rule: households should spend no more than 28% of their gross income on housing expenses and no more than 36% on total debt service.
How to Lower Your DTI
If your ratio is higher than 43%, consider these steps before applying for a loan:
Increase Payment Amounts: Pay more than the minimum on credit cards to reduce the monthly obligation faster.
Avoid New Debt: Do not open new credit lines or finance large purchases like furniture or cars.
Recalculate with a Co-Signer: Adding a co-borrower with strong income can significantly lower the ratio for a joint application.