function calculateRentalROI() {
// 1. Retrieve Inputs
var price = parseFloat(document.getElementById('purchasePrice').value) || 0;
var downPmt = parseFloat(document.getElementById('downPayment').value) || 0;
var closing = parseFloat(document.getElementById('closingCosts').value) || 0;
var rate = parseFloat(document.getElementById('interestRate').value) || 0;
var years = parseFloat(document.getElementById('loanTerm').value) || 30;
var rent = parseFloat(document.getElementById('monthlyRent').value) || 0;
var vacancyPct = parseFloat(document.getElementById('vacancyRate').value) || 0;
var mgmtPct = parseFloat(document.getElementById('managementFee').value) || 0;
var taxYear = parseFloat(document.getElementById('propertyTax').value) || 0;
var insYear = parseFloat(document.getElementById('insurance').value) || 0;
var maintYear = parseFloat(document.getElementById('maintenance').value) || 0;
var hoaMonth = parseFloat(document.getElementById('hoa').value) || 0;
// 2. Calculate Mortgage (P & I)
var loanAmount = price – downPmt;
var monthlyRate = (rate / 100) / 12;
var totalPayments = years * 12;
var monthlyMortgage = 0;
if (loanAmount > 0 && rate > 0) {
monthlyMortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, totalPayments)) / (Math.pow(1 + monthlyRate, totalPayments) – 1);
} else if (loanAmount > 0 && rate === 0) {
monthlyMortgage = loanAmount / totalPayments;
}
// 3. Calculate Income
var grossAnnualRent = rent * 12;
var vacancyLoss = grossAnnualRent * (vacancyPct / 100);
var effectiveGrossIncome = grossAnnualRent – vacancyLoss;
// 4. Calculate Operating Expenses
var managementCostYear = effectiveGrossIncome * (mgmtPct / 100);
var otherMonthlyYear = hoaMonth * 12;
var totalOperatingExpenses = taxYear + insYear + maintYear + managementCostYear + otherMonthlyYear;
// 5. Net Operating Income (NOI)
var noi = effectiveGrossIncome – totalOperatingExpenses;
// 6. Cash Flow
var annualDebtService = monthlyMortgage * 12;
var annualCashFlow = noi – annualDebtService;
var monthlyCashFlow = annualCashFlow / 12;
// 7. Investment Returns
var totalCashInvested = downPmt + closing;
// Cap Rate = NOI / Purchase Price
var capRate = 0;
if (price > 0) {
capRate = (noi / price) * 100;
}
// Cash on Cash Return = Annual Cash Flow / Total Cash Invested
var cashOnCash = 0;
if (totalCashInvested > 0) {
cashOnCash = (annualCashFlow / totalCashInvested) * 100;
}
// 8. Display Results
document.getElementById('resMonthlyCashFlow').innerText = formatCurrency(monthlyCashFlow);
document.getElementById('resMonthlyCashFlow').style.color = monthlyCashFlow >= 0 ? '#27ae60' : '#c0392b';
document.getElementById('resCashOnCash').innerText = cashOnCash.toFixed(2) + '%';
document.getElementById('resCashOnCash').style.color = cashOnCash >= 0 ? '#27ae60' : '#c0392b';
document.getElementById('resCapRate').innerText = capRate.toFixed(2) + '%';
document.getElementById('resNOI').innerText = formatCurrency(noi);
document.getElementById('resTotalInvestment').innerText = formatCurrency(totalCashInvested);
document.getElementById('resMortgage').innerText = formatCurrency(monthlyMortgage);
// Show result container
document.getElementById('rpResults').style.display = 'block';
}
function formatCurrency(num) {
return '$' + num.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
}
Understanding Your 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 ensure a smart investment, you must analyze the numbers thoroughly. This Rental Property Cash Flow Calculator helps you determine the viability of a potential investment by breaking down income, expenses, and key return metrics.
Key Metrics Explained
1. Monthly Cash Flow
This is the money left over after all expenses and mortgage payments are made. Positive cash flow means the property is paying for itself and generating profit. Negative cash flow implies you will need to contribute money monthly to keep the property running.
2. Cash on Cash Return (CoC)
Perhaps the most important metric for investors, Cash on Cash Return measures the annual return on the actual cash you invested (Down Payment + Closing Costs). Unlike simple ROI, it accounts for leverage (the mortgage).
Formula: (Annual Cash Flow / Total Cash Invested) x 100
A "good" CoC return varies by market, but many investors aim for 8-12% or higher.
3. Cap Rate (Capitalization Rate)
The Cap Rate measures the property's natural rate of return assuming you paid all cash (no mortgage). It helps you compare the profitability of different properties regardless of how they are financed.
Formula: (Net Operating Income / Purchase Price) x 100
Higher Cap Rates generally indicate higher returns but may come with higher risk (e.g., properties in lower-income areas).
Net Operating Income (NOI) vs. Cash Flow
NOI is your income minus operating expenses (Taxes, Insurance, Maintenance, Management), but before the mortgage is paid. Cash Flow is what remains after the mortgage debt service is subtracted from the NOI. Lenders look at NOI to determine if the property supports the loan, while investors look at Cash Flow to determine spendable income.
Estimating Expenses
One of the most common mistakes new investors make is underestimating expenses. Always account for:
Vacancy: Properties won't be rented 365 days a year. A 5-8% vacancy rate is a standard safety buffer.
Maintenance: Things break. Setting aside 1% of the property value annually or 10% of the rent is prudent.
Property Management: Even if you self-manage, account for your time or future management needs (typically 8-10% of rent).