function calculateROI() {
// 1. Get DOM elements
var priceInput = document.getElementById('purchasePrice');
var downInput = document.getElementById('downPayment');
var closingInput = document.getElementById('closingCosts');
var rateInput = document.getElementById('interestRate');
var termInput = document.getElementById('loanTerm');
var rentInput = document.getElementById('monthlyRent');
var expensesInput = document.getElementById('monthlyExpenses');
var resultsDiv = document.getElementById('results');
var errorDiv = document.getElementById('errorDisplay');
// 2. Parse values
var price = parseFloat(priceInput.value);
var down = parseFloat(downInput.value);
var closing = parseFloat(closingInput.value);
var rate = parseFloat(rateInput.value);
var term = parseFloat(termInput.value);
var rent = parseFloat(rentInput.value);
var opExpenses = parseFloat(expensesInput.value);
// 3. Validation
if (isNaN(price) || isNaN(down) || isNaN(closing) || isNaN(rate) || isNaN(term) || isNaN(rent) || isNaN(opExpenses)) {
errorDiv.style.display = 'block';
resultsDiv.style.display = 'none';
return;
}
if (term 0) {
cocReturn = (annualCashFlow / totalInvested) * 100;
}
// 5. Display Results
document.getElementById('resTotalInvested').innerText = "$" + totalInvested.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('resMortgage').innerText = "$" + mortgagePayment.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('resTotalMonthly').innerText = "$" + totalMonthlyExpenses.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
var monthlyFlowEl = document.getElementById('resMonthlyCashFlow');
monthlyFlowEl.innerText = "$" + monthlyCashFlow.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
monthlyFlowEl.style.color = monthlyCashFlow >= 0 ? "#2f9e44" : "#e03131";
var annualFlowEl = document.getElementById('resAnnualCashFlow');
annualFlowEl.innerText = "$" + annualCashFlow.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
annualFlowEl.style.color = annualCashFlow >= 0 ? "#2f9e44" : "#e03131";
var cocEl = document.getElementById('resCOC');
cocEl.innerText = cocReturn.toFixed(2) + "%";
cocEl.style.color = cocReturn >= 0 ? "#228be6" : "#e03131";
resultsDiv.style.display = 'block';
}
Understanding Cash on Cash Return in Real Estate Investing
When investing in rental properties, determining the profitability of an asset is crucial before signing any contracts. While metrics like "Cap Rate" and "ROI" are frequently used, Cash on Cash (CoC) Return is widely considered the most practical metric for investors who finance their purchases.
What is Cash on Cash Return?
Cash on Cash Return measures the annual pre-tax cash flow of a property relative to the total amount of cash invested. Unlike standard ROI, which might look at the total value of the asset, CoC specifically focuses on the liquidity and efficiency of the actual dollars you put into the deal.
The formula used in our calculator is:
Cash on Cash Return = (Annual Pre-Tax Cash Flow / Total Cash Invested) × 100
Key Inputs Explained
Purchase Price: The agreed-upon selling price of the property.
Down Payment: The cash portion paid upfront to secure the mortgage (usually 20-25% for investment properties).
Closing & Rehab Costs: Often overlooked, these include title fees, inspections, and immediate repairs needed to make the unit rentable. This is "sunk cash" needed to start the investment.
Operating Expenses: These are recurring monthly costs including property taxes, landlord insurance, HOA fees, property management fees (usually 8-10% of rent), and a maintenance reserve fund.
What is a Good Cash on Cash Return?
There is no universal "good" number, as it depends on the risk profile of the neighborhood and the economy. However, general benchmarks for real estate investors are:
8-12%: Generally considered a solid return in stable markets.
15%+: Excellent return, often found in higher-risk neighborhoods or through value-add strategies (renovating).
Below 5%: Might be acceptable if the property is in a high-appreciation area (betting on future value rather than current cash flow).
Why Use This Metric?
The Cash on Cash metric is essential because it tells you how hard your money is working. If you can get a 5% return in a completely passive high-yield savings account, purchasing a rental property that yields only 3% CoC return (with all the headaches of being a landlord) makes little financial sense unless appreciation is significant.
Use the calculator above to run scenarios. Try adjusting the Monthly Rent or negotiating a lower Purchase Price to see how these changes impact your bottom line percentage.