function calculateCashFlow() {
// 1. Get Inputs
var price = parseFloat(document.getElementById('purchasePrice').value);
var downPct = parseFloat(document.getElementById('downPaymentPercent').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 taxYearly = parseFloat(document.getElementById('propertyTaxYearly').value);
var insYearly = parseFloat(document.getElementById('insuranceYearly').value);
var hoa = parseFloat(document.getElementById('hoaMonthly').value);
var vacancyPct = parseFloat(document.getElementById('vacancyRate').value);
// Validation
if (isNaN(price) || isNaN(rent) || isNaN(rate) || isNaN(term)) {
alert("Please enter valid numbers for all fields.");
return;
}
// 2. Loan Calculations
var downAmount = price * (downPct / 100);
var loanAmount = price – downAmount;
var monthlyRate = (rate / 100) / 12;
var numPayments = term * 12;
// Mortgage P&I Formula
var mortgage = 0;
if (rate === 0) {
mortgage = loanAmount / numPayments;
} else {
mortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numPayments)) / (Math.pow(1 + monthlyRate, numPayments) – 1);
}
// 3. Expense Calculations (Monthly)
var taxMonthly = taxYearly / 12;
var insMonthly = insYearly / 12;
var vacancyCost = rent * (vacancyPct / 100);
var operatingExpenses = taxMonthly + insMonthly + hoa + vacancyCost;
var totalExpenses = operatingExpenses + mortgage;
// 4. Returns Calculations
var cashFlow = rent – totalExpenses;
var annualCashFlow = cashFlow * 12;
var totalInvested = downAmount + closing;
// NOI (Net Operating Income) = Income – Operating Expenses (excluding mortgage)
var noiMonthly = rent – operatingExpenses;
var noiYearly = noiMonthly * 12;
// Cash on Cash Return
var coc = (annualCashFlow / totalInvested) * 100;
// Cap Rate = NOI / Purchase Price
var capRate = (noiYearly / price) * 100;
// 5. Display Results
document.getElementById('resultsArea').style.display = 'block';
// Formatter
var fmtMoney = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' });
var fmtPct = new Intl.NumberFormat('en-US', { style: 'percent', minimumFractionDigits: 2 });
document.getElementById('resCashFlow').innerHTML = fmtMoney.format(cashFlow);
document.getElementById('resCashFlow').style.color = cashFlow >= 0 ? '#28a745' : '#dc3545';
document.getElementById('resCoC').innerHTML = coc.toFixed(2) + "%";
document.getElementById('resCoC').style.color = coc >= 0 ? '#28a745' : '#dc3545';
document.getElementById('resCapRate').innerHTML = capRate.toFixed(2) + "%";
document.getElementById('resIncome').innerHTML = fmtMoney.format(rent);
document.getElementById('resMortgage').innerHTML = fmtMoney.format(mortgage);
document.getElementById('resOpEx').innerHTML = fmtMoney.format(operatingExpenses);
document.getElementById('resNOI').innerHTML = fmtMoney.format(noiMonthly);
document.getElementById('resCashInvested').innerHTML = fmtMoney.format(totalInvested);
}
Understanding Rental Property Cash Flow
Calculating cash flow is the single most important step in analyzing a rental property investment. Positive cash flow ensures that the property pays for itself while putting money in your pocket every month, whereas negative cash flow can quickly drain your reserves.
How This Calculator Works
This Rental Property Cash Flow Calculator breaks down your investment into three critical components:
- Gross Income: Your total expected rent. We also account for vacancy rates, as no property is occupied 100% of the time.
- Operating Expenses: These are the costs to keep the property running, excluding the mortgage. This includes property taxes, insurance, HOA fees, and maintenance reserves.
- Debt Service: Your monthly principal and interest payments based on your loan terms.
Key Metrics Defined
Cash Flow: This is your profit after all expenses and mortgage payments.
Formula: Rent – (Operating Expenses + Mortgage)
Cash on Cash Return (CoC): This measures the return on the actual cash you invested (down payment + closing costs), rather than the total loan amount. It is a true measure of your money's efficiency.
Formula: (Annual Cash Flow / Total Cash Invested) × 100
Cap Rate (Capitalization Rate): This metric helps you compare properties regardless of financing. It represents the return if you paid all cash.
Formula: (Net Operating Income / Purchase Price) × 100
What is a Good Return?
While "good" is subjective, many investors look for a Cash on Cash return between 8% and 12%. However, in high-appreciation markets, investors might accept lower cash flow (around 4-5%) in exchange for potential equity growth over time.