function calculateMortgageEstimate() {
// Optional: Helper to autofill down payment as 20% if empty
var price = parseFloat(document.getElementById('purchasePrice').value);
var downInput = document.getElementById('downPayment');
if (!isNaN(price) && downInput.value === "") {
downInput.value = (price * 0.20).toFixed(0);
}
}
function calculateCoC() {
// 1. Get Inputs
var price = parseFloat(document.getElementById('purchasePrice').value) || 0;
var down = parseFloat(document.getElementById('downPayment').value) || 0;
var closing = parseFloat(document.getElementById('closingCosts').value) || 0;
var rehab = parseFloat(document.getElementById('rehabCosts').value) || 0;
var rate = parseFloat(document.getElementById('interestRate').value) || 0;
var term = parseFloat(document.getElementById('loanTerm').value) || 30;
var rent = parseFloat(document.getElementById('monthlyRent').value) || 0;
var opsExpenses = parseFloat(document.getElementById('monthlyExpenses').value) || 0;
// 2. Calculate Initial Investment (Denominator)
var totalCashInvested = down + closing + rehab;
// 3. Calculate Mortgage Payment
var loanAmount = price – down;
var monthlyMortgage = 0;
if (loanAmount > 0 && rate > 0) {
var monthlyRate = (rate / 100) / 12;
var numPayments = term * 12;
monthlyMortgage = (loanAmount * monthlyRate) / (1 – Math.pow(1 + monthlyRate, -numPayments));
} else if (loanAmount > 0 && rate === 0) {
monthlyMortgage = loanAmount / (term * 12);
}
// 4. Calculate Cash Flow
var totalMonthlyExpenses = monthlyMortgage + opsExpenses;
var monthlyCashFlow = rent – totalMonthlyExpenses;
var annualCashFlow = monthlyCashFlow * 12;
// 5. Calculate Cash on Cash Return
var cocReturn = 0;
if (totalCashInvested > 0) {
cocReturn = (annualCashFlow / totalCashInvested) * 100;
}
// 6. Update UI
var resultsDiv = document.getElementById('resultsArea');
resultsDiv.style.display = 'block';
// Format Currency
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
});
document.getElementById('resTotalCash').innerText = formatter.format(totalCashInvested);
document.getElementById('resMortgage').innerText = formatter.format(monthlyMortgage);
document.getElementById('resTotalExpenses').innerText = formatter.format(totalMonthlyExpenses);
var monthCFEl = document.getElementById('resMonthlyCashFlow');
monthCFEl.innerText = formatter.format(monthlyCashFlow);
monthCFEl.className = monthlyCashFlow >= 0 ? "result-value highlight-good" : "result-value highlight-bad";
var annualCFEl = document.getElementById('resAnnualCashFlow');
annualCFEl.innerText = formatter.format(annualCashFlow);
annualCFEl.className = annualCashFlow >= 0 ? "result-value highlight-good" : "result-value highlight-bad";
var cocEl = document.getElementById('resCoC');
cocEl.innerText = cocReturn.toFixed(2) + "%";
// Color coding for ROI
if (cocReturn >= 12) {
cocEl.style.color = "#28a745"; // Green
} else if (cocReturn >= 6) {
cocEl.style.color = "#2c7be5"; // Blue
} else if (cocReturn > 0) {
cocEl.style.color = "#ffc107"; // Orange/Yellow
} else {
cocEl.style.color = "#dc3545"; // Red
}
}
What is Cash on Cash Return?
Cash on Cash Return (CoC) is one of the most important metrics for real estate investors. Unlike a standard Return on Investment (ROI) calculation which might look at the total value of the asset, CoC specifically measures the annual return on the actual cash you invested in the property.
It answers the question: "For every dollar I put into this deal, how much cash does it put back in my pocket this year?"
How the Formula Works
The formula for Cash on Cash Return is relatively simple but powerful:
Cash on Cash Return = (Annual Pre-Tax Cash Flow / Total Cash Invested) × 100%
Key Components of the Calculation
Annual Cash Flow: This is your Gross Rental Income minus ALL expenses. This includes mortgage payments (principal and interest), taxes, insurance, HOA fees, vacancy reserves, and maintenance costs.
Total Cash Invested: This is the total liquid capital you used to acquire the property. It includes your Down Payment, Closing Costs, and any immediate Rehab or Repair costs. Do not include the loan amount here.
Example Scenario
Let's say you buy a property using the calculator above with the following numbers:
Purchase Price: $200,000
Down Payment: $40,000 (20%)
Closing & Rehab Costs: $10,000
Total Cash Invested: $50,000
If after paying your mortgage and all expenses, the property generates $4,000 in profit (cash flow) for the year:
($4,000 / $50,000) = 0.08 or 8% Cash on Cash Return.
What is a Good Cash on Cash Return?
While "good" is subjective, most real estate investors look for a CoC return between 8% and 12%. In highly competitive markets, investors might accept 5-7% anticipating appreciation, while in riskier markets, investors may demand 15% or higher.
Use this calculator to analyze potential rental properties quickly and ensure your money is working as hard as possible for you.