function calculateROI() {
// Get Inputs
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 monthlyExpenses = parseFloat(document.getElementById('monthlyExpenses').value) || 0;
// 1. Calculate Total Cash Invested
// Total Cash = Down Payment + Closing Costs + Rehab Costs
var totalCashInvested = downPayment + closingCosts + rehabCosts;
// 2. Calculate Mortgage Payment
var loanAmount = purchasePrice – downPayment;
var monthlyMortgage = 0;
if (loanAmount > 0 && interestRate > 0 && loanTerm > 0) {
var monthlyRate = (interestRate / 100) / 12;
var numberOfPayments = loanTerm * 12;
// Mortgage 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);
} else if (loanAmount > 0 && interestRate === 0) {
monthlyMortgage = loanAmount / (loanTerm * 12);
}
// 3. Calculate Cash Flow
var totalMonthlyOutflow = monthlyMortgage + monthlyExpenses;
var monthlyCashFlow = monthlyRent – totalMonthlyOutflow;
var annualCashFlow = monthlyCashFlow * 12;
// 4. Calculate Cash on Cash Return
// CoC = (Annual Cash Flow / Total Cash Invested) * 100
var cocReturn = 0;
if (totalCashInvested > 0) {
cocReturn = (annualCashFlow / totalCashInvested) * 100;
}
// Display Results
document.getElementById('resTotalInvested').innerText = '$' + totalCashInvested.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('resLoanAmount').innerText = '$' + loanAmount.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('resMortgage').innerText = '$' + monthlyMortgage.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
var cashFlowEl = document.getElementById('resMonthlyCashflow');
cashFlowEl.innerText = '$' + monthlyCashFlow.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
cashFlowEl.style.color = monthlyCashFlow >= 0 ? '#28a745' : '#dc3545';
var annualEl = document.getElementById('resAnnualCashflow');
annualEl.innerText = '$' + annualCashFlow.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
annualEl.style.color = annualCashFlow >= 0 ? '#28a745' : '#dc3545';
var cocEl = document.getElementById('resCoC');
cocEl.innerText = cocReturn.toFixed(2) + '%';
cocEl.style.color = cocReturn >= 0 ? '#28a745' : '#dc3545';
// Show result div
document.getElementById('results').style.display = 'block';
}
Understanding Cash on Cash Return in Real Estate
For real estate investors, the Cash on Cash (CoC) Return is one of the most critical metrics used to evaluate the profitability of an investment property. Unlike a simple Return on Investment (ROI) calculation that might look at the total value of the asset, CoC specifically measures the annual return the investor made on the property in relation to the amount of mortgage paid during the same year.
How the Calculation Works
The formula for Cash on Cash Return is relatively straightforward but powerful. It is calculated by dividing the annual pre-tax cash flow by the total cash invested.
Cash on Cash Return = (Annual Pre-Tax Cash Flow / Total Cash Invested) x 100%
Annual Cash Flow: This is your gross rental income minus all operating expenses (taxes, insurance, HOA fees, repairs) and debt service (mortgage payments).
Total Cash Invested: This includes your down payment, closing costs, and any initial repair or rehabilitation costs required to get the property rent-ready.
Why Use This Calculator?
This Rental Property Cash on Cash Return Calculator helps investors distinguish between properties that look good on paper versus those that actually generate cash. A property might appreciate in value over time, but if it has a negative cash on cash return, it will cost you money out-of-pocket every month to hold it.
What is a Good Cash on Cash Return?
While "good" is subjective and depends on the investor's strategy and the local market, generally:
8-12%: Often considered a solid return for most residential rental markets.
15%+: Considered excellent, though these deals are harder to find and may carry higher risks or require significant rehabilitation work.
Below 5%: Might be acceptable in high-appreciation markets (like San Francisco or NYC) where the primary goal is long-term equity growth rather than immediate cash flow.
Key Inputs Explained
Purchase Price: The agreed-upon price to buy the property.
Rehab Costs: Money spent immediately after purchase to fix up the property. This is part of your initial cash investment.
Operating Expenses: Be sure to include vacancy rates (typically 5-10% of rent), property management fees (8-10%), and maintenance reserves.