function calculateCashFlow() {
// 1. Get Inputs
var price = parseFloat(document.getElementById("purchasePrice").value) || 0;
var down = parseFloat(document.getElementById("downPayment").value) || 0;
var rate = parseFloat(document.getElementById("interestRate").value) || 0;
var term = parseFloat(document.getElementById("loanTerm").value) || 30;
var closing = parseFloat(document.getElementById("closingCosts").value) || 0;
var rent = parseFloat(document.getElementById("monthlyRent").value) || 0;
var taxYearly = parseFloat(document.getElementById("propertyTax").value) || 0;
var insYearly = parseFloat(document.getElementById("insurance").value) || 0;
var hoaMonthly = parseFloat(document.getElementById("hoa").value) || 0;
var maintPercent = parseFloat(document.getElementById("maintenance").value) || 0;
// 2. Calculate Mortgage
var loanAmount = price – down;
var monthlyRate = rate / 100 / 12;
var numPayments = term * 12;
var mortgagePayment = 0;
if (rate > 0) {
mortgagePayment = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numPayments)) / (Math.pow(1 + monthlyRate, numPayments) – 1);
} else {
mortgagePayment = loanAmount / numPayments;
}
// 3. Calculate Expenses
var taxMonthly = taxYearly / 12;
var insMonthly = insYearly / 12;
var maintMonthly = rent * (maintPercent / 100);
var totalOperatingExpenses = taxMonthly + insMonthly + hoaMonthly + maintMonthly;
var totalExpenses = mortgagePayment + totalOperatingExpenses;
// 4. Calculate Returns
var cashFlow = rent – totalExpenses;
var annualCashFlow = cashFlow * 12;
var totalInvestment = down + closing;
// NOI (Net Operating Income) = Income – Operating Expenses (excluding mortgage)
var noiMonthly = rent – totalOperatingExpenses;
var noiAnnual = noiMonthly * 12;
// Cash on Cash Return = Annual Cash Flow / Total Cash Invested
var cocReturn = 0;
if (totalInvestment > 0) {
cocReturn = (annualCashFlow / totalInvestment) * 100;
}
// Cap Rate = Annual NOI / Purchase Price
var capRate = 0;
if (price > 0) {
capRate = (noiAnnual / price) * 100;
}
// 5. Display Results
document.getElementById("resultsArea").style.display = "block";
document.getElementById("displayMortgage").innerText = "$" + mortgagePayment.toFixed(2);
document.getElementById("displayTotalExpenses").innerText = "$" + totalExpenses.toFixed(2);
document.getElementById("displayNOI").innerText = "$" + noiMonthly.toFixed(2);
var cfElement = document.getElementById("displayCashFlow");
cfElement.innerText = "$" + cashFlow.toFixed(2);
// Color coding for cash flow
if (cashFlow >= 0) {
cfElement.style.color = "#27ae60"; // Green
} else {
cfElement.style.color = "#c0392b"; // Red
}
document.getElementById("displayCoC").innerText = cocReturn.toFixed(2) + "%";
document.getElementById("displayCapRate").innerText = capRate.toFixed(2) + "%";
}
Mastering Rental Property Analysis: Cash Flow & ROI
Investing in rental real estate is one of the most proven pathways to building long-term wealth. However, the difference between a profitable asset and a financial burden lies entirely in the numbers. This Rental Property Cash Flow Calculator helps investors accurately predict the profitability of a potential purchase before signing any contracts.
Why Cash Flow is King
Cash flow is the net profit you pocket each month after all expenses are paid. It is calculated by subtracting your total monthly expenses (mortgage, taxes, insurance, maintenance, HOA) from your gross monthly rental income. Positive cash flow ensures that the property pays for itself and provides you with passive income.
Our calculator breaks down these expenses to give you a realistic picture of your "Net Operating Income" (NOI) and final "Cash Flow".
Understanding Key Metrics
Net Operating Income (NOI): This is your profitability before debt service (mortgage). It helps you compare the performance of different properties regardless of financing structures.
Cash on Cash Return (CoC): This is arguably the most important metric for investors. It measures the annual return on the actual cash you invested (down payment + closing costs), rather than the total price of the home. A CoC return of 8-12% is generally considered a strong benchmark in many markets.
Cap Rate (Capitalization Rate): This percentage indicates the rate of return on a real estate investment property based on the income that the property is expected to generate, assuming the property was bought with cash.
How to Use This Calculator
To get the most accurate results, ensure you input not just the mortgage details, but also realistic estimates for maintenance and vacancy. A common rule of thumb is to set aside 5% to 10% of monthly rent for maintenance and another 5% for vacancy, ensuring you have reserves when repairs are needed or tenants move out.
Scenario Example
Imagine purchasing a property for $250,000 with $50,000 down. If the property rents for $2,500 per month, but your total expenses (mortgage + operations) are $2,200, your monthly cash flow is $300. This equates to $3,600 per year. If your total initial cash investment was $55,000 (down payment + closing costs), your Cash on Cash return would be roughly 6.5%.