function calculateRentalROI() {
// 1. Get Input Values
var price = parseFloat(document.getElementById('rpPurchasePrice').value) || 0;
var downPayment = parseFloat(document.getElementById('rpDownPayment').value) || 0;
var interestRate = parseFloat(document.getElementById('rpInterestRate').value) || 0;
var loanTerm = parseFloat(document.getElementById('rpLoanTerm').value) || 30;
var closingCosts = parseFloat(document.getElementById('rpClosingCosts').value) || 0;
var repairs = parseFloat(document.getElementById('rpRepairs').value) || 0;
var monthlyRent = parseFloat(document.getElementById('rpMonthlyRent').value) || 0;
var annualTax = parseFloat(document.getElementById('rpPropertyTax').value) || 0;
var annualInsurance = parseFloat(document.getElementById('rpInsurance').value) || 0;
var monthlyHOA = parseFloat(document.getElementById('rpHOA').value) || 0;
var vacancyRate = parseFloat(document.getElementById('rpVacancy').value) || 0;
var maintenanceRate = parseFloat(document.getElementById('rpMaintenance').value) || 0;
// 2. Calculate Mortgage (Principal & Interest)
var loanAmount = price – downPayment;
var monthlyRate = (interestRate / 100) / 12;
var numberOfPayments = loanTerm * 12;
var monthlyMortgage = 0;
if (interestRate > 0) {
monthlyMortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numberOfPayments)) / (Math.pow(1 + monthlyRate, numberOfPayments) – 1);
} else {
monthlyMortgage = loanAmount / numberOfPayments;
}
// 3. Calculate Operating Expenses
var monthlyTax = annualTax / 12;
var monthlyInsurance = annualInsurance / 12;
var monthlyVacancy = monthlyRent * (vacancyRate / 100);
var monthlyMaintenance = monthlyRent * (maintenanceRate / 100);
var totalMonthlyExpenses = monthlyTax + monthlyInsurance + monthlyHOA + monthlyVacancy + monthlyMaintenance;
// 4. Key Metrics Calculation
var monthlyNOI = monthlyRent – totalMonthlyExpenses; // Net Operating Income (Monthly)
var monthlyCashFlow = monthlyNOI – monthlyMortgage;
var annualCashFlow = monthlyCashFlow * 12;
var annualNOI = monthlyNOI * 12;
var totalInitialInvestment = downPayment + closingCosts + repairs;
// Cash on Cash Return = Annual Cash Flow / Total Cash Invested
var cocReturn = 0;
if (totalInitialInvestment > 0) {
cocReturn = (annualCashFlow / totalInitialInvestment) * 100;
}
// Cap Rate = Annual NOI / Purchase Price
var capRate = 0;
if (price > 0) {
capRate = (annualNOI / price) * 100;
}
// 5. Display Results
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 0,
maximumFractionDigits: 0,
});
var formatterDec = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2,
maximumFractionDigits: 2,
});
document.getElementById('resCashFlow').innerHTML = (monthlyCashFlow >= 0 ? '+' : ") + formatter.format(monthlyCashFlow);
document.getElementById('resCoC').innerHTML = cocReturn.toFixed(2) + "%";
document.getElementById('resCapRate').innerHTML = capRate.toFixed(2) + "%";
document.getElementById('resGrossIncome').innerHTML = formatterDec.format(monthlyRent);
document.getElementById('resMortgage').innerHTML = "-" + formatterDec.format(monthlyMortgage);
document.getElementById('resExpenses').innerHTML = "-" + formatterDec.format(totalMonthlyExpenses);
document.getElementById('resNOI').innerHTML = formatterDec.format(monthlyNOI);
// Show results div
document.getElementById('rpResults').style.display = 'block';
}
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 profit. To ensure a rental property is a sound investment, you must analyze the numbers accurately. This Rental Property Cash Flow Calculator helps investors determine the viability of a deal by calculating key metrics like Cash Flow, Cash-on-Cash Return, and Cap Rate.
Key Metrics Explained
1. Net Operating Income (NOI)
NOI is the total income a property generates after all operating expenses are paid, but before the mortgage is paid. It is a raw measure of the property's profitability purely as an asset.
This is the money left in your pocket every month after all expenses and the mortgage payment are made. Positive cash flow is essential for long-term sustainability. A negative cash flow means you are paying out of pocket to hold the property.
3. Cash-on-Cash Return (CoC)
This metric measures the return on the actual cash you invested (down payment, closing costs, and repairs), rather than the total price of the home. It is often considered the most important metric for investors using leverage (loans).
Formula: Annual Cash Flow / Total Cash Invested
How to Use This Calculator
Vacancy Rate: Always account for vacancy. A standard safe estimate is 5-8%, which assumes the property sits empty for a few weeks each year between tenants.
Maintenance Reserves: Houses break. Setting aside 5-10% of monthly rent for future repairs (new roof, HVAC, plumbing) is crucial for accurate cash flow analysis.
Loan Term: A 30-year loan typically improves monthly cash flow compared to a 15-year loan, though you will pay more in interest over time.
Pro Tip: Don't rely solely on the "1% Rule" (rent should be 1% of purchase price). Use this calculator to see the full picture including taxes, insurance, and high interest rates which can significantly impact your bottom line.