The federal government has created two programs that allow you to withdraw money from an RRSP without a penalty before you retire — the Home Buyers' Plan and the Lifelong Learning Plan.

Whenever you take money from a registered retirement savings plan, you are taxed on it at your marginal tax rate, so you lose 12 to 49 per cent of your savings off the top to the tax man, depending on your income and where you live.

There are plenty of bad reasons to withdraw money from your RRSP – among them needing cash for a vacation, wanting to buy a car or giving money to the kids.

The best reason to take out money is because you are retired and want to convert it into a registered retirement income fund that will pay your bills. At that point, you are likely to be in a much lower tax bracket than when you were working. 

Financial advisers point out that if you do withdraw money, you miss out on several years of the compound growth you would have on the RRSP investment.

But both buying a house and getting an education are investments in themselves that can pay off in the longer term.

Here's how those two programs work.

Home Buyers' Plan

Each individual can withdraw up to $25,000 to buy or build their first home or to buy a home for a related person with a disability by applying under the Home Buyers' Plan. 

For couples who are first-time buyers, that's up to $50,000 toward a first home. The down payment is often a stretch for young buyers and putting more than 20 per cent down means escaping the additional cost of CMHC insurance. 

Buyers have to enter into a written agreement to build or buy the home, and it must take effect before Oct. 1 that year or after the year of withdrawal.

For those who are buying for a relative with a disability, it is the relative who must have entered into such an agreement.

The buyer, i.e. the person with the disability, has to live in the home. It can't be a rental property.

The catch is that anyone taking advantage of the program must pay back what they took out of their RRSP within 15 years, starting in the second year after purchase of the home.

A bank can help you set up regular withdrawals so you meet the repayment schedule. Many people are house-poor in the first few years of home ownership, so it can take a lot to structure their finances to both pay the mortgage and refund their RRSPs.

There's a financial penalty from the government if you don't – they'll start taxing you on the money you withdrew.

And when you repay the money to your RRSP, there won't be a tax deduction from your income, because you got that deduction the first time around.

It's a popular program. According to research from the Canada Revenue Agency, 1.8 million Canadians have used the Home Buyers' Plan since 1992, borrowing more than $18 billion from their own savings.

But for the 2011 tax year, 47 per cent had paid less than the full required repayment and were being taxed for using it.

Lifelong Learning Plan

The Lifelong Learning Plan allows you to borrow up to $10,000 a year to finance full-time education at a qualifying school. You can withdraw a maximum of $20,000 over a period of four years from an RRSP owned by yourself or your spouse. If you both go back to school, you can withdraw up to $40,000.

It is essentially an interest-free loan from the RRSP to finance retraining, but only for you and your spouse. It can't be used for your children.

To take the money out of the RRSP, you must be enrolled in a school that qualifies for the education tax credit or have received a written offer to enrol by March of the following year.

By the fifth year after the first LLP withdrawal — or the second year after you stop going to school full-time —  you must start repaying into your RRSP. The first year, you're expected to repay a minimum of one-tenth of what you owe, though you can repay it faster. You have 10 years to make up the full amount.

As with the Home Buyer's Plan, the government will begin taxing you on the money if you don't rebuild your RRSP.

If you're earning a significant income and would benefit from the tax deduction a regular RRSP contribution would get you, then keeping to the 10-year repayment schedule and also making regular RRSP contributions makes sense.

You can use the LLP as many times as you like up to the age of 71, as long as you have repaid back the money you took out for previous LLPs. It can be a tool to retrain if you are thrown out of a job — without the penalty of paying tax you would otherwise owe on an RRSP withdrawal.

The CRA has not released recent figures on hwo many Canadians take advantage of the LLP.