.dti-calculator-widget {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
background: #ffffff;
border: 1px solid #e0e0e0;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
padding: 2rem;
}
.dti-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
}
@media (max-width: 768px) {
.dti-grid { grid-template-columns: 1fr; }
}
.dti-input-section h3 {
margin-top: 0;
color: #2c3e50;
font-size: 1.2rem;
border-bottom: 2px solid #3498db;
padding-bottom: 0.5rem;
margin-bottom: 1rem;
}
.dti-form-group {
margin-bottom: 1rem;
}
.dti-form-group label {
display: block;
font-weight: 600;
margin-bottom: 0.5rem;
color: #4a5568;
font-size: 0.95rem;
}
.dti-form-group input {
width: 100%;
padding: 0.75rem;
border: 1px solid #cbd5e0;
border-radius: 4px;
font-size: 1rem;
box-sizing: border-box;
transition: border-color 0.2s;
}
.dti-form-group input:focus {
border-color: #3498db;
outline: none;
box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}
.dti-btn {
width: 100%;
padding: 1rem;
background-color: #3498db;
color: white;
border: none;
border-radius: 4px;
font-size: 1.1rem;
font-weight: bold;
cursor: pointer;
transition: background-color 0.2s;
margin-top: 1rem;
}
.dti-btn:hover {
background-color: #2980b9;
}
.dti-result-box {
background: #f8fafc;
padding: 1.5rem;
border-radius: 6px;
text-align: center;
border: 1px solid #e2e8f0;
margin-top: 2rem;
display: none;
}
.dti-percentage {
font-size: 3.5rem;
font-weight: 800;
color: #2c3e50;
line-height: 1;
margin: 10px 0;
}
.dti-status {
font-size: 1.2rem;
font-weight: 600;
padding: 0.5rem 1rem;
border-radius: 50px;
display: inline-block;
margin-bottom: 1rem;
}
.status-green { background-color: #def7ec; color: #03543f; }
.status-yellow { background-color: #fefcbf; color: #744210; }
.status-red { background-color: #fde8e8; color: #9b1c1c; }
.dti-article {
max-width: 800px;
margin: 3rem auto 0;
line-height: 1.6;
color: #333;
}
.dti-article h2 { color: #2c3e50; margin-top: 2rem; }
.dti-article ul { margin-bottom: 1.5rem; }
.dti-article li { margin-bottom: 0.5rem; }
.dti-info-table {
width: 100%;
border-collapse: collapse;
margin: 1.5rem 0;
}
.dti-info-table th, .dti-info-table td {
border: 1px solid #e2e8f0;
padding: 12px;
text-align: left;
}
.dti-info-table th { background-color: #f7fafc; font-weight: 700; }
function calculateDTI() {
// 1. Get Inputs using var (ES5 compatible for inline safety)
var grossIncome = parseFloat(document.getElementById("grossIncome").value);
var rent = parseFloat(document.getElementById("rentMortgage").value) || 0;
var car = parseFloat(document.getElementById("carLoans").value) || 0;
var student = parseFloat(document.getElementById("studentLoans").value) || 0;
var cards = parseFloat(document.getElementById("creditCards").value) || 0;
var other = parseFloat(document.getElementById("otherDebt").value) || 0;
// 2. Validate Income
if (isNaN(grossIncome) || grossIncome <= 0) {
alert("Please enter a valid Gross Monthly Income greater than 0.");
return;
}
// 3. Calculation Logic
var totalDebt = rent + car + student + cards + other;
var dtiRatio = (totalDebt / grossIncome) * 100;
// 4. Determine Status
var statusBadge = document.getElementById("dtiStatusBadge");
var messageBox = document.getElementById("dtiMessage");
var percentDisplay = document.getElementById("dtiPercentDisplay");
var badgeText = "";
var messageText = "";
var statusClass = "";
// Reset classes
statusBadge.className = "dti-status";
if (dtiRatio 36 && dtiRatio 43 && dtiRatio <= 50) {
badgeText = "High Risk";
statusClass = "status-yellow"; // Darker yellow conceptually
messageText = "You are approaching the upper limit for most mortgage lenders. You may need a co-signer or a larger down payment to secure a loan.";
} else {
badgeText = "Critical";
statusClass = "status-red";
messageText = "Your debt load is very high relative to your income. Most traditional lenders will decline mortgage applications above 50% DTI. Consider aggressive debt repayment.";
}
// 5. Update DOM
document.getElementById("dtiResult").style.display = "block";
percentDisplay.innerHTML = dtiRatio.toFixed(1) + "%";
statusBadge.innerHTML = badgeText;
statusBadge.classList.add(statusClass);
messageBox.innerHTML = messageText;
document.getElementById("totalDebtDisplay").innerHTML = "$" + totalDebt.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById("totalIncomeDisplay").innerHTML = "$" + grossIncome.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
}
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 ability to manage monthly payments and repay debts. Unlike your credit score, which measures your history of repayment, DTI measures your current capacity to take on new debt.
How DTI is Calculated
The formula is simple but revealing. It is your total monthly debt payments divided by your gross monthly income (income before taxes and deductions).
Example: If your gross monthly income is $6,000 and your total monthly debt payments (rent, car, cards) equal $2,000, your DTI is:
($2,000 รท $6,000) x 100 = 33.3%
What is a Good DTI Ratio for a Mortgage?
While requirements vary by loan type (FHA, VA, Conventional), general guidelines follow the "28/36 rule" or the "43% hard cap".
| DTI Range |
Lender Perception |
Likely Outcome |
| 0% – 36% |
Low Risk |
Best interest rates; easy approval. Ideally, housing costs alone should not exceed 28%. |
| 37% – 43% |
Moderate Risk |
Standard approval zone for Qualified Mortgages. You may be asked to provide extra documentation. |
| 44% – 50% |
High Risk |
Limited options. FHA loans may still be available, but conventional loans become difficult to secure without significant reserves. |
| 50%+ |
Critical |
Denied by most traditional lenders. You are considered "house poor" or over-leveraged. |
Front-End vs. Back-End DTI
There are actually two types of DTI ratios that underwriters look at:
- Front-End Ratio: This only calculates your housing-related expenses (mortgage principal, interest, taxes, insurance, and HOA fees) divided by income. Ideally, this should be under 28%.
- Back-End Ratio: This is what the calculator above computes. It includes housing costs plus all other recurring debt like student loans, credit cards, and auto loans. Ideally, this should be under 36%.
How to Lower Your DTI
If your result indicates a high risk, you can improve your ratio by:
- Increasing Income: A side hustle, raise, or including a co-borrower's income on the application.
- Snowballing Debt: Aggressively paying off the loan with the lowest balance to eliminate that monthly payment entirely.
- Refinancing: Lowering the monthly payment on student loans or car loans (though this may extend the term).
- Avoiding New Debt: Do not open new credit lines or buy a car before applying for a mortgage.