function calculateRentalROI() {
// 1. Get Input Values
var price = parseFloat(document.getElementById('rp-price').value);
var closingCosts = parseFloat(document.getElementById('rp-closing').value);
var downPayment = parseFloat(document.getElementById('rp-down').value);
var interestRate = parseFloat(document.getElementById('rp-rate').value);
var loanTerm = parseFloat(document.getElementById('rp-term').value);
var monthlyRent = parseFloat(document.getElementById('rp-rent').value);
var annualTax = parseFloat(document.getElementById('rp-tax').value);
var annualInsurance = parseFloat(document.getElementById('rp-insurance').value);
var monthlyHOA = parseFloat(document.getElementById('rp-hoa').value);
var maintVacancyRate = parseFloat(document.getElementById('rp-maint').value);
// Validate Inputs
if (isNaN(price) || isNaN(downPayment) || isNaN(interestRate) || isNaN(monthlyRent)) {
alert("Please enter valid numbers for Price, Down Payment, Rate, and Rent.");
return;
}
// 2. Calculate Mortgage (Principal & Interest)
var loanAmount = price – downPayment;
var monthlyRate = (interestRate / 100) / 12;
var totalPayments = loanTerm * 12;
var mortgagePayment = 0;
if (interestRate > 0) {
mortgagePayment = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, totalPayments)) / (Math.pow(1 + monthlyRate, totalPayments) – 1);
} else {
mortgagePayment = loanAmount / totalPayments;
}
// 3. Calculate Expenses
var monthlyTax = annualTax / 12;
var monthlyInsurance = annualInsurance / 12;
var monthlyMaintVacancy = monthlyRent * (maintVacancyRate / 100);
var totalMonthlyExpenses = mortgagePayment + monthlyTax + monthlyInsurance + monthlyHOA + monthlyMaintVacancy;
var operatingExpenses = monthlyTax + monthlyInsurance + monthlyHOA + monthlyMaintVacancy; // Expenses without mortgage
// 4. Calculate Returns
var monthlyCashFlow = monthlyRent – totalMonthlyExpenses;
var annualCashFlow = monthlyCashFlow * 12;
var totalCashInvested = downPayment + closingCosts;
var noiAnnual = (monthlyRent – operatingExpenses) * 12; // Net Operating Income
var cashOnCashROI = 0;
if (totalCashInvested > 0) {
cashOnCashROI = (annualCashFlow / totalCashInvested) * 100;
}
var capRate = 0;
if (price > 0) {
capRate = (noiAnnual / price) * 100;
}
// 5. Update DOM
document.getElementById('res-mortgage').innerText = "$" + mortgagePayment.toFixed(2);
document.getElementById('res-expenses').innerText = "$" + totalMonthlyExpenses.toFixed(2);
document.getElementById('res-noi').innerText = "$" + (monthlyRent – operatingExpenses).toFixed(2);
var cashFlowEl = document.getElementById('res-cashflow');
cashFlowEl.innerText = "$" + monthlyCashFlow.toFixed(2);
// Style Cash Flow color
if (monthlyCashFlow >= 0) {
cashFlowEl.className = "rp-result-value rp-highlight";
cashFlowEl.style.color = "#28a745";
} else {
cashFlowEl.className = "rp-result-value rp-highlight-bad";
cashFlowEl.style.color = "#dc3545";
}
document.getElementById('res-coc').innerText = cashOnCashROI.toFixed(2) + "%";
document.getElementById('res-cap').innerText = capRate.toFixed(2) + "%";
// Show results
document.getElementById('rp-results-area').style.display = "block";
}
Understanding Rental Property ROI
Investing in real estate is one of the most reliable ways to build wealth, but it requires precise calculations to ensure a profitable investment. This Rental Property Cash Flow & ROI Calculator helps investors analyze deals by breaking down income, expenses, and return on investment metrics.
Key Metrics Explained
To evaluate a rental property effectively, you need to understand three specific metrics calculated above:
Cash Flow: This is the profit you take home each month after paying all expenses, including the mortgage, taxes, insurance, and maintenance reserves. Positive cash flow ensures the property pays for itself.
Cash on Cash ROI: This metric measures the annual return on the actual cash you invested (down payment + closing costs). It helps compare real estate returns against other investments like stocks.
Cap Rate (Capitalization Rate): This represents the rate of return on the property based on the income it generates, independent of financing. It is calculated by dividing the Net Operating Income (NOI) by the property's current market value.
How to Use This Calculator
Enter the data for your prospective property to get an instant analysis:
Purchase Info: Enter the purchase price and your estimated closing costs.
Loan Details: Input your down payment amount, expected interest rate, and loan term (usually 30 years).
Income & Expenses: Input the expected monthly rent. Be realistic about expenses—don't forget to allocate a percentage for maintenance and vacancy (typically 5-10% is recommended).
Example Scenario
Consider a property listed for $250,000. You put $50,000 (20%) down and pay $5,000 in closing costs.
If the interest rate is 6.5% and you can rent it for $2,200/month, paying standard taxes and insurance, this calculator will show you whether the rental income covers the mortgage and if your Cash on Cash ROI meets your investment goals (e.g., aiming for >8%).