function calculateRentalROI() {
// Get inputs
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 monthlyRent = parseFloat(document.getElementById('monthlyRent').value);
var monthlyExpenses = parseFloat(document.getElementById('monthlyExpenses').value);
var repairCosts = parseFloat(document.getElementById('repairCosts').value);
// Validation
if (isNaN(purchasePrice) || isNaN(downPayment) || isNaN(monthlyRent)) {
alert("Please fill in the required fields (Price, Down Payment, Rent).");
return;
}
// Handle defaults for empty optional fields
if (isNaN(interestRate)) interestRate = 0;
if (isNaN(loanTerm)) loanTerm = 30;
if (isNaN(monthlyExpenses)) monthlyExpenses = 0;
if (isNaN(repairCosts)) repairCosts = 0;
// Calculations
var loanAmount = purchasePrice – downPayment;
var monthlyMortgage = 0;
if (loanAmount > 0 && interestRate > 0) {
var monthlyRate = (interestRate / 100) / 12;
var numberOfPayments = loanTerm * 12;
// PMT Formula: P * (r(1+r)^n) / ((1+r)^n – 1)
monthlyMortgage = loanAmount * (monthlyRate * Math.pow(1 + monthlyRate, numberOfPayments)) / (Math.pow(1 + monthlyRate, numberOfPayments) – 1);
} else if (loanAmount > 0 && interestRate === 0) {
// Interest free loan
monthlyMortgage = loanAmount / (loanTerm * 12);
}
var totalMonthlyOutflow = monthlyMortgage + monthlyExpenses;
var monthlyCashFlow = monthlyRent – totalMonthlyOutflow;
var annualCashFlow = monthlyCashFlow * 12;
// Total Cash Invested (Denominator for Cash on Cash)
var totalCashInvested = downPayment + repairCosts;
// Net Operating Income (NOI) for Cap Rate
// NOI = (Gross Income – Operating Expenses) *exclude mortgage*
var annualGrossIncome = monthlyRent * 12;
var annualOperatingExpenses = monthlyExpenses * 12;
var noi = annualGrossIncome – annualOperatingExpenses;
// Metrics
var cashOnCashROI = 0;
if (totalCashInvested > 0) {
cashOnCashROI = (annualCashFlow / totalCashInvested) * 100;
}
var capRate = 0;
if (purchasePrice > 0) {
capRate = (noi / purchasePrice) * 100;
}
// Formatting Output
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2
});
document.getElementById('displayMortgage').innerText = formatter.format(monthlyMortgage);
document.getElementById('displayTotalExpenses').innerText = formatter.format(totalMonthlyOutflow);
var cashFlowElem = document.getElementById('displayCashFlow');
cashFlowElem.innerText = formatter.format(monthlyCashFlow);
cashFlowElem.className = monthlyCashFlow >= 0 ? "roi-metric-green" : "roi-metric-red";
var annualCashFlowElem = document.getElementById('displayAnnualCashFlow');
annualCashFlowElem.innerText = formatter.format(annualCashFlow);
annualCashFlowElem.className = annualCashFlow >= 0 ? "roi-metric-green" : "roi-metric-red";
document.getElementById('displayROI').innerText = cashOnCashROI.toFixed(2) + "%";
document.getElementById('displayCapRate').innerText = capRate.toFixed(2) + "%";
// Show Results
document.getElementById('roiResult').style.display = 'block';
}
How to Calculate Rental Property ROI
Investing in real estate is one of the most reliable ways to build wealth, but knowing your numbers is critical to success. This Rental Property ROI Calculator helps investors analyze the profitability of a potential deal by calculating key metrics like Cash Flow, Cash on Cash Return, and Cap Rate.
Understanding the Key Metrics
When evaluating a rental property, you shouldn't rely on just one number. Here is a breakdown of the terms used in this calculator:
Cash Flow: This is the profit you take home each month after all expenses (mortgage, taxes, insurance, repairs) are paid. Positive cash flow ensures the property pays for itself.
Cash on Cash Return (CoC ROI): This measures the annual return on the actual cash you invested (down payment + closing costs + repairs). It is calculated as (Annual Cash Flow / Total Cash Invested) × 100. A good CoC return is often considered to be above 8-12%, depending on the market.
Cap Rate (Capitalization Rate): This metric evaluates the profitability of a property regardless of how it is financed. It is calculated as (Net Operating Income / Purchase Price) × 100. It helps compare properties apples-to-apples.
Why Use a Rental ROI Calculator?
Many new investors make the mistake of underestimating expenses. They assume that if the rent covers the mortgage, they are making money. However, once you factor in vacancies, maintenance, property management fees, and capital expenditures (like a new roof), the profit margin shrinks.
Using this calculator forces you to account for:
Operating Expenses: These are the recurring costs of owning the property, not including debt service.
Upfront Costs: The total cash required to close the deal and get it rent-ready affects your ROI significantly.
Debt Service: The impact of your interest rate and loan terms on your monthly bottom line.
Example Calculation
Let's say you buy a property for $200,000 with a $40,000 down payment. You spend another $5,000 on closing costs and minor repairs. Your total cash invested is $45,000.
If your net monthly cash flow (after paying the mortgage and all expenses) is $300, your annual cash flow is $3,600. Your Cash on Cash ROI would be:
($3,600 / $45,000) = 0.08 or 8% ROI.
Use the tool above to run your own scenarios and ensure your next investment property meets your financial goals.