function calculateRentalResults() {
// 1. Get Values
var price = parseFloat(document.getElementById('purchasePrice').value);
var downPercent = parseFloat(document.getElementById('downPaymentPercent').value);
var interestRate = parseFloat(document.getElementById('interestRate').value);
var termYears = parseFloat(document.getElementById('loanTerm').value);
var closingCosts = parseFloat(document.getElementById('closingCosts').value);
var rent = parseFloat(document.getElementById('monthlyRent').value);
var annualTaxes = parseFloat(document.getElementById('annualTaxes').value);
var annualInsurance = parseFloat(document.getElementById('annualInsurance').value);
var monthlyHOA = parseFloat(document.getElementById('monthlyHOA').value);
var vacancyRate = parseFloat(document.getElementById('vacancyRate').value);
// Validation
if (isNaN(price) || isNaN(downPercent) || isNaN(interestRate) || isNaN(termYears) || isNaN(rent)) {
alert("Please enter valid numbers for the primary fields.");
return;
}
// Defaults for empty optional fields
if (isNaN(closingCosts)) closingCosts = 0;
if (isNaN(annualTaxes)) annualTaxes = 0;
if (isNaN(annualInsurance)) annualInsurance = 0;
if (isNaN(monthlyHOA)) monthlyHOA = 0;
if (isNaN(vacancyRate)) vacancyRate = 0;
// 2. Loan Calculations
var downPaymentAmount = price * (downPercent / 100);
var loanAmount = price – downPaymentAmount;
// Monthly Interest Rate
var r = (interestRate / 100) / 12;
var n = termYears * 12;
// Mortgage P&I
var mortgagePayment = 0;
if (r > 0) {
mortgagePayment = loanAmount * (r * Math.pow((1 + r), n)) / (Math.pow((1 + r), n) – 1);
} else {
mortgagePayment = loanAmount / n;
}
// 3. Expense Calculations
var monthlyTaxes = annualTaxes / 12;
var monthlyInsurance = annualInsurance / 12;
var vacancyCost = rent * (vacancyRate / 100);
var totalMonthlyOpEx = monthlyTaxes + monthlyInsurance + monthlyHOA + vacancyCost;
var totalMonthlyExpenses = mortgagePayment + totalMonthlyOpEx;
// 4. Income Calculations
var noiMonthly = rent – totalMonthlyOpEx;
var cashFlow = rent – totalMonthlyExpenses;
var annualCashFlow = cashFlow * 12;
// 5. ROI Calculations
var totalInitialInvestment = downPaymentAmount + closingCosts;
var cashOnCash = 0;
if (totalInitialInvestment > 0) {
cashOnCash = (annualCashFlow / totalInitialInvestment) * 100;
}
var annualNOI = noiMonthly * 12;
var capRate = 0;
if (price > 0) {
capRate = (annualNOI / price) * 100;
}
// 6. Formatting Helper
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
});
// 7. Display Results
document.getElementById('res-investment').innerText = formatter.format(totalInitialInvestment);
document.getElementById('res-mortgage').innerText = formatter.format(mortgagePayment);
document.getElementById('res-total-expenses').innerText = formatter.format(totalMonthlyExpenses);
document.getElementById('res-noi-monthly').innerText = formatter.format(noiMonthly);
var cfElement = document.getElementById('res-cashflow');
cfElement.innerText = formatter.format(cashFlow);
if(cashFlow < 0) {
cfElement.style.color = '#c0392b';
} else {
cfElement.style.color = '#27ae60';
}
var cocElement = document.getElementById('res-coc');
cocElement.innerText = cashOnCash.toFixed(2) + "%";
if(cashOnCash < 0) {
cocElement.style.color = '#c0392b';
} else {
cocElement.style.color = '#27ae60';
}
document.getElementById('res-caprate').innerText = capRate.toFixed(2) + "%";
// Show results div
document.getElementById('roi-results-area').style.display = 'block';
}
Understanding Your Rental Property ROI
Investing in real estate is a powerful way to build wealth, but simply buying a property and renting it out doesn't guarantee a profit. To succeed, you need to understand the numbers behind the deal. This Rental Property Cash Flow & ROI Calculator helps investors analyze potential deals by breaking down income, expenses, and returns.
Key Metrics Explained
1. Monthly Cash Flow
Cash flow is the profit you bring in each month after all expenses are paid. It is calculated as:
Total Rental Income – Total Monthly Expenses (Mortgage + Taxes + Insurance + Maintenance)
Positive cash flow means the property pays for itself and provides you with passive income. Negative cash flow means you are losing money every month to hold the property.
2. Cash on Cash ROI
This is arguably the most important metric for rental investors. It measures the annual return you make on the actual cash you invested (Down Payment + Closing Costs), rather than the total price of the property.
For example, if you invest $50,000 cash to buy a $200,000 property, and it generates $5,000 in profit per year, your Cash on Cash ROI is 10%.
3. Cap Rate (Capitalization Rate)
Cap Rate measures the natural rate of return of the property regardless of how it was financed (cash vs. loan). It helps you compare the profitability of different properties directly. A higher Cap Rate generally indicates a higher potential return, but often comes with higher risk.
Example Calculation
Imagine you purchase a property for $250,000 with a 20% down payment ($50,000). You get a loan at 6.5% interest for 30 years.
Rental Income: $2,200/month
Mortgage Payment: ~$1,264/month
Taxes, Insurance, HOA: ~$500/month
Total Expenses: ~$1,764/month
In this scenario, your Monthly Cash Flow would be roughly $436. This results in an annual profit of $5,232. Dividing this by your initial investment (plus closing costs) gives you your Cash on Cash ROI.
Use the calculator above to adjust these variables and see how interest rates, vacancy, or higher rents affect your bottom line.