With the cost of college going nowhere but up, many parents are forced to resort to drastic measures to make a dent in their kids' tuition bills. And for some, that means tapping their retirement funds prematurely.

For better or worse, the tax code makes it fairly easy to use retirement money for higher education purposes. If you're housing your savings in a traditional IRA, you can remove funds without penalty, even if you're not yet 59 1/2, to pay for college for yourself or an immediate family member. And if you're saving in a Roth IRA, you can technically withdraw your principal contributions at any time and for any reason without penalty. Therefore, it stands to reason that accessing retirement funds to pay for college is a strategy many parents are quick to employ.

Group of young adults in graduation gowns holding up caps

IMAGE SOURCE: GETTY IMAGES.

New data from Sallie Mae and the Ipsos research firm, however, tells us that parents are finally getting the message that raiding their retirement funds to pay for their children's education is a downright dangerous move. Specifically, 69% of parents surveyed this year said they won't tap their retirement accounts prematurely to pay for education. That's an improvement from the 60% of parents who said the same thing back in 2016.

If you're thinking of withdrawing funds from your IRA to pay for college, you should know that doing so might put you in a very bad position come retirement. And frankly, you deserve better.

The dangers of paying for college with retirement funds

What's wrong with tapping your IRA to pay those college tuition bills if that money is just sitting there unused at present? A lot of things.

First of all, whatever sum you remove from your retirement plan to pay for college is money that won't be around for you in -- you guessed it -- retirement. So let's imagine that instead of subjecting your kids to a mountain of student debt, you opt to remove $100,000 from your IRA to pay for their degrees instead. The problem with that approach is that you're unlikely to replenish that amount during your working years, which means you won't have that money available during your golden years, when you'll probably come to need it.

But it's not just that $100,000 you'll be missing in retirement; you'll also lose out on whatever growth that money could've achieved by sitting in your account all those years. Imagine you withdraw a much smaller amount -- $30,000 -- to pay for your kids' college when you're 50, and your goal is to retire at 70. If your remaining investments generate an average annual 7% return during that period -- and it's therefore safe to say that your $30,000 would've done so as well -- you'll actually wind up losing out on $116,000 by the time you retire, not just $30,000. And that could make a huge difference when you're living on a fixed income.

Though student loans are no picnic, remember that your children have their whole lives ahead of them to pay back that debt. You, on the other hand, probably have a limited window of time left to build your nest egg, so the last thing you can afford to do is take a withdrawal for non-retirement purposes.

A smarter way to pay for college

Tempting as it may be to access your retirement funds to cover the cost of college, you should pledge to leave that money alone and seek out other ways to manage the whopping expense of tuition. That said, Roth IRAs can actually be a good college savings vehicle provided you open one specifically for the purpose of paying for college and have a separate account earmarked for retirement. This way, you're reaping the tax benefits of Roth IRAs, like tax-free growth on your money and tax-free withdrawals, without putting your retirement at risk.

Another option is to save for college in a 529 plan. Like Roth IRAs, these plans offer tax-free growth and withdrawals provided you use the money for education purposes, and most states offer incentives for saving in their plans to boot.

No matter what savings vehicle you use to set aside funds for college, have a dedicated account for that purpose, and another account for retirement purposes. And then leave that latter account alone until you exit the workforce permanently. Otherwise, you may come to find that while college is just a bit more manageable, retirement is nothing but a financial nightmare from start to finish.

Maurie Backman has no position in any of the stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.