A 529 Plan is named after the IRS code section plan named Section 529, and it was started back in 1996. It's a savings plan specifically for higher education, colleges, universities, and trade schools.
Normally, people think of it as how to save for college for your kids. You can certainly do that. You can put up to $13,000 per year, per child in these 529 plans. You don't get a tax deduction for the contribution, but all the earnings are tax free or tax deferred. Now tax free, if you use it for the intended purpose. You put money away, it earns over a period of time, if you use it for the beneficiary, your child, to go away to college, pay tuition, room and board, supplies, computers; then it all comes out tax free.
If they don't go to college, let's say, or trade school, you can change the beneficiary. So if you have another child that is going away to college, you can change the beneficiary to that child and use it for them. In fact, if no child goes to college, you can actually use it for you, if you want to go back to college.
It's a really flexible change in beneficiaries. But, if there is money left over in the 529 Plan, and you take it back, that's when it becomes taxable. The principal you put in, the $13,000 per year, never is taxable, but the earnings come back as taxable; plus, there is a ten percent excise tax, if any of it comes back.