function calculateRentalROI() {
// 1. Get Inputs
var price = parseFloat(document.getElementById("purchasePrice").value) || 0;
var down = parseFloat(document.getElementById("downPayment").value) || 0;
var interest = parseFloat(document.getElementById("interestRate").value) || 0;
var years = parseFloat(document.getElementById("loanTerm").value) || 0;
var closing = parseFloat(document.getElementById("closingCosts").value) || 0;
var rent = parseFloat(document.getElementById("rentalIncome").value) || 0;
var taxAnnual = parseFloat(document.getElementById("propertyTax").value) || 0;
var insAnnual = parseFloat(document.getElementById("insurance").value) || 0;
var hoaMonthly = parseFloat(document.getElementById("hoaFees").value) || 0;
var vacancyPct = parseFloat(document.getElementById("vacancyRate").value) || 0;
var maintPct = parseFloat(document.getElementById("maintenanceRate").value) || 0;
var mgmtPct = parseFloat(document.getElementById("mgmtFee").value) || 0;
// 2. Calculate Mortgage (Principal & Interest)
var loanAmount = price – down;
var monthlyRate = (interest / 100) / 12;
var numPayments = years * 12;
var mortgagePayment = 0;
if (loanAmount > 0 && interest > 0) {
mortgagePayment = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numPayments)) / (Math.pow(1 + monthlyRate, numPayments) – 1);
} else if (loanAmount > 0 && interest === 0) {
mortgagePayment = loanAmount / numPayments;
}
// 3. Calculate Operating Expenses
var taxMonthly = taxAnnual / 12;
var insMonthly = insAnnual / 12;
var vacancyCost = rent * (vacancyPct / 100);
var maintCost = rent * (maintPct / 100);
var mgmtCost = rent * (mgmtPct / 100);
var totalOpExMonthly = taxMonthly + insMonthly + hoaMonthly + vacancyCost + maintCost + mgmtCost;
// 4. Calculate Key Metrics
var noiMonthly = rent – totalOpExMonthly; // Net Operating Income
var totalOutflow = mortgagePayment + totalOpExMonthly;
var cashFlowMonthly = rent – totalOutflow;
var cashFlowAnnual = cashFlowMonthly * 12;
var totalCashInvested = down + closing;
var cocReturn = 0;
if (totalCashInvested > 0) {
cocReturn = (cashFlowAnnual / totalCashInvested) * 100;
}
var capRate = 0;
if (price > 0) {
capRate = ((noiMonthly * 12) / price) * 100;
}
// 5. Display Results
document.getElementById("resMortgage").innerText = "$" + mortgagePayment.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById("resExpenses").innerText = "$" + totalOpExMonthly.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById("resNOI").innerText = "$" + noiMonthly.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
var cfEl = document.getElementById("resCashFlow");
cfEl.innerText = "$" + cashFlowMonthly.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
if (cashFlowMonthly < 0) cfEl.classList.add("negative");
else cfEl.classList.remove("negative");
var cocEl = document.getElementById("resCoC");
cocEl.innerText = cocReturn.toFixed(2) + "%";
if (cocReturn < 0) cocEl.classList.add("negative");
else cocEl.classList.remove("negative");
document.getElementById("resCapRate").innerText = capRate.toFixed(2) + "%";
document.getElementById("resultsArea").style.display = "block";
}
Understanding Rental Property Cash Flow Analysis
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 a profit. To succeed, investors must meticulously calculate their numbers before signing on the dotted line. A Rental Property Cash Flow Calculator is an essential tool for determining whether a potential investment will generate income or drain your savings.
Key Metrics Explained
When analyzing a rental property, there are several distinct metrics you must understand to evaluate the deal's profitability:
Cash Flow: This is your "take-home" profit each month. It is calculated by subtracting all expenses (mortgage, taxes, insurance, maintenance, vacancy) from your gross rental income. Positive cash flow means the asset pays you to own it.
Net Operating Income (NOI): This measures the profitability of the property itself, excluding financing costs. It is defined as Gross Income – Operating Expenses. Lenders often look at NOI to determine if the property income covers the debt service.
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). For example, if you invest $50,000 cash and receive $5,000 in positive cash flow per year, your CoC return is 10%.
Cap Rate (Capitalization Rate): This represents the rate of return on the property if you bought it entirely with cash. It helps compare properties of different sizes and prices on an equal footing.
Estimating Expenses Correctly
New investors often make the mistake of underestimating expenses. Beyond the mortgage, you must account for:
Vacancy Rate: Properties are rarely occupied 100% of the time. A standard safety margin is 5% to 8% (roughly 2-4 weeks of vacancy per year).
Maintenance & Repairs: Even if a house is brand new, things break. Setting aside 5% to 10% of the monthly rent ensures you have funds for painting, plumbing issues, or appliance replacement.
Capital Expenditures (CapEx): These are big-ticket items like a new roof or HVAC system. While not monthly expenses, savvy investors allocate a percentage of rent to a CapEx fund.
Property Management: If you don't plan to be a landlord yourself, expect to pay a property manager between 8% and 12% of the monthly rent.
Why Use This Calculator?
This calculator allows you to input specific variables including vacancy rates, maintenance percentages, and financing terms. By adjusting these levers, you can determine the maximum purchase price you should offer to achieve your desired Cash on Cash return. Remember, in real estate investing, you make your money when you buy—by ensuring the math works from day one.