function calculateRental() {
// 1. Get Values
var price = parseFloat(document.getElementById("rpcPrice").value) || 0;
var downPayment = parseFloat(document.getElementById("rpcDownPayment").value) || 0;
var interestRate = parseFloat(document.getElementById("rpcInterest").value) || 0;
var termYears = parseFloat(document.getElementById("rpcTerm").value) || 30;
var closingCosts = parseFloat(document.getElementById("rpcClosingCosts").value) || 0;
var rent = parseFloat(document.getElementById("rpcRent").value) || 0;
var otherIncome = parseFloat(document.getElementById("rpcOtherIncome").value) || 0;
var tax = parseFloat(document.getElementById("rpcTax").value) || 0;
var insurance = parseFloat(document.getElementById("rpcInsurance").value) || 0;
var hoa = parseFloat(document.getElementById("rpcHOA").value) || 0;
var repairPercent = parseFloat(document.getElementById("rpcRepairs").value) || 0;
var vacancyPercent = parseFloat(document.getElementById("rpcVacancy").value) || 0;
var capexPercent = parseFloat(document.getElementById("rpcCapEx").value) || 0;
// 2. Calculate Mortgage
var loanAmount = price – downPayment;
var monthlyRate = (interestRate / 100) / 12;
var numPayments = termYears * 12;
var mortgagePayment = 0;
if (interestRate === 0) {
mortgagePayment = loanAmount / numPayments;
} else {
mortgagePayment = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numPayments)) / (Math.pow(1 + monthlyRate, numPayments) – 1);
}
// 3. Calculate Income & Expenses
var totalMonthlyIncome = rent + otherIncome;
var vacancyCost = totalMonthlyIncome * (vacancyPercent / 100);
var repairCost = totalMonthlyIncome * (repairPercent / 100);
var capexCost = totalMonthlyIncome * (capexPercent / 100);
var totalOperatingExpenses = tax + insurance + hoa + vacancyCost + repairCost + capexCost;
var totalExpenses = totalOperatingExpenses + mortgagePayment;
// 4. Calculate Metrics
var monthlyCashFlow = totalMonthlyIncome – totalExpenses;
var annualCashFlow = monthlyCashFlow * 12;
var annualNOI = (totalMonthlyIncome – totalOperatingExpenses) * 12;
var totalCashInvested = downPayment + closingCosts;
var cashOnCash = 0;
if (totalCashInvested > 0) {
cashOnCash = (annualCashFlow / totalCashInvested) * 100;
}
var capRate = 0;
if (price > 0) {
capRate = (annualNOI / price) * 100;
}
// 5. Update UI
var cashFlowEl = document.getElementById("resCashFlow");
cashFlowEl.innerText = formatCurrency(monthlyCashFlow);
if (monthlyCashFlow >= 0) {
cashFlowEl.className = "rpc-result-value rpc-highlight";
} else {
cashFlowEl.className = "rpc-result-value rpc-highlight-neg";
}
document.getElementById("resCoC").innerText = cashOnCash.toFixed(2) + "%";
document.getElementById("resNOI").innerText = formatCurrency(annualNOI / 12);
document.getElementById("resTotalExp").innerText = formatCurrency(totalExpenses);
document.getElementById("resMortgage").innerText = formatCurrency(mortgagePayment);
document.getElementById("resCapRate").innerText = capRate.toFixed(2) + "%";
document.getElementById("rpcResults").style.display = "block";
}
function formatCurrency(num) {
return "$" + num.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
}
Understanding Rental Property Cash Flow
Calculating cash flow is the most critical step in evaluating a real estate investment. Positive cash flow ensures that the property pays for itself while you build equity, whereas negative cash flow can quickly drain your reserves. This calculator breaks down the numbers to give you a clear picture of an investment's potential.
How is Cash Flow Calculated?
Cash flow is the remaining profit after all expenses are subtracted from the total income. The formula used in this tool is:
Gross Income: Rent + Other Income (parking, laundry, etc.).
Operating Expenses: Taxes, Insurance, HOA, Repairs, Vacancy, and CapEx.
Debt Service: The principal and interest portion of your mortgage payment.
Net Cash Flow = Gross Income – (Operating Expenses + Debt Service).
Key Metrics Explained
Beyond simple monthly profit, successful investors look at these efficiency metrics:
Cash on Cash Return (CoC): This measures the annual return on the actual cash you invested (Down Payment + Closing Costs). A CoC of 8-12% is often considered a solid target for rental properties.
Net Operating Income (NOI): This is the profitability of the property before factoring in the mortgage. It is essential for calculating the Cap Rate.
Cap Rate: Calculated as NOI divided by the Purchase Price. It helps compare the profitability of different properties regardless of how they are financed.
Estimating Variable Expenses
Many new investors fail because they underestimate "hidden" costs. This calculator includes inputs for:
Vacancy Rate: Properties won't be occupied 365 days a year. A standard estimate is 5-8% (about 3-4 weeks of vacancy per year).
Maintenance & Repairs: Budgeting 5-10% of monthly rent helps cover routine fixes like leaky faucets or painting.
CapEx (Capital Expenditures): This is saving for big-ticket items like a new roof or HVAC system, typically 5-10% of rent.
Use this tool to stress-test your deal. Try increasing the vacancy rate or interest rate to see if the property remains profitable under less-than-ideal conditions.