function calculateRental() {
// 1. Get Values
var price = parseFloat(document.getElementById('purchasePrice').value);
var down = parseFloat(document.getElementById('downPayment').value);
var rate = parseFloat(document.getElementById('interestRate').value);
var term = parseFloat(document.getElementById('loanTerm').value);
var closing = parseFloat(document.getElementById('closingCosts').value);
var rent = parseFloat(document.getElementById('monthlyRent').value);
var taxes = parseFloat(document.getElementById('annualTaxes').value);
var insurance = parseFloat(document.getElementById('annualInsurance').value);
var maint = parseFloat(document.getElementById('monthlyMaintenance').value);
var hoa = parseFloat(document.getElementById('monthlyHOA').value);
// Validation
if (isNaN(price) || isNaN(down) || isNaN(rate) || isNaN(term) || isNaN(rent) || isNaN(taxes) || isNaN(insurance) || isNaN(maint)) {
alert("Please fill in all required fields with valid numbers.");
return;
}
if (isNaN(closing)) closing = 0;
if (isNaN(hoa)) hoa = 0;
// 2. Calculate Mortgage (P&I)
var loanAmount = price – down;
var monthlyRate = (rate / 100) / 12;
var numPayments = term * 12;
var monthlyMortgage = 0;
if (rate === 0) {
monthlyMortgage = loanAmount / numPayments;
} else {
monthlyMortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numPayments)) / (Math.pow(1 + monthlyRate, numPayments) – 1);
}
// 3. Calculate Expenses
var monthlyTax = taxes / 12;
var monthlyIns = insurance / 12;
var totalMonthlyOperatingExpenses = monthlyTax + monthlyIns + maint + hoa; // Excluding Mortgage
var totalMonthlyCost = monthlyMortgage + totalMonthlyOperatingExpenses;
// 4. Calculate Cash Flow
var monthlyCashFlow = rent – totalMonthlyCost;
var annualCashFlow = monthlyCashFlow * 12;
// 5. Calculate NOI (Net Operating Income) -> Rent – Operating Expenses (Excluding Mortgage)
var annualNOI = (rent * 12) – (totalMonthlyOperatingExpenses * 12);
// 6. Calculate Cap Rate -> (NOI / Purchase Price) * 100
var capRate = (annualNOI / price) * 100;
// 7. Calculate Cash on Cash Return -> (Annual Cash Flow / Total Cash Invested) * 100
var totalCashInvested = down + closing;
var cocReturn = (annualCashFlow / totalCashInvested) * 100;
// 8. Update UI
document.getElementById('resMortgage').innerText = "$" + monthlyMortgage.toFixed(2);
document.getElementById('resTotalExpenses').innerText = "$" + totalMonthlyCost.toFixed(2);
var cfElement = document.getElementById('resCashFlow');
cfElement.innerText = "$" + monthlyCashFlow.toFixed(2);
if(monthlyCashFlow >= 0) {
cfElement.className = "result-value positive-cf";
} else {
cfElement.className = "result-value negative-cf";
}
document.getElementById('resNOI').innerText = "$" + annualNOI.toFixed(2);
document.getElementById('resCapRate').innerText = capRate.toFixed(2) + "%";
document.getElementById('resCoC').innerText = cocReturn.toFixed(2) + "%";
// Show results
document.getElementById('result').style.display = "block";
}
Understanding Rental Property ROI
Investing in real estate is one of the most reliable ways to build wealth, but simply buying a property doesn't guarantee profit. To ensure a rental property is a sound investment, you must analyze the numbers accurately. This Rental Property Cash Flow & ROI Calculator helps investors determine the viability of a deal by breaking down monthly income, expenses, and long-term return metrics.
Key Metrics Explained
When evaluating a rental property, there are three critical numbers you need to understand:
Cash Flow: This is your profit after all bills are paid. It is calculated as Monthly Rent – (Mortgage + Taxes + Insurance + Maintenance + HOA). Positive cash flow ensures the property pays for itself and generates income.
Cap Rate (Capitalization Rate): This percentage measures the rate of return on the property based on the income the property generates, independent of financing. It is calculated as (Net Operating Income / Purchase Price) × 100. A higher Cap Rate generally indicates a better return, though it may come with higher risk.
Cash-on-Cash Return (CoC): This is the most important metric for many investors because it measures the return on the actual cash you invested (Down Payment + Closing Costs). It is calculated as (Annual Cash Flow / Total Cash Invested) × 100.
Example Scenario:
Imagine you buy a property for $250,000 with $50,000 down. If your annual cash flow is $4,000, your Cash-on-Cash return is ($4,000 / $50,000) = 8%. This means your money is working for you at an 8% interest rate, potentially higher than a standard savings account or bond.
How to Use This Calculator
To get the most accurate results, ensure you input realistic numbers for all fields:
Purchase Price & Down Payment: Enter the agreed sale price and the cash amount you are putting down.
Loan Details: Input your current mortgage interest rate and the loan term (usually 30 years).
Operating Expenses: Be thorough here. Don't forget to estimate vacancy (usually 5-10% of rent) and maintenance reserves (usually 1% of property value annually) within the "Monthly Maint./Vacancy" field. Underestimating expenses is the #1 mistake new investors make.
What is a "Good" ROI?
While targets vary by market and strategy, many investors look for a Cash-on-Cash return of 8-12%. A Cap Rate of 5-10% is considered healthy in most residential markets. However, in high-appreciation markets (like major coastal cities), investors might accept lower cash flow in exchange for higher property value growth over time.
Use this tool to analyze multiple scenarios—such as raising the rent or negotiating a lower purchase price—to see how they impact your bottom line.