Calculating the Return on Investment (ROI) for a rental property is crucial for making informed real estate decisions. Unlike buying a home for personal use, an investment property must be evaluated strictly by the numbers. This calculator helps investors determine the viability of a potential deal by analyzing key metrics like Cash on Cash Return and Cap Rate.
What is Cash on Cash Return?
Cash on Cash Return is one of the most important metrics for real estate investors. It measures the annual pre-tax cash flow relative to the total amount of cash invested. The formula is:
Cash on Cash Return = (Annual Pre-Tax Cash Flow / Total Cash Invested) × 100%
Unlike a standard ROI calculation which might consider loan paydown or appreciation, Cash on Cash Return focuses strictly on the liquid cash the asset generates relative to the cash you put into the deal (down payment + closing costs + rehab costs).
Key Metrics Explained
Net Operating Income (NOI): This is your total revenue (rent) minus all operating expenses (taxes, insurance, maintenance), excluding mortgage payments. It represents the profitability of the property itself.
Cap Rate: Calculated as NOI divided by the property's purchase price. It helps compare the profitability of different properties regardless of how they are financed.
Monthly Cash Flow: The net profit you pocket every month after paying operating expenses and the mortgage. Positive cash flow is essential for a sustainable investment.
How to Use This Calculator
To get the most accurate results, ensure you include all costs associated with the purchase. In the "Monthly Op. Expenses" field, be sure to estimate property taxes, landlord insurance, HOA fees (if applicable), and a buffer for maintenance and vacancies. A common rule of thumb for maintenance is to set aside 1% of the property value per year.
function calculateROI() {
// 1. Get Input Values
var purchasePrice = parseFloat(document.getElementById('purchasePrice').value);
var downPayment = parseFloat(document.getElementById('downPayment').value);
var interestRate = parseFloat(document.getElementById('interestRate').value);
var loanTerm = parseFloat(document.getElementById('loanTerm').value);
var closingCosts = parseFloat(document.getElementById('closingCosts').value);
var monthlyRent = parseFloat(document.getElementById('monthlyRent').value);
var monthlyExpenses = parseFloat(document.getElementById('monthlyExpenses').value);
// Validate Inputs
if (isNaN(purchasePrice) || isNaN(downPayment) || isNaN(interestRate) || isNaN(loanTerm) || isNaN(closingCosts) || isNaN(monthlyRent) || isNaN(monthlyExpenses)) {
alert("Please enter valid numbers in all fields.");
return;
}
// 2. Perform Calculations
// Loan Amount
var loanAmount = purchasePrice – downPayment;
// Monthly Mortgage Calculation
// Formula: M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1 ]
var monthlyRate = (interestRate / 100) / 12;
var numberOfPayments = loanTerm * 12;
var mortgagePayment = 0;
if (interestRate === 0) {
mortgagePayment = loanAmount / numberOfPayments;
} else {
mortgagePayment = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numberOfPayments)) / (Math.pow(1 + monthlyRate, numberOfPayments) – 1);
}
// Total Monthly Outflow
var totalMonthlyCost = mortgagePayment + monthlyExpenses;
// Monthly Cash Flow
var monthlyCashFlow = monthlyRent – totalMonthlyCost;
var annualCashFlow = monthlyCashFlow * 12;
// Total Cash Invested (Denominator for CoC)
var totalCashInvested = downPayment + closingCosts;
// Cash on Cash Return
var cashOnCash = 0;
if (totalCashInvested > 0) {
cashOnCash = (annualCashFlow / totalCashInvested) * 100;
}
// Net Operating Income (NOI) – Income minus Operating Expenses (Not including Debt Service)
var monthlyNOI = monthlyRent – monthlyExpenses;
var annualNOI = monthlyNOI * 12;
// Cap Rate = Annual NOI / Purchase Price
var capRate = 0;
if (purchasePrice > 0) {
capRate = (annualNOI / purchasePrice) * 100;
}
// 3. Format and Display Results
// Helper function for currency formatting
var formatCurrency = function(num) {
return "$" + num.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
};
document.getElementById('resMortgage').innerText = formatCurrency(mortgagePayment);
document.getElementById('resCashFlow').innerText = formatCurrency(monthlyCashFlow);
// Style Cash Flow color
if (monthlyCashFlow >= 0) {
document.getElementById('resCashFlow').style.color = "#27ae60";
} else {
document.getElementById('resCashFlow').style.color = "#c0392b";
}
document.getElementById('resNOI').innerText = formatCurrency(annualNOI);
document.getElementById('resCoC').innerText = cashOnCash.toFixed(2) + "%";
document.getElementById('resCapRate').innerText = capRate.toFixed(2) + "%";
// Show result section
document.getElementById('resultsSection').style.display = "block";
}