Advanced BRRRR Calculator with Interactive Graphs
canvas {
width: 100%;
max-width: 800px;
margin: 20px 0;
}
input, button {
margin: 10px 0;
padding: 10px;
width: 100%;
box-sizing: border-box;
}
#results {
margin-top: 20px;
}
.container {
max-width: 1000px;
margin: 0 auto;
}
Advanced BRRRR Calculator with Interactive Graphs
Purchase and Rehab Costs
Refinance and Rental Details
Monthly Expenses
Mortgage and Equity Details
Results:
Total Investment: $
Refinance Loan Amount: $
Amount Recovered After Refinance: $
Monthly Cash Flow: $
Annual Cash Flow: $
Return on Investment (ROI): %
Mortgage Payment: $
Equity After Refinance: $
Appreciation After 1 Year: $
Investment Property ROI (Cash-on-Cash): %
Break-even Point: months
Graphs
// Global chart variables
let cashFlowChart, equityGrowthChart;
function calculateAdvancedBRRRR() {
// Parse input values
const purchasePrice = parseFloat(document.getElementById("purchasePrice").value) || 0;
const rehabCosts = parseFloat(document.getElementById("rehabCosts").value) || 0;
const closingCosts = parseFloat(document.getElementById("closingCosts").value) || 0;
const holdingCosts = parseFloat(document.getElementById("holdingCosts").value) || 0;
const arv = parseFloat(document.getElementById("arv").value) || 0;
const refinancePercentage = parseFloat(document.getElementById("refinancePercentage").value) / 100 || 0;
const monthlyRent = parseFloat(document.getElementById("monthlyRent").value) || 0;
const propertyTaxes = parseFloat(document.getElementById("propertyTaxes").value) || 0;
const insurance = parseFloat(document.getElementById("insurance").value) || 0;
const maintenance = parseFloat(document.getElementById("maintenance").value) || 0;
const propertyManagement = parseFloat(document.getElementById("propertyManagement").value) / 100 || 0;
const interestRate = parseFloat(document.getElementById("interestRate").value) / 100 || 0;
const loanTerm = parseFloat(document.getElementById("loanTerm").value) || 0;
const appreciationRate = parseFloat(document.getElementById("appreciationRate").value) / 100 || 0;
// Calculate total investment
const totalInvestment = purchasePrice + rehabCosts + closingCosts + holdingCosts;
// Calculate refinance loan amount (based on ARV)
const refinanceLoanAmount = arv * refinancePercentage;
// Calculate amount recovered after refinancing
const amountRecovered = refinanceLoanAmount - totalInvestment;
// Calculate monthly expenses
const managementFee = monthlyRent * propertyManagement;
const totalMonthlyExpenses = propertyTaxes + insurance + maintenance + managementFee;
// Calculate mortgage payment using loan amortization formula
const monthlyInterestRate = interestRate / 12;
const numberOfPayments = loanTerm * 12;
const mortgagePayment = refinanceLoanAmount * (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments)) / (Math.pow(1 + monthlyInterestRate, numberOfPayments) - 1);
// Calculate monthly cash flow and ROI
const monthlyCashFlow = monthlyRent - totalMonthlyExpenses - mortgagePayment;
const annualCashFlow = monthlyCashFlow * 12;
const roi = totalInvestment > 0 ? (annualCashFlow / totalInvestment) * 100 : 0;
// Calculate equity after refinance
const equityAfterRefinance = arv - refinanceLoanAmount;
// Calculate appreciation after 1 year
const appreciation = arv * (1 + appreciationRate);
// Calculate investment property ROI (Cash-on-Cash)
const cashOnCashReturn = totalInvestment > 0 ? (annualCashFlow / totalInvestment) * 100 : 0;
// Calculate break-even point in months
const breakEvenPoint = totalInvestment / monthlyCashFlow;
// Display results in the results section
document.getElementById("totalInvestment").textContent = totalInvestment.toFixed(2);
document.getElementById("refinanceLoanAmount").textContent = refinanceLoanAmount.toFixed(2);
document.getElementById("amountRecovered").textContent = amountRecovered.toFixed(2);
document.getElementById("monthlyCashFlow").textContent = monthlyCashFlow.toFixed(2);
document.getElementById("annualCashFlow").textContent = annualCashFlow.toFixed(2);
document.getElementById("roi").textContent = roi.toFixed(2);
document.getElementById("mortgagePayment").textContent = mortgagePayment.toFixed(2);
document.getElementById("equityAfterRefinance").textContent = equityAfterRefinance.toFixed(2);
document.getElementById("appreciation").textContent = appreciation.toFixed(2);
document.getElementById("cashOnCashReturn").textContent = cashOnCashReturn.toFixed(2);
document.getElementById("breakEvenPoint").textContent = breakEvenPoint.toFixed(2);
// Show the results section
document.getElementById("results").style.display = 'block';
// Update graphs with the results
updateGraphs(monthlyCashFlow, equityAfterRefinance, appreciation);
}
function updateGraphs(monthlyCashFlow, equityAfterRefinance, appreciation) {
// Monthly cash flow graph data
const cashFlowData = {
labels: ['Initial Investment', 'Monthly Cash Flow'],
datasets: [{
label: 'Monthly Cash Flow',
data: [0, monthlyCashFlow],
backgroundColor: 'rgba(75, 192, 192, 0.7)',
borderColor: 'rgba(75, 192, 192, 1)',
borderWidth: 2,
borderRadius: 5
}]
};
// Equity growth over time graph data (showing potential growth over 5 years)
const equityData = {
labels: ['Year 1', 'Year 2', 'Year 3', 'Year 4', 'Year 5'],
datasets: [{
label: 'Equity Growth',
data: [equityAfterRefinance, equityAfterRefinance * 1.1, equityAfterRefinance * 1.2, equityAfterRefinance * 1.3, equityAfterRefinance * 1.4],
backgroundColor: 'rgba(153, 102, 255, 0.5)',
borderColor: 'rgba(153, 102, 255, 1)',
borderWidth: 3,
fill: true,
tension: 0.4, // Smooth the line further
pointStyle: 'circle',
pointRadius: 5
}]
};
// Destroy existing charts before updating
if (cashFlowChart) cashFlowChart.destroy();
if (equityGrowthChart) equityGrowthChart.destroy();
// Create the Monthly Cash Flow Chart with advanced styling
cashFlowChart = new Chart(document.getElementById('monthlyCashFlowGraph'), {
type: 'bar',
data: cashFlowData,
options: {
responsive: true,
scales: {
y: {
beginAtZero: true,
title: {
display: true,
text: 'Amount ($)'
}
},
x: {
title: {
display: true,
text: 'Investment and Cash Flow'
}
}
},
plugins: {
tooltip: {
callbacks: {
label: function(tooltipItem) {
return '$' + tooltipItem.raw.toFixed(2);
}
}
}
}
}
});
// Create the Equity Growth Chart with advanced styling
equityGrowthChart = new Chart(document.getElementById('equityGrowthGraph'), {
type: 'line',
data: equityData,
options: {
responsive: true,
scales: {
y: {
beginAtZero: true,
title: {
display: true,
text: 'Equity ($)'
}
},
x: {
title: {
display: true,
text: 'Years'
}
}
},
plugins: {
tooltip: {
callbacks: {
label: function(tooltipItem) {
return '$' + tooltipItem.raw.toFixed(2);
}
}
}
}
}
});
}