function calculateRentalROI() {
// Get Input Values
var price = parseFloat(document.getElementById('purchasePrice').value);
var downPercent = parseFloat(document.getElementById('downPaymentPercent').value);
var rate = parseFloat(document.getElementById('interestRate').value);
var term = parseFloat(document.getElementById('loanTerm').value);
var rent = parseFloat(document.getElementById('monthlyRent').value);
var tax = parseFloat(document.getElementById('annualTax').value);
var insurance = parseFloat(document.getElementById('annualInsurance').value);
var maintenance = parseFloat(document.getElementById('monthlyMaintenance').value);
// Validate Inputs
if (isNaN(price) || isNaN(downPercent) || isNaN(rate) || isNaN(term) || isNaN(rent) || isNaN(tax) || isNaN(insurance) || isNaN(maintenance)) {
alert("Please enter valid numbers in all fields.");
return;
}
// Calculations
var downPayment = price * (downPercent / 100);
var loanAmount = price – downPayment;
// Mortgage Payment (P&I) Formula: M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1 ]
var monthlyRate = rate / 100 / 12;
var numPayments = term * 12;
var mortgagePayment = 0;
if (rate > 0) {
mortgagePayment = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numPayments)) / (Math.pow(1 + monthlyRate, numPayments) – 1);
} else {
mortgagePayment = loanAmount / numPayments;
}
// Monthly Expenses
var monthlyTax = tax / 12;
var monthlyInsurance = insurance / 12;
var totalMonthlyExpenses = mortgagePayment + monthlyTax + monthlyInsurance + maintenance;
var totalOperatingExpenses = monthlyTax + monthlyInsurance + maintenance; // Excludes mortgage for NOI
// Cash Flow
var monthlyCashFlow = rent – totalMonthlyExpenses;
var annualCashFlow = monthlyCashFlow * 12;
// NOI (Net Operating Income)
var annualNOI = (rent * 12) – (totalOperatingExpenses * 12);
// Returns
var capRate = (annualNOI / price) * 100;
var cashOnCash = (annualCashFlow / downPayment) * 100;
// Display Results
document.getElementById('resMortgage').innerText = "$" + mortgagePayment.toFixed(2);
var cfElement = document.getElementById('resCashFlow');
cfElement.innerText = "$" + monthlyCashFlow.toFixed(2);
if(monthlyCashFlow >= 0) {
cfElement.className = "rp-result-value positive";
} else {
cfElement.className = "rp-result-value negative";
}
document.getElementById('resCoC').innerText = cashOnCash.toFixed(2) + "%";
document.getElementById('resCapRate').innerText = capRate.toFixed(2) + "%";
document.getElementById('resInvested').innerText = "$" + downPayment.toLocaleString();
// Show Results Section
document.getElementById('rpResultSection').style.display = "block";
}
Understanding Rental Property ROI Metrics
Investing in real estate is a powerful way to build wealth, but analyzing a deal correctly is critical to success. This Rental Property Cash Flow Calculator helps you evaluate the potential profitability of an investment property using industry-standard metrics.
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 Income – Total Expenses. Positive cash flow means the property pays for itself and generates income, while negative cash flow means you are losing money every month to hold the asset.
2. Cash on Cash Return (CoC)
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 property. A CoC return of 8-12% is often considered a solid benchmark in many markets.
3. Cap Rate (Capitalization Rate)
The Cap Rate measures a property's natural rate of return assuming you bought it with all cash. It is calculated by dividing the Net Operating Income (NOI) by the Purchase Price. It allows you to compare the profitability of properties regardless of how they are financed.
How to Use This Calculator
Purchase Price & Down Payment: Enter the negotiated price and the percentage of cash you are putting down.
Loan Details: Input your expected interest rate and loan term (usually 30 years).
Expenses: Be realistic. Don't forget to include Property Taxes, Insurance, and a budget for Maintenance (often 5-10% of rent).
Use this tool to run "what-if" scenarios. For example, see how a higher interest rate affects your cash flow, or determine the maximum offer price that still yields a positive monthly return.