The calculator runs two portfolios side by side, month by month, from the same inputs.
The first is the ideal one, with no costs of any kind. It is exactly the compound interest calculator, so the same inputs give the same figure:
ideal = ideal × (1 + annual return / 12) + contribution
The second is the real one. Each month it grows the same way, then pays the fee on the whole balance and, on the dates your tax regime charges something, that tax:
real = real × (1 + annual return / 12)
real = real − real × fee / 12 + contribution
real = real − tax for the period (when due)
At the end it pays the exit tax on the gain not yet taxed. The difference between the two portfolios is the total cost, and it has two parts: what you paid directly, in fees and tax, and the growth that money would have produced had it stayed invested. That second part is negative compounding, and with high fees and long horizons it is usually the larger of the two.
