Project Nayuki


Canada Tax-Free Savings Account simulator (JavaScript)

The rules regarding TFSA contributions, withdrawals, and penalties can be confusing. Here I provide a neat way to learn using a financial account simulator. (Rules and examples are explained below.)

Program

Chequing Account

Date Transaction Amount Balance

Tax-Free Savings Account

Date Transaction Amount Balance Contribution room Withdrawn

% per year (compounded monthly)

Current date:

Show transactions:

Usage

  • Press “Deposit” to add the specified amount of money to the chequing account.

  • Press “Withdraw” to subtract the specified amount of money from the chequing account. It must be no greater than the current chequing account balance.

  • Press “Transfer in” to move the specified amount of money from the chequing account to the tax-free savings account. It must be no greater than the current chequing account balance. This decreases the TFSA contribution room by the amount.

  • Press “Transfer out” to move the specified amount of money from the tax-free savings account to the chequing account. It must be no greater than the current tax-free savings account balance. The effect is that it first brings a negative contribution room closer to zero (if applicable), and then it increases the current year’s total withdrawn amount.

  • Press “Next month” to advance to the next month. Interest is paid to the TFSA at the specified interest rate based on the balance at the end of the month. If at any point in the month the contribution room was negative, then 1% of the maximum excess contribution during the month will be taxed to the chequing account. On January of each year, the contribution room increases by $5000 (years ), $5500 (, ), $10000 (), $6000 (), $6500 (), or $7000 (), plus the total amount withdrawn during the previous year (excluding “qualifying” withdrawal amounts to remedy a negative contribution room).

Example scenarios

Alice is a millionaire and stuffs her TFSA each year as fully as allowed:

  1. Current date is .
  2. Interest rate is 3%.
  3. Deposit $1000000.
  4. Transfer in $5000.
  5. Next month ×12.
  6. She has $5152.08 in her TFSA at the beginning of .
  7. Transfer in $5000.
  8. Next month ×12.
  9. She has $10460.86 in her TFSA at the beginning of .
  10. Transfer in $5000.
  11. Next month ×12.
  12. She has $15931.12 in her TFSA at the beginning of .
  13. Transfer in $5000.
  14. Next month ×12.
  15. She has $21567.76 in her TFSA at the beginning of .
  16. Transfer in $5500.
  17. Next month ×12.
  18. She has $27891.05 in her TFSA at the beginning of .
  19. Transfer in $5500.
  20. Next month ×12.
  21. She has $34406.69 in her TFSA at the beginning of .
  22. Note that she contributed $31000 in total to her TFSA; the other $3406.69 was earned as tax-free interest.

Bob saves some money and spends it later:

  1. Current date is .
  2. Interest rate is 3%.
  3. Deposit $5000.
  4. Transfer in $5000.
  5. Next month ×6.
  6. Transfer out $3000.
  7. Note that the contribution room is still $0. He cannot contribute more without penalty.
  8. Next month ×6.
  9. Now in , the contribution room rises by $8000: A new $5000 amount plus the $3000 that he withdrew.
  10. Deposit $1000.
  11. Transfer in $4000.
  12. Next month ×3.
  13. Transfer out $4000.
  14. Next month ×3.
  15. Transfer in $4000. (He has enough contribution room.)

Carol makes a mistake of over-contributing and neglects it:

  1. Current date is .
  2. Interest rate is 3%.
  3. Deposit $10000.
  4. Transfer in $7000.
  5. Next month ×12. Each month she pays 1% tax on the $2000 excess contribution, which is $20 per month.
  6. In , the excess contribution is absorbed into the new contribution room, so she stops paying penalties.

Dave over-contributes but quickly corrects his mistake:

  1. Current date is .
  2. Interest rate is 3%.
  3. Deposit $10000.
  4. Transfer in $6000. (Contribution room −$1000.)
  5. Transfer in $500. (Contribution room −$1500.)
  6. Transfer out $1500. (Contribution room $0.)
  7. Next month. He pays 1% tax on the high water mark of , which is $1500 of excess contribution.
  8. Starting this month (), as long as things stay the same, he will not pay a penalty tax anymore.

Notes

  • The simulation assumes that the person is at least 18 years of age in . (Contribution room only starts accumulating in year or the year the person turns 18, whichever is later.)

  • The rules are accurate as of the last update date. The contribution room added in years are accurate, whereas future years are based on the assumption that current laws don’t change. It’s also unclear if the TFSA will ever be discontinued to increase tax revenue.

  • Chequing accounts have low (e.g. $0.01 per month on a $1000 balance) or no interest in practice, so this is excluded from the simulation.

  • In reality, the penalty tax is not charged to a chequing account after each month. Instead, it is recorded by the CRA throughout the calendar year, notified to the person sometime after the end of the year, and a “TFSA return” must be filed and paid by June 30th.

  • For simplicity, the case of a person having multiple TFSAs is not simulated. But to show how it works, we simply need a transaction log and balances per account, but the contribution room and the amount-withdrawn-this-year are global variables (per person, not per account).

  • Any amounts spent within the TFSA, such as account fees and trade commissions, are lost forever. They are never added to the amounts withdrawn or the contribution room.

  • Currently, the only way to reset the date and account transactions is to reload the web page.

  • The arithmetic and money flow in this simulation may seem easy, but handling such accounts in real life is nontrivial. This is because in reality, some variables are hard to access (e.g. contribution room) or even not directly available to the person (total-withdrawn-this-year, qualifying withdrawal amounts for reducing over-contribution); the person should keep track of these amounts themselves instead of relying on the bank or CRA. Furthermore, the feedback time for an action is measured in days (e.g. bank transactions), months (accumulation of TFSA penalty taxes), or years (increase in contribution room). The simulation, on the other hand, gives instant feedback and exposes all the hidden state variables, which help tremendously in understanding the financial situation.

  • The program source code is available for viewing.

More info