function calculateCashFlow() {
var purchasePrice = parseFloat(document.getElementById('purchasePrice').value);
var downPaymentPercent = parseFloat(document.getElementById('downPaymentPercent').value);
var interestRate = parseFloat(document.getElementById('interestRate').value);
var loanTerm = parseFloat(document.getElementById('loanTerm').value);
var monthlyRent = parseFloat(document.getElementById('monthlyRent').value);
var monthlyOperatingExpenses = parseFloat(document.getElementById('monthlyOperatingExpenses').value);
if (isNaN(purchasePrice) || isNaN(downPaymentPercent) || isNaN(interestRate) || isNaN(loanTerm) || isNaN(monthlyRent) || isNaN(monthlyOperatingExpenses) || loanTerm 0) {
monthlyMortgage = loanAmount * (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, totalPayments)) / (Math.pow(1 + monthlyInterestRate, totalPayments) – 1);
} else {
monthlyMortgage = loanAmount / totalPayments;
}
var totalMonthlyOutflow = monthlyMortgage + monthlyOperatingExpenses;
var monthlyCashFlow = monthlyRent – totalMonthlyOutflow;
var annualCashFlow = monthlyCashFlow * 12;
// Cash on Cash Return = Annual Cash Flow / Total Cash Invested
var cocReturn = 0;
if (downPaymentAmount > 0) {
cocReturn = (annualCashFlow / downPaymentAmount) * 100;
}
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2
});
document.getElementById('initialInvestmentResult').innerText = formatter.format(downPaymentAmount);
document.getElementById('monthlyMortgageResult').innerText = formatter.format(monthlyMortgage);
document.getElementById('totalMonthlyExpensesResult').innerText = formatter.format(totalMonthlyOutflow);
var monthlyCashFlowEl = document.getElementById('monthlyCashFlowResult');
monthlyCashFlowEl.innerText = formatter.format(monthlyCashFlow);
monthlyCashFlowEl.style.color = monthlyCashFlow >= 0 ? '#2e7d32' : '#d32f2f';
var annualCashFlowEl = document.getElementById('annualCashFlowResult');
annualCashFlowEl.innerText = formatter.format(annualCashFlow);
annualCashFlowEl.style.color = annualCashFlow >= 0 ? '#2e7d32' : '#d32f2f';
var cocEl = document.getElementById('cocReturnResult');
cocEl.innerText = cocReturn.toFixed(2) + '%';
cocEl.style.color = cocReturn >= 0 ? '#2e7d32' : '#d32f2f';
document.getElementById('result').style.display = 'block';
}
Understanding Rental Property Cash Flow Analysis
Successful real estate investing relies heavily on accurate financial analysis. The most critical metric for buy-and-hold investors is cash flow—the net amount of cash moving in or out of a rental property business after all expenses are paid.
Why Cash Flow Matters
Positive cash flow means your investment is generating income every month. Negative cash flow means the property costs you money to keep. While appreciation is a long-term goal, positive cash flow is what sustains the investment in the short to medium term and provides a buffer against market downturns.
Key Inputs Explained
Purchase Price & Down Payment: These determine your loan amount and your initial cash investment. A higher down payment reduces your monthly mortgage burden but increases your initial capital outlay.
Interest Rate & Loan Term: These define your debt service. Even small changes in interest rates can significantly impact your monthly mortgage payment and, consequently, your cash flow.
Monthly Operating Expenses: This is often underestimated by beginners. It must include property taxes, insurance, HOA fees, utilities paid by the owner, property management fees, and crucial reserves for maintenance and vacancy.
Interpreting the Results
Monthly and Annual Cash Flow
This is your "net income" before income taxes. In the example pre-filled above, a $300,000 property with 20% down ($60,000 invested) at 6.5% interest rents for $2,500. After calculating the mortgage (roughly $1,517) and operating expenses ($800), the positive monthly cash flow indicates a potentially healthy investment.
Cash on Cash Return (CoC)
This is the most vital ROI metric for rental properties. It measures the annual cash flow relative to the total cash invested (usually the down payment plus closing and rehab costs). It tells you how hard your actual dollars are working for you. A 10% CoC return means for every $100 you invested, you receive $10 back annually in cash flow.
Use this calculator to analyze multiple scenarios, such as how a higher interest rate affects your CoC return or how much rent you need to charge to break even.