function calculateCashFlow() {
// Get Input Values
var price = parseFloat(document.getElementById('purchasePrice').value) || 0;
var downPayment = parseFloat(document.getElementById('downPayment').value) || 0;
var closingCosts = parseFloat(document.getElementById('closingCosts').value) || 0;
var interestRate = parseFloat(document.getElementById('interestRate').value) || 0;
var loanTerm = parseInt(document.getElementById('loanTerm').value) || 30;
var rent = parseFloat(document.getElementById('rentalIncome').value) || 0;
var annualTax = parseFloat(document.getElementById('propertyTax').value) || 0;
var annualInsurance = parseFloat(document.getElementById('insurance').value) || 0;
var monthlyHOA = parseFloat(document.getElementById('hoa').value) || 0;
var vacancyPercent = parseFloat(document.getElementById('vacancyRate').value) || 0;
var maintenancePercent = parseFloat(document.getElementById('maintenanceRate').value) || 0;
// 1. Calculate Mortgage (Principal & Interest)
var loanAmount = price – downPayment;
var monthlyRate = (interestRate / 100) / 12;
var numPayments = loanTerm * 12;
var mortgagePayment = 0;
if (loanAmount > 0 && interestRate > 0) {
mortgagePayment = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numPayments)) / (Math.pow(1 + monthlyRate, numPayments) – 1);
} else if (loanAmount > 0 && interestRate === 0) {
mortgagePayment = loanAmount / numPayments;
}
// 2. Calculate Operating Expenses
var monthlyTax = annualTax / 12;
var monthlyInsurance = annualInsurance / 12;
var vacancyCost = rent * (vacancyPercent / 100);
var maintenanceCost = rent * (maintenancePercent / 100);
var operatingExpenses = monthlyTax + monthlyInsurance + monthlyHOA + vacancyCost + maintenanceCost;
var totalExpenses = operatingExpenses + mortgagePayment;
// 3. Calculate Cash Flow
var monthlyCashFlow = rent – totalExpenses;
var annualCashFlow = monthlyCashFlow * 12;
// 4. Calculate Net Operating Income (NOI)
// NOI = Income – Operating Expenses (Excluding Mortgage)
var noiMonthly = rent – operatingExpenses;
var noiAnnual = noiMonthly * 12;
// 5. Calculate Returns
var totalInvestment = downPayment + closingCosts;
var cocReturn = 0;
if (totalInvestment > 0) {
cocReturn = (annualCashFlow / totalInvestment) * 100;
}
var capRate = 0;
if (price > 0) {
capRate = (noiAnnual / price) * 100;
}
// Update UI
document.getElementById('monthlyCashFlow').innerText = formatCurrency(monthlyCashFlow);
if (monthlyCashFlow < 0) {
document.getElementById('monthlyCashFlow').classList.add('negative');
} else {
document.getElementById('monthlyCashFlow').classList.remove('negative');
}
document.getElementById('cocReturn').innerText = cocReturn.toFixed(2) + '%';
document.getElementById('capRate').innerText = capRate.toFixed(2) + '%';
document.getElementById('noiMonthly').innerText = formatCurrency(noiMonthly);
document.getElementById('totalInvestment').innerText = formatCurrency(totalInvestment);
document.getElementById('mortgagePayment').innerText = formatCurrency(mortgagePayment);
document.getElementById('vacancyCost').innerText = formatCurrency(vacancyCost);
document.getElementById('maintenanceCost').innerText = formatCurrency(maintenanceCost);
document.getElementById('totalExpenses').innerText = formatCurrency(totalExpenses);
}
function formatCurrency(num) {
return '$' + num.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
}
// Initial Calculation on Load
window.onload = function() {
calculateCashFlow();
}
How to Calculate Rental Property Cash Flow
Investing in real estate is one of the most reliable ways to build wealth, but simply buying a property and renting it out doesn't guarantee profit. To ensure a sound investment, you must accurately calculate your **Cash Flow**, **Cash on Cash Return**, and **Cap Rate**. This calculator helps investors evaluate the profitability of potential rental properties by accounting for all major expenses, including vacancy reserves and maintenance.
Key Metrics Explained
1. Cash Flow
Cash flow is the net amount of money left in your pocket after all expenses are paid. A positive cash flow means the property is generating income, while a negative cash flow means the property is costing you money every month.
Formula:Rental Income – (Mortgage + Taxes + Insurance + HOA + Reserves)
2. Cash on Cash Return (CoC)
This metric measures the annual return on the actual cash you invested (down payment + closing costs). It is crucial for comparing real estate investments against other asset classes like stocks or bonds.
Formula:(Annual Cash Flow / Total Cash Invested) × 100
3. Cap Rate (Capitalization Rate)
Cap Rate measures the property's natural rate of return assuming it was bought with cash (no mortgage). It helps compare the profitability of different properties regardless of how they are financed.
Formula:(Net Operating Income / Purchase Price) × 100
Common Expenses to Watch For
Vacancy Rate: Properties won't be rented 365 days a year. A standard conservative estimate is 5-8% (about 3 weeks of vacancy per year).
Maintenance & CapEx: Roofs leak and toilets break. Setting aside 10-15% of rent for repairs and Capital Expenditures (major replacements) ensures you aren't caught off guard.
Property Management: If you hire a manager, expect to pay 8-10% of the monthly rent. Even if you self-manage, it's wise to factor this in as "paying yourself."
The 1% Rule
A popular "rule of thumb" for initial screening is the 1% Rule. It states that the monthly rent should be at least 1% of the purchase price. For example, a $200,000 home should rent for at least $2,000/month. While not a hard rule, properties meeting this criteria often have better cash flow potential.
Expense Category
Estimated Cost (% of Rent)
Property Management
8% – 10%
Vacancy
5% – 8%
Maintenance/Repairs
5% – 10%
Capital Expenditures (CapEx)
5% – 10%
Use the calculator above to adjust these variables and see exactly how they impact your bottom line before you sign the closing papers.