function calculateDRIP() {
var initial = parseFloat(document.getElementById('initialInvestment').value);
var price = parseFloat(document.getElementById('sharePrice').value);
var yield = parseFloat(document.getElementById('divYield').value) / 100;
var years = parseInt(document.getElementById('years').value);
var contribution = parseFloat(document.getElementById('annualContribution').value);
var growth = parseFloat(document.getElementById('divGrowth').value) / 100;
if (isNaN(initial) || isNaN(price) || isNaN(yield) || isNaN(years)) {
alert("Please fill in all required fields with valid numbers.");
return;
}
var shares = initial / price;
var currentDivPerShare = (price * yield);
var totalDivReceived = 0;
var principalInvested = initial;
for (var i = 1; i <= years; i++) {
// Quarterly calculation for more realism
for (var q = 1; q <= 4; q++) {
var qDiv = (shares * currentDivPerShare) / 4;
totalDivReceived += qDiv;
shares += qDiv / price;
// Add quarterly portion of annual contribution
var qCont = contribution / 4;
shares += qCont / price;
principalInvested += qCont;
}
// Annual Dividend Growth
currentDivPerShare *= (1 + growth);
}
var finalBalance = shares * price;
var finalAnnualIncome = shares * currentDivPerShare;
document.getElementById('endBalance').innerText = '$' + finalBalance.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('endIncome').innerText = '$' + finalAnnualIncome.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('totalDividends').innerText = '$' + totalDivReceived.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('totalPrincipal').innerText = '$' + principalInvested.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('results').style.display = 'block';
}
How Does Dividend Reinvestment (DRIP) Accelerate Wealth?
A Dividend Reinvestment Plan, commonly known as DRIP, is one of the most powerful tools in an investor's arsenal. Instead of receiving your quarterly dividends as cash, you automatically use those funds to purchase more shares of the underlying stock. This creates a powerful feedback loop where more shares lead to higher dividends, which in turn buy even more shares.
The Three Pillars of DRIP Growth
Compounding Shares: Every time you reinvest, your share count increases without you having to reach into your pocket for more capital.
Dividend Growth: Many "Dividend Aristocrats" increase their payouts annually. When you combine more shares with a higher payout per share, the income growth becomes exponential.
Dollar-Cost Averaging: Since dividends are reinvested regardless of market price, you naturally buy more shares when prices are low and fewer when prices are high.
A Realistic Example
Imagine you start with an initial investment of $10,000 in a stock priced at $50 with a 4% yield. If you contribute just $100 per month ($1,200/year) and the company grows its dividend by 5% annually:
After 10 Years: You could have a balance of approximately $36,000, generating nearly $1,800 in annual passive income.
After 20 Years: That same investment could balloon to over $115,000, generating roughly $7,500 in yearly dividends.
Why Use a DRIP Calculator?
Investors often underestimate the impact of dividend growth and reinvestment over long horizons. By using this calculator, you can visualize how small changes in your contribution rate or the dividend growth rate can result in six-figure differences in your terminal wealth. It helps you shift your focus from daily price fluctuations to the long-term compounding of passive income streams.