function calculateRentalROI() {
// 1. Get Input Values
var purchasePrice = parseFloat(document.getElementById('purchasePrice').value) || 0;
var downPayment = parseFloat(document.getElementById('downPayment').value) || 0;
var closingCosts = parseFloat(document.getElementById('closingCosts').value) || 0;
var rehabCosts = parseFloat(document.getElementById('rehabCosts').value) || 0;
var interestRate = parseFloat(document.getElementById('interestRate').value) || 0;
var loanTerm = parseFloat(document.getElementById('loanTerm').value) || 0;
var monthlyRent = parseFloat(document.getElementById('monthlyRent').value) || 0;
var annualTaxes = parseFloat(document.getElementById('annualTaxes').value) || 0;
var annualInsurance = parseFloat(document.getElementById('annualInsurance').value) || 0;
var hoaFees = parseFloat(document.getElementById('hoaFees').value) || 0;
var vacancyRate = parseFloat(document.getElementById('vacancyRate').value) || 0;
var maintenanceRate = parseFloat(document.getElementById('maintenanceRate').value) || 0;
var mgmtFee = parseFloat(document.getElementById('mgmtFee').value) || 0;
// 2. Calculate Initial Investment
var totalInitialInvestment = downPayment + closingCosts + rehabCosts;
// 3. Calculate Mortgage Payment (P&I)
var loanAmount = purchasePrice – downPayment;
var monthlyRate = (interestRate / 100) / 12;
var numberOfPayments = loanTerm * 12;
var monthlyMortgage = 0;
if (loanAmount > 0 && interestRate > 0 && loanTerm > 0) {
monthlyMortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numberOfPayments)) / (Math.pow(1 + monthlyRate, numberOfPayments) – 1);
} else if (loanAmount > 0 && interestRate === 0) {
monthlyMortgage = loanAmount / numberOfPayments;
}
// 4. Calculate Monthly Expenses
var monthlyTaxes = annualTaxes / 12;
var monthlyInsurance = annualInsurance / 12;
var monthlyVacancy = monthlyRent * (vacancyRate / 100);
var monthlyMaintenance = monthlyRent * (maintenanceRate / 100);
var monthlyMgmt = monthlyRent * (mgmtFee / 100);
var totalOperatingExpenses = monthlyTaxes + monthlyInsurance + hoaFees + monthlyVacancy + monthlyMaintenance + monthlyMgmt;
var totalExpenses = totalOperatingExpenses + monthlyMortgage;
// 5. Calculate Metrics
var monthlyCashFlow = monthlyRent – totalExpenses;
var annualCashFlow = monthlyCashFlow * 12;
// Net Operating Income (NOI) = Income – Operating Expenses (excluding mortgage)
var annualNOI = (monthlyRent * 12) – (totalOperatingExpenses * 12);
// Cap Rate = (NOI / Purchase Price) * 100
var capRate = 0;
if (purchasePrice > 0) {
capRate = (annualNOI / purchasePrice) * 100;
}
// Cash on Cash Return = (Annual Cash Flow / Total Initial Investment) * 100
var cocReturn = 0;
if (totalInitialInvestment > 0) {
cocReturn = (annualCashFlow / totalInitialInvestment) * 100;
}
// 6. Update UI
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2
});
document.getElementById('cocResult').innerText = cocReturn.toFixed(2) + "%";
document.getElementById('cocResult').style.color = cocReturn >= 0 ? "#2ecc71" : "#e74c3c"; // Green for positive, red for negative
document.getElementById('monthlyCashFlow').innerText = formatter.format(monthlyCashFlow);
document.getElementById('monthlyCashFlow').style.color = monthlyCashFlow >= 0 ? "#2ecc71" : "#e74c3c";
document.getElementById('noiAnnual').innerText = formatter.format(annualNOI);
document.getElementById('capRate').innerText = capRate.toFixed(2) + "%";
document.getElementById('totalInvestment').innerText = formatter.format(totalInitialInvestment);
document.getElementById('mortgagePayment').innerText = formatter.format(monthlyMortgage);
document.getElementById('totalMonthlyExpenses').innerText = formatter.format(totalExpenses);
// Show results box
document.getElementById('results').style.display = "block";
}
Why Use a Cash on Cash Return Calculator?
Real estate investing is all about the numbers. While "gut feelings" might help you pick a neighborhood, they won't pay the bills. This Rental Property ROI Calculator focuses specifically on the two most critical metrics for buy-and-hold investors: Cash on Cash Return and Cap Rate.
What is Cash on Cash Return?
Cash on Cash (CoC) Return measures the annual return on the actual cash you invested, rather than the total purchase price of the property. It is the most practical metric for investors using leverage (mortgages).
Formula: Annual Cash Flow / Total Cash Invested
For example, if you buy a $200,000 property but only put $50,000 down (including closing costs) and it generates $5,000 in net profit per year, your Cash on Cash return is 10%. This is often a better metric than "ROI" for real estate because it accounts for the power of leverage.
Understanding Cap Rate vs. Cash on Cash
While CoC Return tells you how hard your specific dollars are working, the Capitalization Rate (Cap Rate) tells you how good the deal is in isolation, regardless of how you pay for it.
Cap Rate: Calculates return as if you paid 100% cash. It's useful for comparing properties against one another.
Cash on Cash: Calculates return based on your financing strategy. It's useful for comparing the investment against your other opportunities (like stocks or bonds).
How to Improve Your ROI
If the calculator shows a negative or low return, consider adjusting these variables:
Purchase Price: Can you negotiate a lower price to reduce the mortgage payment?
Rent: Are current rents under market value? Can minor renovations justify a rent increase?
Management Fees: Can you self-manage the property to save the 8-10% fee?
Vacancy Rate: Is the area in high demand? Lowering your estimated vacancy from 8% to 5% can significantly boost cash flow.
Common Expenses Often Overlooked
Novice investors often fail because they underestimate expenses. This calculator includes fields for Vacancy (months the property sits empty), Maintenance (broken toilets, roof repairs), and CapEx (Capital Expenditures). A "1% Rule" deal might look great on paper until you factor in a 10% property management fee and 8% for maintenance reserves. Always be conservative with your expense estimates.