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 years = parseFloat(document.getElementById('loanTerm').value);
var rent = parseFloat(document.getElementById('monthlyRent').value);
var vacancy = parseFloat(document.getElementById('vacancyRate').value);
var tax = parseFloat(document.getElementById('annualTaxes').value);
var insurance = parseFloat(document.getElementById('annualInsurance').value);
var maintenance = parseFloat(document.getElementById('monthlyMaintenance').value);
var management = parseFloat(document.getElementById('monthlyManagement').value);
// Validation
if (isNaN(price) || isNaN(downPercent) || isNaN(rate) || isNaN(years) || isNaN(rent)) {
alert("Please fill in all primary fields with valid numbers.");
return;
}
// Default optional fields to 0 if empty
if (isNaN(vacancy)) vacancy = 0;
if (isNaN(tax)) tax = 0;
if (isNaN(insurance)) insurance = 0;
if (isNaN(maintenance)) maintenance = 0;
if (isNaN(management)) management = 0;
// Calculations
// 1. Initial Cash Invested
var downPaymentAmount = price * (downPercent / 100);
var loanAmount = price – downPaymentAmount;
// 2. Mortgage Payment (Principal + Interest)
// Formula: M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1 ]
var monthlyRate = (rate / 100) / 12;
var numberOfPayments = years * 12;
var mortgagePayment = 0;
if (rate === 0) {
mortgagePayment = loanAmount / numberOfPayments;
} else {
mortgagePayment = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numberOfPayments)) / (Math.pow(1 + monthlyRate, numberOfPayments) – 1);
}
// 3. Income Logic
var vacancyLoss = rent * (vacancy / 100);
var effectiveGrossIncome = rent – vacancyLoss;
// 4. Monthly Expenses
var monthlyTax = tax / 12;
var monthlyInsurance = insurance / 12;
// Total Operating Expenses (excluding mortgage)
var totalOperatingExpenses = monthlyTax + monthlyInsurance + maintenance + management;
// Total Outflow
var totalMonthlyExpenses = totalOperatingExpenses + mortgagePayment;
// 5. Cash Flow
var monthlyCashFlow = effectiveGrossIncome – totalMonthlyExpenses;
var annualCashFlow = monthlyCashFlow * 12;
// 6. Cash on Cash Return
// CoC = Annual Pre-Tax Cash Flow / Total Cash Invested
// Note: Simplification assumes Closing Costs are negligible or included in "Cash Invested" logic mentally by user,
// but strict calculation uses Down Payment as the primary basis here.
var cashOnCashReturn = 0;
if (downPaymentAmount > 0) {
cashOnCashReturn = (annualCashFlow / downPaymentAmount) * 100;
}
// Display Results
var resultBox = document.getElementById('results');
resultBox.style.display = 'block';
// Helper for currency formatting
var fmt = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' });
document.getElementById('resIncome').innerHTML = fmt.format(effectiveGrossIncome);
document.getElementById('resMortgage').innerHTML = fmt.format(mortgagePayment);
document.getElementById('resExpenses').innerHTML = fmt.format(totalMonthlyExpenses);
var cashFlowEl = document.getElementById('resCashFlow');
cashFlowEl.innerHTML = fmt.format(monthlyCashFlow);
// Color coding
if (monthlyCashFlow >= 0) {
cashFlowEl.className = "result-value positive";
} else {
cashFlowEl.className = "result-value negative";
}
var cocEl = document.getElementById('resCoC');
cocEl.innerHTML = cashOnCashReturn.toFixed(2) + "%";
if (cashOnCashReturn >= 0) {
cocEl.className = "result-value positive";
} else {
cocEl.className = "result-value negative";
}
}
How to Calculate Rental Property Cash Flow
Understanding the profitability of a real estate investment is crucial for long-term wealth building. This Rental Property Cash Flow Calculator helps investors analyze potential deals by breaking down income, operating expenses, and debt service to determine the net profit generated every month.
Key Metrics Explained
Effective Gross Income: This is your total expected rental income minus an allowance for vacancy. No property is occupied 100% of the time, so factoring in a vacancy rate (typically 5-8%) provides a realistic income figure.
Operating Expenses: These are the costs required to keep the property running, excluding your mortgage. This includes property taxes, insurance, maintenance, repairs (CapEx budgeting), and property management fees.
Net Operating Income (NOI): This is your income minus operating expenses. However, NOI does not account for debt service (mortgage payments).
Cash Flow: The holy grail of rental investing. This is what remains in your pocket after all expenses, including the mortgage, have been paid. Formula: Income – Expenses – Debt Service = Cash Flow
What is Cash on Cash Return?
While cash flow tells you how much money you make monthly, Cash on Cash Return (CoC) tells you how hard your money is working. It measures the annual return on the actual cash you invested (down payment) rather than the total loan amount.
For example, if you invest $50,000 as a down payment and the property generates $5,000 in positive cash flow per year, your Cash on Cash return is 10%. This metric allows you to compare real estate returns directly against other investment vehicles like stocks or bonds.
What is a "Good" Return?
While targets vary by investor and market, many seasoned real estate investors look for:
Positive Cash Flow: At minimum, the property should pay for itself ($100+ per door per month is a common benchmark).
Cash on Cash Return: 8% to 12% is considered healthy in many markets, though some aggressive investors target 15% or higher.
Use the calculator above to stress-test your numbers. Try increasing the Vacancy Rate or Interest Rate to see if the deal still makes sense in a worst-case scenario.