function calculateRental() {
// 1. Get Input Values
var price = parseFloat(document.getElementById("purchasePrice").value) || 0;
var downPercent = parseFloat(document.getElementById("downPayment").value) || 0;
var rate = parseFloat(document.getElementById("interestRate").value) || 0;
var years = parseFloat(document.getElementById("loanTerm").value) || 0;
var monthlyRent = parseFloat(document.getElementById("monthlyRent").value) || 0;
var annualTax = parseFloat(document.getElementById("propertyTax").value) || 0;
var annualIns = parseFloat(document.getElementById("insurance").value) || 0;
var monthlyMaint = parseFloat(document.getElementById("maintenance").value) || 0;
// 2. Calculate Mortgage (Principal & Interest)
var downAmount = price * (downPercent / 100);
var loanAmount = price – downAmount;
var monthlyRate = rate / 100 / 12;
var numberOfPayments = years * 12;
var monthlyMortgage = 0;
if (rate > 0 && years > 0) {
monthlyMortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numberOfPayments)) / (Math.pow(1 + monthlyRate, numberOfPayments) – 1);
} else if (rate === 0 && years > 0) {
monthlyMortgage = loanAmount / numberOfPayments;
}
// 3. Calculate Expenses
var monthlyTax = annualTax / 12;
var monthlyIns = annualIns / 12;
var totalMonthlyExpenses = monthlyMortgage + monthlyTax + monthlyIns + monthlyMaint;
// 4. Calculate Metrics
var monthlyCashFlow = monthlyRent – totalMonthlyExpenses;
var annualCashFlow = monthlyCashFlow * 12;
// Net Operating Income (NOI) = Income – Operating Expenses (Excluding Mortgage)
var annualOperatingExpenses = annualTax + annualIns + (monthlyMaint * 12);
var annualNOI = (monthlyRent * 12) – annualOperatingExpenses;
var capRate = 0;
if (price > 0) {
capRate = (annualNOI / price) * 100;
}
var cashOnCash = 0;
if (downAmount > 0) {
cashOnCash = (annualCashFlow / downAmount) * 100; // Simplified, assuming no closing costs for basic calc
}
// 5. Update UI
document.getElementById("resMortgage").innerText = "$" + monthlyMortgage.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
document.getElementById("resTotalExp").innerText = "$" + totalMonthlyExpenses.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
var cashFlowEl = document.getElementById("resCashFlow");
cashFlowEl.innerText = "$" + monthlyCashFlow.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
if (monthlyCashFlow >= 0) {
cashFlowEl.className = "result-value highlight-value";
} else {
cashFlowEl.className = "result-value highlight-value negative-value";
}
document.getElementById("resNOI").innerText = "$" + annualNOI.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
document.getElementById("resCapRate").innerText = capRate.toFixed(2) + "%";
var cocEl = document.getElementById("resCoC");
cocEl.innerText = cashOnCash.toFixed(2) + "%";
if (cashOnCash < 0) cocEl.style.color = "#dc3545";
else cocEl.style.color = "#333";
document.getElementById("calc-results").style.display = "block";
}
Understanding Your Rental Property Investment
Investing in real estate is one of the most reliable ways to build long-term wealth, but success depends entirely on the numbers. This Rental Property Cash Flow Calculator helps you analyze potential deals by breaking down income, expenses, and critical return metrics.
How to Calculate Rental Property Cash Flow
Cash flow is the net amount of money moving in or out of your rental business each month. It is calculated using the following formula:
Cash Flow = Gross Rental Income – Total Expenses
Total expenses must include not just your mortgage payment, but also property taxes, insurance, HOA fees, maintenance reserves, and vacancy allowances. A positive cash flow indicates a profitable month-to-month operation, while negative cash flow means the property costs you money to hold.
Key Investment Metrics Explained
1. Net Operating Income (NOI)
NOI calculates the profitability of a property before adding in leverage (loans). It helps you compare the performance of different properties regardless of how they are financed. The formula is:
NOI = Annual Rental Income – Operating Expenses (excluding mortgage payments)
2. Cap Rate (Capitalization Rate)
The Cap Rate measures the natural rate of return on the investment assuming you bought it in cash. It is a standard industry metric to assess risk and value. Higher cap rates generally imply higher returns but may come with higher risks (e.g., properties in less desirable neighborhoods).
Cap Rate = (NOI / Purchase Price) x 100
3. Cash on Cash Return
This is arguably the most important metric for leveraged investors. It measures the annual return on the actual cash you invested (down payment + closing costs), rather than the total property value.
CoC Return = (Annual Cash Flow / Total Cash Invested) x 100
For example, if you invest $50,000 as a down payment and the property generates $5,000 in net cash flow per year, your Cash on Cash return is 10%.
What is a Good Rental Property Return?
While "good" is subjective, many investors aim for:
Cash Flow: $100 – $300 per door, per month.
Cash on Cash Return: 8% to 12% is considered healthy in many markets; anything above 15% is excellent.
Cap Rate: 4% to 6% in high-demand urban areas, and 7% to 10% in secondary markets.
Use the calculator above to adjust your offer price, down payment, or expected rent to see how different scenarios affect your bottom line.