Estimate your portfolio performance using the Modified Dietz method
Net Invested Capital:–
Investment Gain/Loss:–
Personal Rate of Return (Approx.):–
Annualized Return (CAGR):–
*This calculator uses a Simplified Modified Dietz approximation, assuming cash flows occurred at the midpoint of the period. This matches the logic often used by brokerages like Fidelity for "Personal Rate of Return" when exact dates of transactions are generalized.
function calculateFidelityReturn() {
// 1. Get Inputs
var startBal = parseFloat(document.getElementById('startBalance').value);
var endBal = parseFloat(document.getElementById('endBalance').value);
var deposits = parseFloat(document.getElementById('deposits').value);
var withdrawals = parseFloat(document.getElementById('withdrawals').value);
var years = parseFloat(document.getElementById('years').value);
// 2. Validate Inputs (Handle NaNs)
if (isNaN(startBal)) startBal = 0;
if (isNaN(endBal)) endBal = 0;
if (isNaN(deposits)) deposits = 0;
if (isNaN(withdrawals)) withdrawals = 0;
// Prevent division by zero if everything is zero
if (startBal === 0 && endBal === 0 && deposits === 0) {
alert("Please enter a valid balance or deposit.");
return;
}
// 3. Calculation Logic (Modified Dietz Approximation)
// Net Cash Flow = Deposits – Withdrawals
var netFlow = deposits – withdrawals;
// Investment Gain = Ending Value – Beginning Value – Net Cash Flow
var invGain = endBal – startBal – netFlow;
// Weighted Capital = Beginning Balance + (Net Cash Flow * 0.5)
// We multiply Net Cash Flow by 0.5 assuming deposits/withdrawals happen on average in the middle of the period.
var weightedCapital = startBal + (netFlow * 0.5);
// If weighted capital is 0 or negative (edge case where withdrawals exceed assets early), fallback to Net Invested
var netInvested = startBal + netFlow;
if (weightedCapital 0 && netInvested > 0 && endBal > 0) {
showAnnualized = true;
var totalGrowthFactor = endBal / netInvested;
cagr = (Math.pow(totalGrowthFactor, (1 / years)) – 1) * 100;
}
// 4. Update Display
document.getElementById('results').style.display = 'block';
// Format Currency
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
});
document.getElementById('resNetInvested').innerText = formatter.format(netInvested);
var gainElement = document.getElementById('resGainLoss');
gainElement.innerText = formatter.format(invGain);
if (invGain < 0) {
gainElement.className = "result-value negative";
} else {
gainElement.className = "result-value";
}
var rorElement = document.getElementById('resRoR');
rorElement.innerText = ror.toFixed(2) + "%";
if (ror < 0) {
rorElement.className = "result-value negative";
} else {
rorElement.className = "result-value";
}
if (showAnnualized) {
document.getElementById('annualizedRow').style.display = 'flex';
var cagrElement = document.getElementById('resCAGR');
cagrElement.innerText = cagr.toFixed(2) + "%";
if (cagr < 0) {
cagrElement.className = "result-value negative";
} else {
cagrElement.className = "result-value";
}
} else {
document.getElementById('annualizedRow').style.display = 'none';
}
}
Understanding Your Fidelity Calculate Rate of Return
When reviewing your portfolio on platforms like Fidelity, seeing a percentage next to your "Personal Rate of Return" can sometimes be confusing. Unlike a simple savings account interest rate, investment returns are dynamic. They are affected not just by market performance, but also by the timing of your deposits and withdrawals.
This calculator helps you estimate that performance using the Modified Dietz method, which is the industry standard for approximating a money-weighted rate of return without complex iterative software.
Why "Simple" Growth Isn't Enough
If you started with $10,000, added $5,000, and ended with $16,000, did you make $6,000 profit? No. You added $5,000 of your own money.
To calculate your true performance, you must subtract your net contributions (deposits minus withdrawals) from the ending balance. Furthermore, the timing of that $5,000 deposit matters. If you added it yesterday, it didn't have time to grow. If you added it years ago, it did. The "Personal Rate of Return" accounts for this.
Key Concept: Money-Weighted Return
Fidelity typically displays a "Personal Rate of Return" which is money-weighted. This means it weighs periods where you had more money invested more heavily. This calculator approximates that logic by assuming your deposits and withdrawals happened halfway through the period.
How the Calculation Works
We utilize three primary steps to derive your rate of return:
1. Calculate Net Cash Flow
First, we determine how much external money moved in or out of the account.
Formula: Deposits – Withdrawals = Net Cash Flow
2. Determine Investment Gain
This is the actual profit or loss generated by the market, stripping away your cash movements.
Formula: Ending Balance – Beginning Balance – Net Cash Flow = Investment Gain
3. Modified Dietz Approximation
This is where the magic happens. We divide your Investment Gain by your "Average Weighted Capital." We assume your net cash flows were invested for half the time period.
Positive Return: Your investments have grown in value beyond your contributions.
Negative Return: The market value of your holdings has decreased, or you have withdrawn more than the portfolio generated.
CAGR (Annualized Return): If you hold an investment for multiple years, the total return can be misleading. CAGR tells you what the smooth annual growth rate would have been to reach your final balance.
Fidelity vs. Standard Returns
It is important to note that the rate of return calculated here applies to your personal performance (how your specific dollars performed). This often differs from a fund's advertised "Total Return," which assumes a single lump sum investment at the beginning of the period with no subsequent deposits or withdrawals.