function calculateRentalROI() {
// 1. Get Input Values
var price = parseFloat(document.getElementById('rpc-purchase-price').value) || 0;
var downPayment = parseFloat(document.getElementById('rpc-down-payment').value) || 0;
var rate = parseFloat(document.getElementById('rpc-interest-rate').value) || 0;
var years = parseFloat(document.getElementById('rpc-loan-term').value) || 0;
var closingCosts = parseFloat(document.getElementById('rpc-closing-costs').value) || 0;
var monthlyRent = parseFloat(document.getElementById('rpc-monthly-rent').value) || 0;
var vacancyRate = parseFloat(document.getElementById('rpc-vacancy-rate').value) || 0;
var maintRate = parseFloat(document.getElementById('rpc-maintenance-rate').value) || 0;
var mgmtRate = parseFloat(document.getElementById('rpc-mgmt-fee').value) || 0;
var annualTax = parseFloat(document.getElementById('rpc-prop-tax').value) || 0;
var annualIns = parseFloat(document.getElementById('rpc-insurance').value) || 0;
var monthlyHOA = parseFloat(document.getElementById('rpc-hoa').value) || 0;
// 2. Calculate Mortgage Payment
var loanAmount = price – downPayment;
var monthlyRate = (rate / 100) / 12;
var numberOfPayments = years * 12;
var monthlyMortgage = 0;
if (rate > 0 && years > 0 && loanAmount > 0) {
// Formula: M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1 ]
monthlyMortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numberOfPayments)) / (Math.pow(1 + monthlyRate, numberOfPayments) – 1);
}
// 3. Calculate Monthly Expenses
var monthlyTax = annualTax / 12;
var monthlyIns = annualIns / 12;
var vacancyCost = monthlyRent * (vacancyRate / 100);
var maintCost = monthlyRent * (maintRate / 100);
var mgmtCost = monthlyRent * (mgmtRate / 100);
var totalMonthlyExpenses = monthlyTax + monthlyIns + monthlyHOA + vacancyCost + maintCost + mgmtCost;
// 4. Calculate Cash Flow
var totalOutflow = totalMonthlyExpenses + monthlyMortgage;
var monthlyCashFlow = monthlyRent – totalOutflow;
var annualCashFlow = monthlyCashFlow * 12;
// 5. Calculate NOI (Net Operating Income) -> Gross Income – Operating Expenses (No Mortgage)
// Gross Operating Income = Rent – Vacancy
var grossOperatingIncome = (monthlyRent * 12) – (vacancyCost * 12);
var operatingExpensesAnnual = (totalMonthlyExpenses * 12) – (vacancyCost * 12); // Remove vacancy from expenses formula if deducted from gross, but simplified here:
// Standard NOI: (Monthly Rent * 12) – (Vacancy + Maint + Mgmt + Tax + Ins + HOA) * 12
// Note: Mortgage is NOT an operating expense
var annualNOI = (monthlyRent * 12) – (totalMonthlyExpenses * 12);
// 6. Calculate Returns
var totalCashInvested = downPayment + closingCosts;
var cashOnCash = 0;
if (totalCashInvested > 0) {
cashOnCash = (annualCashFlow / totalCashInvested) * 100;
}
var capRate = 0;
if (price > 0) {
capRate = (annualNOI / price) * 100;
}
// 7. Update UI
document.getElementById('rpc-res-cashflow').innerText = formatCurrency(monthlyCashFlow);
document.getElementById('rpc-res-noi').innerText = formatCurrency(annualNOI);
document.getElementById('rpc-res-mortgage').innerText = formatCurrency(monthlyMortgage);
document.getElementById('rpc-res-expenses').innerText = formatCurrency(totalMonthlyExpenses);
document.getElementById('rpc-res-coc').innerText = cashOnCash.toFixed(2) + '%';
document.getElementById('rpc-res-cap').innerText = capRate.toFixed(2) + '%';
// Styling logic for positive/negative cash flow
var cfMetric = document.getElementById('rpc-cashflow-metric');
if (monthlyCashFlow >= 0) {
cfMetric.classList.remove('negative');
cfMetric.classList.add('highlight');
} else {
cfMetric.classList.remove('highlight');
cfMetric.classList.add('negative');
}
document.getElementById('rpc-results').style.display = 'block';
}
function formatCurrency(num) {
return '$' + num.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
}
Understanding Rental Property Analysis
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 analyze the numbers thoroughly. This Rental Property Calculator helps you evaluate the profitability of a potential investment by breaking down cash flow, Cap Rate, and Cash on Cash Return.
Key Metrics Explained
1. Monthly Cash Flow
Cash flow is the profit remaining after all expenses and mortgage payments are paid. Positive cash flow means the property pays for itself and provides income. Negative cash flow implies you must contribute money every month to keep the property running. Our calculator deducts the mortgage (P&I), property taxes, insurance, HOA fees, and allowances for vacancy and maintenance from your rental income.
2. Net Operating Income (NOI)
NOI is a critical metric used to value real estate. It represents the annual income generated by the property after operating expenses are deducted, but before mortgage payments and income taxes. A higher NOI indicates a more profitable property operationally.
3. Cap Rate (Capitalization Rate)
The Cap Rate measures the natural rate of return on the property independent of financing. It is calculated by dividing the NOI by the purchase price. Formula: Cap Rate = NOI / Purchase Price. Investors use this to compare properties; a higher Cap Rate generally indicates a better return, though often with higher risk.
4. Cash on Cash Return (CoC)
While Cap Rate looks at the property, Cash on Cash Return looks at your specific investment. It measures the annual cash flow relative to the actual cash you put into the deal (Down Payment + Closing Costs). This is often considered the most important metric for investors using leverage (mortgages), as it shows the efficiency of their capital.
How to Use This Calculator
Enter your purchase details, loan terms, and projected operating expenses. Be realistic with your "Vacancy Rate" (typically 5-8%) and "Maintenance" estimates (typically 5-10% of rent). The calculator will instantly generate the metrics you need to decide if the deal makes sense for your portfolio.