function validateInput(el) {
if (el.value < 0) el.value = 0;
}
function calculateRentalROI() {
// 1. Get DOM elements using 'var'
var priceInput = document.getElementById("purchasePrice");
var downPercentInput = document.getElementById("downPaymentPercent");
var closingInput = document.getElementById("closingCosts");
var rateInput = document.getElementById("interestRate");
var termInput = document.getElementById("loanTerm");
var rentInput = document.getElementById("monthlyRent");
var taxInput = document.getElementById("annualTaxes");
var insInput = document.getElementById("annualInsurance");
var hoaInput = document.getElementById("monthlyHOA");
// 2. Parse Values
var price = parseFloat(priceInput.value) || 0;
var downPercent = parseFloat(downPercentInput.value) || 0;
var closing = parseFloat(closingInput.value) || 0;
var rate = parseFloat(rateInput.value) || 0;
var term = parseFloat(termInput.value) || 0;
var rent = parseFloat(rentInput.value) || 0;
var tax = parseFloat(taxInput.value) || 0;
var insurance = parseFloat(insInput.value) || 0;
var hoa = parseFloat(hoaInput.value) || 0;
// 3. Validation
if (price <= 0 || term 0) {
cocReturn = (annualCashFlow / totalCashInvested) * 100;
}
// 5. Update HTML
document.getElementById("displayTotalInvested").innerText = "$" + totalCashInvested.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById("displayMortgage").innerText = "$" + monthlyMortgage.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById("displayTotalExpenses").innerText = "$" + totalMonthlyExpenses.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
var cashFlowEl = document.getElementById("displayCashFlow");
cashFlowEl.innerText = "$" + monthlyCashFlow.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
if(monthlyCashFlow < 0) {
cashFlowEl.style.color = "#c0392b"; // Red if negative
} else {
cashFlowEl.style.color = "#27ae60"; // Green if positive
}
var annualEl = document.getElementById("displayAnnualCashFlow");
annualEl.innerText = "$" + annualCashFlow.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
if(annualCashFlow < 0) {
annualEl.style.color = "#c0392b";
} else {
annualEl.style.color = "#2c3e50";
}
var cocEl = document.getElementById("displayCoC");
cocEl.innerText = cocReturn.toFixed(2) + "%";
if(cocReturn < 0) {
cocEl.style.color = "#c0392b";
} else {
cocEl.style.color = "#27ae60";
}
// Show result box
document.getElementById("results").style.display = "block";
}
Understanding Your Rental Property ROI
Investing in real estate is a powerful vehicle for wealth generation, but success depends entirely on the numbers. This Rental Property Cash Flow Calculator helps investors analyze potential deals by breaking down income, expenses, and financing costs to determine the true profitability of an asset.
What is Cash on Cash Return?
While many metrics exist in real estate (such as Cap Rate or IRR), Cash on Cash Return (CoC) is often the most important metric for buy-and-hold investors. It measures the annual pre-tax cash flow relative to the total amount of cash actually invested.
The formula is simple:
Cash on Cash Return = (Annual Net Cash Flow / Total Cash Invested) × 100
For example, if you invest $50,000 cash (down payment + closing costs) to buy a property, and that property generates $5,000 in net profit after all expenses and mortgage payments are paid, your CoC return is 10%.
Key Inputs Explained
To get an accurate result from the calculator above, ensure you account for all variables:
Purchase Price & Down Payment: Determines your loan amount and initial skin in the game. A lower down payment increases leverage but also increases monthly mortgage costs.
Closing Costs: Often overlooked, these include title fees, recording fees, and prepaid items. They usually range from 2% to 5% of the purchase price.
Monthly Expenses: Beyond the mortgage, you must account for property taxes, insurance, and HOA fees. Pro Tip: Smart investors also set aside money for repairs (CapEx) and vacancy, which you can add to the "Monthly HOA & Misc" field for a more conservative estimate.
Example Scenario
Let's say you are looking at a single-family home listed for $300,000.
You put 20% down ($60,000) and pay $5,000 in closing costs. Total Cash Invested: $65,000.
Your loan is $240,000 at 6.5% interest for 30 years.
Projected rent is $2,500/month.
Taxes, Insurance, and HOA total $600/month.
Using the calculator, you would find that your mortgage payment is roughly $1,517. Adding the $600 in other expenses, your total monthly outflow is $2,117. This leaves a monthly cash flow of $383, or $4,596 annually. Your Cash on Cash Return would be approximately 7.07%.
Why Cash Flow Matters
Positive cash flow ensures that the property pays for itself while you benefit from appreciation and loan paydown. Negative cash flow means you are feeding the property monthly from your own pocket, which increases risk significantly. Use this calculator to ensure every deal you enter is cash-flow positive from day one.