function calculateROI() {
// Get Inputs
var purchasePrice = parseFloat(document.getElementById('purchasePrice').value) || 0;
var closingCosts = parseFloat(document.getElementById('closingCosts').value) || 0;
var rehabCosts = parseFloat(document.getElementById('rehabCosts').value) || 0;
var downPaymentPercent = parseFloat(document.getElementById('downPaymentPercent').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 otherIncome = parseFloat(document.getElementById('otherIncome').value) || 0;
var propertyTax = parseFloat(document.getElementById('propertyTax').value) || 0;
var insurance = parseFloat(document.getElementById('insurance').value) || 0;
var hoaFees = parseFloat(document.getElementById('hoaFees').value) || 0;
var maintenance = parseFloat(document.getElementById('maintenance').value) || 0;
var vacancy = parseFloat(document.getElementById('vacancy').value) || 0;
var management = parseFloat(document.getElementById('management').value) || 0;
// Calculations
var downPaymentAmount = purchasePrice * (downPaymentPercent / 100);
var loanAmount = purchasePrice – downPaymentAmount;
var totalCashInvested = downPaymentAmount + closingCosts + rehabCosts;
// Mortgage Calculation
var monthlyRate = (interestRate / 100) / 12;
var numberOfPayments = loanTerm * 12;
var monthlyMortgage = 0;
if (loanAmount > 0 && interestRate > 0) {
monthlyMortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numberOfPayments)) / (Math.pow(1 + monthlyRate, numberOfPayments) – 1);
} else if (loanAmount > 0 && interestRate === 0) {
monthlyMortgage = loanAmount / numberOfPayments;
}
// Income & Expenses
var totalMonthlyIncome = monthlyRent + otherIncome;
var monthlyOperatingExpenses = propertyTax + insurance + hoaFees + maintenance + vacancy + management;
var totalMonthlyExpenses = monthlyOperatingExpenses + monthlyMortgage;
var monthlyCashFlow = totalMonthlyIncome – totalMonthlyExpenses;
var annualCashFlow = monthlyCashFlow * 12;
// NOI (Net Operating Income) = Income – Operating Expenses (Excludes Mortgage)
var annualNOI = (totalMonthlyIncome – monthlyOperatingExpenses) * 12;
// Returns
var cashOnCashReturn = 0;
if (totalCashInvested > 0) {
cashOnCashReturn = (annualCashFlow / totalCashInvested) * 100;
}
var capRate = 0;
if (purchasePrice > 0) {
capRate = (annualNOI / purchasePrice) * 100;
}
// Format Currency
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
});
// Display Results
document.getElementById('resTotalInvested').innerText = formatter.format(totalCashInvested);
document.getElementById('resMortgage').innerText = formatter.format(monthlyMortgage);
document.getElementById('resExpenses').innerText = formatter.format(totalMonthlyExpenses);
document.getElementById('resMonthlyCashflow').innerText = formatter.format(monthlyCashFlow);
document.getElementById('resAnnualCashflow').innerText = formatter.format(annualCashFlow);
document.getElementById('resNOI').innerText = formatter.format(annualNOI);
document.getElementById('resCapRate').innerText = capRate.toFixed(2) + "%";
document.getElementById('resCoC').innerText = cashOnCashReturn.toFixed(2) + "%";
// Show Results Div
document.getElementById('results').style.display = 'block';
}
How to Use This Rental Property Calculator
Investing in rental properties is one of the most popular strategies for building long-term wealth. However, the difference between a profitable investment and a money pit often comes down to the numbers. This Cash on Cash Return Calculator helps real estate investors accurately forecast the profitability of a potential deal before signing any papers.
What is Cash on Cash Return?
Cash on Cash (CoC) Return is a metric used to calculate the cash income earned on the cash invested in a property. Unlike ROI, which might look at total equity buildup, CoC strictly focuses on the liquid cash flow relative to your initial out-of-pocket expenses.
The formula is:
Cash on Cash Return = (Annual Pre-Tax Cash Flow / Total Cash Invested) × 100
Key Metrics Explained
Net Operating Income (NOI): This is your total annual revenue minus all necessary operating expenses (like taxes, insurance, maintenance). NOI does not include mortgage payments.
Cap Rate: Short for Capitalization Rate, this indicates the potential return of a property if it were bought with all cash. It helps compare properties regardless of financing.
Cash Flow: The net amount of money moving in or out of the business after all expenses, including the mortgage, have been paid. Positive cash flow is the goal for most buy-and-hold investors.
Why Include Vacancy and Maintenance?
New investors often make the mistake of calculating returns based on 100% occupancy and perfect property conditions. In reality, tenants move out, and things break. A conservative analysis includes a provision for Vacancy (often 5-10% of rent) and Maintenance (5-10% of rent) to ensure you have cash reserves when these costs inevitably arise.
What is a Good Cash on Cash Return?
While "good" is subjective, many investors target a Cash on Cash return of 8% to 12% for long-term rentals. In highly competitive markets, investors might accept 4-6% if they are banking on high appreciation. Conversely, in riskier markets with lower appreciation potential, investors may demand 15% or higher returns to justify the risk.
Frequently Asked Questions
Does this calculator factor in appreciation?
No. This calculator focuses on cash flow. Appreciation is speculative, while cash flow is a tangible realization of income. Most conservative investors treat appreciation as the "icing on the cake."
How do I estimate closing costs?
Closing costs typically range from 2% to 5% of the purchase price. This covers title fees, recording fees, lender fees, and pre-paid items like insurance and taxes.