function calculateCoC() {
// 1. Retrieve Input Values
var price = 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 rate = parseFloat(document.getElementById('interestRate').value) || 0;
var term = parseFloat(document.getElementById('loanTerm').value) || 0;
var rent = parseFloat(document.getElementById('monthlyRent').value) || 0;
var otherExpenses = parseFloat(document.getElementById('monthlyExpenses').value) || 0;
// 2. Calculate Initial Investment (Denominator)
var totalInvested = downPayment + closingCosts + rehabCosts;
// 3. Calculate Mortgage Payment
var loanAmount = price – downPayment;
var monthlyMortgage = 0;
if (loanAmount > 0 && term > 0) {
if (rate > 0) {
var monthlyRate = (rate / 100) / 12;
var numberOfPayments = term * 12;
// 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 0% interest rate
monthlyMortgage = loanAmount / (term * 12);
}
}
// 4. Calculate Cash Flow
var totalMonthlyExpenses = monthlyMortgage + otherExpenses;
var monthlyCashFlow = rent – totalMonthlyExpenses;
var annualCashFlow = monthlyCashFlow * 12;
// 5. Calculate Cash on Cash Return
var cocReturn = 0;
if (totalInvested > 0) {
cocReturn = (annualCashFlow / totalInvested) * 100;
}
// 6. Display Results
document.getElementById('resTotalInvested').innerText = "$" + totalInvested.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('resMortgage').innerText = "$" + monthlyMortgage.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('resTotalExpenses').innerText = "$" + totalMonthlyExpenses.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
// Color coding for cash flow
var mcfElement = document.getElementById('resMonthlyCashFlow');
mcfElement.innerText = "$" + monthlyCashFlow.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
mcfElement.style.color = monthlyCashFlow >= 0 ? "#27ae60" : "#c0392b";
var acfElement = document.getElementById('resAnnualCashFlow');
acfElement.innerText = "$" + annualCashFlow.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
acfElement.style.color = annualCashFlow >= 0 ? "#27ae60" : "#c0392b";
var cocElement = document.getElementById('resCoC');
cocElement.innerText = cocReturn.toFixed(2) + "%";
cocElement.style.color = cocReturn >= 0 ? "#27ae60" : "#c0392b";
// Show results container
document.getElementById('resultsContainer').style.display = "block";
}
What is Cash on Cash Return?
Cash on Cash Return (CoC) is one of the most important metrics for real estate investors. Unlike generic Return on Investment (ROI) calculations that might look at the total value of the asset, Cash on Cash Return measures the annual cash income earned on the cash you actually invested.
It answers the fundamental question: "For every dollar I put into this deal out of my own pocket, how much cash will I get back this year?"
The Cash on Cash Return Formula
The formula used in this calculator is straightforward but powerful:
Annual Cash Flow: This is your gross rental income minus all operating expenses and mortgage payments (Principal & Interest).
Total Cash Invested: This includes your Down Payment, Closing Costs, and any immediate Rehab or Repair costs.
Why is CoC Better Than ROI for Rentals?
In real estate, leverage (using a mortgage) is key. If you buy a $200,000 house with $40,000 down, your ROI based on the home price might look low. However, your Cash on Cash return is calculated based on the $40,000 you actually spent. This metric gives you a true picture of your money's efficiency compared to putting that same $40,000 into the stock market or a savings account.
What is a "Good" Cash on Cash Return?
Target returns vary by investor strategy and location, but general benchmarks include:
8% – 12%: Generally considered a solid return for most buy-and-hold residential investors.
15%+: Excellent returns, often found in higher-risk neighborhoods, short-term rentals (Airbnb), or properties requiring significant "sweat equity" (BRRRR strategy).
Below 5%: In high-appreciation markets (like Los Angeles or NYC), investors might accept lower cash returns in exchange for long-term property value growth.
Example Calculation
Let's say you purchase a property for $150,000.
Down Payment: $30,000
Closing & Repairs: $5,000
Total Invested: $35,000
If the property rents for $1,500/month and your total expenses (mortgage + taxes + insurance + vacancy) are $1,100/month:
Monthly Cash Flow: $400
Annual Cash Flow: $4,800
CoC Return: ($4,800 / $35,000) = 13.7%
This calculator helps you run these numbers quickly to filter out bad deals and focus on the profitable ones.