If you maximized your TFSA contribution each year, you would have contributed $31,000 to the account for 2014.

Now let’s say that your investments in the TFSA have grown in value to $50,000. You then withdraw the full $50,000 from your TFSA at the end of 2014.

How much is added back to your contribution room at the start of 2015? $31,000 or $50,000?

The answer is $50,000. In 2015 you can contribute $50,000 to your TFSA plus your annual contribution amount of $5,500.

The formula for determining your contribution room the following year is as follows:

Unused TFSA contribution room to date + Total withdrawal made in this year + next year’s TFSA dollar limit = TFSA contribution room at the beginning of next year

A few more examples from Canada Revenue Agency (CRA):