function calculateROI() {
// Get Inputs
var price = parseFloat(document.getElementById('propPrice').value) || 0;
var downPercent = parseFloat(document.getElementById('downPaymentPercent').value) || 0;
var interest = parseFloat(document.getElementById('interestRate').value) || 0;
var years = parseFloat(document.getElementById('loanTerm').value) || 0;
var closing = parseFloat(document.getElementById('closingCosts').value) || 0;
var rent = parseFloat(document.getElementById('monthlyRent').value) || 0;
var tax = parseFloat(document.getElementById('annualTax').value) || 0;
var insurance = parseFloat(document.getElementById('annualInsurance').value) || 0;
var hoa = parseFloat(document.getElementById('monthlyHOA').value) || 0;
var maint = parseFloat(document.getElementById('monthlyMaintenance').value) || 0;
// Calculations
var downAmount = price * (downPercent / 100);
var loanAmount = price – downAmount;
var totalCashInvested = downAmount + closing;
// Mortgage Calculation
var mortgagePayment = 0;
if (loanAmount > 0) {
if (interest > 0) {
var monthlyRate = interest / 100 / 12;
var numberOfPayments = years * 12;
mortgagePayment = loanAmount * monthlyRate * (Math.pow(1 + monthlyRate, numberOfPayments)) / (Math.pow(1 + monthlyRate, numberOfPayments) – 1);
} else {
mortgagePayment = loanAmount / (years * 12);
}
}
// Monthly Expense Breakdown
var monthlyTax = tax / 12;
var monthlyInsurance = insurance / 12;
var totalMonthlyExpenses = mortgagePayment + monthlyTax + monthlyInsurance + hoa + maint;
// Cash Flow Analysis
var monthlyCashFlow = rent – totalMonthlyExpenses;
var annualCashFlow = monthlyCashFlow * 12;
// ROI Calculation
var roi = 0;
if (totalCashInvested > 0) {
roi = (annualCashFlow / totalCashInvested) * 100;
}
// Display Results
document.getElementById('resTotalCash').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 = '$' + mortgagePayment.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('resTotalExpenses').innerText = '$' + totalMonthlyExpenses.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
var cfElement = document.getElementById('resMonthlyCashFlow');
cfElement.innerText = '$' + monthlyCashFlow.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
if(monthlyCashFlow >= 0) {
cfElement.className = "result-value big-metric positive-cf";
} else {
cfElement.className = "result-value big-metric negative-cf";
}
var annualCfElement = document.getElementById('resAnnualCashFlow');
annualCfElement.innerText = '$' + annualCashFlow.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
if(annualCashFlow >= 0) {
annualCfElement.className = "result-value positive-cf";
} else {
annualCfElement.className = "result-value negative-cf";
}
var roiElement = document.getElementById('resROI');
roiElement.innerText = roi.toFixed(2) + '%';
if(roi >= 0) {
roiElement.className = "result-value big-metric positive-cf";
} else {
roiElement.className = "result-value big-metric negative-cf";
}
// Show result box
document.getElementById('calc-results').style.display = 'block';
}
Understanding Your Rental Property ROI
Investing in real estate is one of the most reliable ways to build wealth, but simply buying a property and renting it out doesn't guarantee a profit. To succeed, investors must accurately calculate their Cash on Cash Return (ROI) and monthly Cash Flow. This Rental Property ROI Calculator is designed to help you analyze potential deals by factoring in all major expenses, including mortgage payments, taxes, insurance, and maintenance costs.
What is Cash on Cash Return?
Cash on Cash Return (CoC ROI) is a metric used to calculate the cash income earned on the cash invested in a property. Unlike standard Return on Investment calculations that might consider the total value of the asset, CoC ROI focuses specifically on the money you actually put down (Down Payment + Closing Costs) versus the net cash flow you receive annually.
Total Cash Invested = Down Payment + Closing Costs
CoC ROI = (Annual Cash Flow / Total Cash Invested) × 100
Why Monthly Cash Flow Matters
While property appreciation (the increase in property value over time) is a great long-term benefit, positive cash flow is what keeps your investment sustainable. Positive cash flow ensures you have money to cover repairs, vacancies, and capital expenditures without dipping into your personal savings. If the "Monthly Cash Flow" result in the calculator above is red (negative), the property is costing you money every month to hold.
Key Inputs Explained
Purchase Price: The negotiated price of the property.
Closing Costs: Fees paid at the closing of a real estate transaction. This usually includes loan origination fees, title insurance, and recording fees. Estimating 2-5% of the purchase price is a safe bet.
Vacancy & Maintenance: While not a fixed bill, you should budget for these. In our calculator, you can enter these estimates in the "Monthly Maintenance Budget" or deduct them from the "Monthly Rental Income" to get a Net figure.
How to Interpret Your Results
A "good" ROI is subjective and depends on your investment strategy and local market. However, many investors aim for a Cash on Cash return of 8% to 12%. This often outperforms the stock market while providing the added benefits of tax deductions and principal paydown. If your calculation shows a return lower than 4-5%, you may want to reconsider the purchase price or find ways to increase rental income.