function calculateRentalROI() {
// Inputs
var price = parseFloat(document.getElementById('purchasePrice').value) || 0;
var downPercent = parseFloat(document.getElementById('downPaymentPercent').value) || 0;
var interestRate = parseFloat(document.getElementById('interestRate').value) || 0;
var termYears = parseFloat(document.getElementById('loanTerm').value) || 0;
var closingCosts = parseFloat(document.getElementById('closingCosts').value) || 0;
var rent = parseFloat(document.getElementById('monthlyRent').value) || 0;
var tax = parseFloat(document.getElementById('propertyTax').value) || 0;
var insurance = parseFloat(document.getElementById('insurance').value) || 0;
var hoa = parseFloat(document.getElementById('hoa').value) || 0;
var maintenance = parseFloat(document.getElementById('maintenance').value) || 0;
var vacancy = parseFloat(document.getElementById('vacancy').value) || 0;
// Calculations
var downPaymentAmount = price * (downPercent / 100);
var loanAmount = price – downPaymentAmount;
var totalInitialInvestment = downPaymentAmount + closingCosts;
// Mortgage Calculation
var monthlyRate = (interestRate / 100) / 12;
var numPayments = termYears * 12;
var mortgagePayment = 0;
if (interestRate === 0) {
if (termYears > 0) {
mortgagePayment = loanAmount / numPayments;
}
} else {
mortgagePayment = (loanAmount * monthlyRate) / (1 – Math.pow(1 + monthlyRate, -numPayments));
}
// Operating Expenses (Tax, Ins, HOA, Maint, Vacancy) – Excluding Mortgage
var operatingExpenses = tax + insurance + hoa + maintenance + vacancy;
// Total Monthly Outflow
var totalMonthlyExpenses = mortgagePayment + operatingExpenses;
// Monthly Cash Flow
var monthlyCashFlow = rent – totalMonthlyExpenses;
var annualCashFlow = monthlyCashFlow * 12;
// Net Operating Income (NOI) = Income – Operating Expenses (Excluding Debt Service)
var annualNOI = (rent – operatingExpenses) * 12;
// Cap Rate = (Annual NOI / Purchase Price) * 100
var capRate = 0;
if (price > 0) {
capRate = (annualNOI / price) * 100;
}
// Cash on Cash ROI = (Annual Cash Flow / Total Initial Investment) * 100
var roi = 0;
if (totalInitialInvestment > 0) {
roi = (annualCashFlow / totalInitialInvestment) * 100;
}
// Format and Display
document.getElementById('resultsArea').style.display = 'block';
document.getElementById('displayMortgage').innerText = '$' + mortgagePayment.toFixed(2);
document.getElementById('displayTotalExpenses').innerText = '$' + totalMonthlyExpenses.toFixed(2);
document.getElementById('displayNOI').innerText = '$' + annualNOI.toFixed(2);
var cfElement = document.getElementById('displayCashFlow');
cfElement.innerText = '$' + monthlyCashFlow.toFixed(2);
if (monthlyCashFlow >= 0) {
cfElement.className = 'result-value positive-cashflow';
} else {
cfElement.className = 'result-value negative-cashflow';
}
document.getElementById('displayCapRate').innerText = capRate.toFixed(2) + '%';
var roiElement = document.getElementById('displayROI');
roiElement.innerText = roi.toFixed(2) + '%';
if (roi >= 0) {
roiElement.className = 'result-value positive-cashflow';
} else {
roiElement.className = 'result-value negative-cashflow';
}
}
Understanding Rental Property ROI
Investing in real estate is one of the most reliable ways to build wealth, but simply buying a property doesn't guarantee a profit. To succeed, investors must rigorously analyze the numbers. This Rental Property Cash Flow Calculator helps you evaluate the profitability of a potential investment by breaking down income, expenses, and returns.
Key Metrics Explained
1. Monthly Cash Flow
Cash flow is the net amount of money left in your pocket after all expenses are paid. It is calculated as:
Cash Flow = Total Rental Income – (Mortgage Payment + Operating Expenses)
Positive cash flow ensures the property pays for itself and provides passive income. Negative cash flow means you are losing money every month to hold the asset.
2. Cash on Cash ROI (Return on Investment)
This is arguably the most important metric for rental investors. It measures the annual return on the actual cash you invested (down payment + closing costs), rather than the total price of the home. A good Cash on Cash return varies by market, but many investors target 8-12%.
3. Cap Rate (Capitalization Rate)
The Cap Rate measures the property's natural rate of return assuming it was bought with all cash (no mortgage). It allows you to compare the profitability of different properties regardless of how they are financed. It is calculated using the Net Operating Income (NOI) divided by the property price.
Estimating Expenses
One common mistake new investors make is underestimating expenses. Beyond the mortgage, ensure you account for:
Vacancy: Properties won't be rented 365 days a year. Budget 5-10% of rent.
Maintenance: Things break. Budgeting 10-15% of rent for repairs is prudent.
CapEx (Capital Expenditures): Big ticket items like roofs and HVAC will eventually need replacement.
How to Use This Calculator
Start by entering the purchase price and your loan details. Be sure to research accurate local property tax rates and insurance costs. Adjust the rental income to see how slight changes in rent affect your bottom line. Use the "Cash on Cash ROI" figure to compare this investment against other opportunities like stocks or bonds.