function calculateCashFlow() {
// Inputs – Purchase
var price = parseFloat(document.getElementById('rp_price').value) || 0;
var down = parseFloat(document.getElementById('rp_down').value) || 0;
var rate = parseFloat(document.getElementById('rp_rate').value) || 0;
var term = parseFloat(document.getElementById('rp_term').value) || 0;
var closing = parseFloat(document.getElementById('rp_closing').value) || 0;
var rehab = parseFloat(document.getElementById('rp_rehab').value) || 0;
// Inputs – Income
var rent = parseFloat(document.getElementById('rp_rent').value) || 0;
var vacancyRate = parseFloat(document.getElementById('rp_vacancy').value) || 0;
// Inputs – Expenses
var taxAnnual = parseFloat(document.getElementById('rp_tax').value) || 0;
var insuranceAnnual = parseFloat(document.getElementById('rp_insurance').value) || 0;
var hoa = parseFloat(document.getElementById('rp_hoa').value) || 0;
var maintenanceRate = parseFloat(document.getElementById('rp_maintenance').value) || 0;
var capexRate = parseFloat(document.getElementById('rp_capex').value) || 0;
var managementRate = parseFloat(document.getElementById('rp_management').value) || 0;
// Validations
if (price <= 0 || rent 0) {
monthlyMortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, totalPayments)) / (Math.pow(1 + monthlyRate, totalPayments) – 1);
} else {
monthlyMortgage = loanAmount / totalPayments;
}
// Income Calculations
var vacancyCost = rent * (vacancyRate / 100);
var effectiveGrossIncome = rent – vacancyCost;
// Expense Calculations (Monthly)
var taxMonthly = taxAnnual / 12;
var insuranceMonthly = insuranceAnnual / 12;
var maintenanceCost = rent * (maintenanceRate / 100);
var capexCost = rent * (capexRate / 100);
var managementCost = rent * (managementRate / 100);
var totalOperatingExpenses = taxMonthly + insuranceMonthly + hoa + maintenanceCost + capexCost + managementCost;
// Net Operating Income (NOI)
var noiMonthly = effectiveGrossIncome – totalOperatingExpenses;
var noiAnnual = noiMonthly * 12;
// Cash Flow
var cashFlowMonthly = noiMonthly – monthlyMortgage;
var cashFlowAnnual = cashFlowMonthly * 12;
// Returns
var totalInvested = down + closing + rehab;
var cocReturn = 0;
var capRate = 0;
if (totalInvested > 0) {
cocReturn = (cashFlowAnnual / totalInvested) * 100;
}
if (price > 0) {
capRate = (noiAnnual / price) * 100; // Cap rate based on purchase price typically
}
// Formatting Helper
var formatCurrency = function(num) {
return '$' + num.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
};
// Display Results
document.getElementById('res_gross_rent').innerText = formatCurrency(rent);
document.getElementById('res_vacancy').innerText = '-' + formatCurrency(vacancyCost);
document.getElementById('res_opex').innerText = '-' + formatCurrency(totalOperatingExpenses);
document.getElementById('res_noi').innerText = formatCurrency(noiMonthly);
document.getElementById('res_mortgage').innerText = '-' + formatCurrency(monthlyMortgage);
var cfElement = document.getElementById('res_cashflow');
cfElement.innerText = formatCurrency(cashFlowMonthly);
cfElement.className = "rp-result-value " + (cashFlowMonthly >= 0 ? "rp-positive" : "rp-negative");
document.getElementById('res_coc').innerText = cocReturn.toFixed(2) + '%';
document.getElementById('res_cap').innerText = capRate.toFixed(2) + '%';
document.getElementById('res_invested').innerText = formatCurrency(totalInvested);
// Show Results container
document.getElementById('rp_results').style.display = 'block';
}
Understanding Rental Property Cash Flow
Investing in rental real estate is one of the most reliable ways to build long-term wealth, but not every property is a good deal. The difference between a profitable investment and a financial burden often comes down to one metric: Cash Flow. This calculator is designed to help you analyze the numbers before you sign on the dotted line.
What is Cash Flow?
Cash flow is the net income from a real estate investment after all mortgage payments and operating expenses have been made. A property with positive cash flow puts money into your pocket every month, while a property with negative cash flow (often called an "alligator") requires you to feed it money to keep it afloat.
To calculate it accurately, you use the formula: Income – Vacancy – Operating Expenses – Debt Service = Cash Flow.
Key Metrics Explained
NOI (Net Operating Income): This represents the profitability of the property excluding the mortgage. It is calculated as Income minus Expenses (excluding debt service). Investors use NOI to determine the un-leveraged potential of a property.
Cap Rate (Capitalization Rate): This is the rate of return on a real estate investment property based on the income that the property is expected to generate. It is calculated by dividing the NOI by the property asset value (Purchase Price). A higher Cap Rate generally implies a better return (or higher risk).
Cash on Cash Return (CoC): This is the most important metric for many investors because it tells you how hard your actual cash is working. It is calculated by dividing the annual pre-tax cash flow by the total cash invested (Down payment + Closing costs + Rehab costs).
Why You Must Estimate Expenses
Novice investors often make the mistake of only calculating the mortgage, taxes, and insurance. However, to get a realistic view of your cash flow, you must account for "hidden" costs:
Vacancy: Your property won't be rented 365 days a year. A 5-8% vacancy allowance is standard.
Maintenance & Repairs: Things break. Setting aside 5-10% of rent ensures you have funds for plumbing issues or painting.
CapEx (Capital Expenditures): Big ticket items like roofs and HVAC systems eventually need replacing. Allocating 5-10% monthly builds a reserve for these future costs.
Property Management: Even if you manage it yourself, you should account for your time or the future cost of a manager (typically 8-10% of rent).
How to Use This Calculator
Enter the purchase details in the first section, including your interest rate and down payment. Next, estimate your rental income and vacancy rate. Finally, be honest with your expense estimates. The calculator will automatically compute your monthly cash flow, NOI, and return on investment percentages to help you make a data-driven decision.