When faced with a financial emergency, Americans are increasingly tapping their retirement accounts to come up with the cash.

Last year, some 4.8% of plan participants took hardship withdrawals from 401(k) plans, according to Vanguard, up from 3.6% in 2023.

As Vanguard researchers note, the prevalence of automatic enrollment means that more workers than ever now have workplace plans — especially those with inconsistent or unreliable income. And legislative changes have made it easier than ever to make a hardship withdrawal, which allows investors to take money out of retirement accounts penalty-free provided its used for an “immediate and heavy” financial need.

If something like that comes up, it can be tempting to look toward the (hopefully) big pile of money you have saved for retirement to see you through it. But generally speaking, you should look elsewhere, says Paul Brahim, a certified financial planner and president of the Financial Planning Association.

“It should really only be a last resort,” he says.