There are different reasons consumers end up needing to borrow money. In some cases, it could boil down to sudden home repairs or falling on hard financial times. In other cases, it could stem specifically from medical bills.

Of course, getting approved for a loan isn't a given. And so rather than face potential rejection, you may be inclined to borrow money from your own retirement savings instead.

It's an option you generally won't be privy to if you're housing your nest egg in an IRA. But many 401(k) plans do allow savers to borrow against their balances.

A person at a laptop.

Image source: Getty Images.

In recent years, however, that practice has been declining. And that's actually a very good thing.

401(k) loan balances are shrinking

Fidelity reports that the percentage of 401(k) plan participants with an outstanding 401(k) loan is down to 16.7%, compared to 21% five years ago and 17% one year ago. That's both surprising and impressive given that inflation has been wreaking havoc on consumers over the past 12 months in particular. It's also surprising given that over the past five years, savers have had to grapple with a pandemic and a world of financial upheaval in its wake.

The problem with 401(k) loans

A 401(k) loan might seem like a convenient solution when you have a need to borrow money. But actually, these loans can be quite risky.

If you don't repay your 401(k) loan, it will be considered a withdrawal from your retirement plan. And if you're not yet 59 1/2 years of age, that means facing an early withdrawal penalty.

But penalties aside, if you don't repay your 401(k) loan, you'll have less money to actually retire on. And remember, it's not just your principal loan amount to account for in this context. You should also consider lost growth on the sum you might borrow and fail to repay.

Let's say you take a $20,000 loan from your 401(k) at age 35 and fail to pay it back. If you don't retire until age 65, it means you're losing out on 30 years of growth.

Now, let's imagine your 401(k) plan generates an average annual 8% return, which is a bit below the stock market's average. That means that $20,000 withdrawal will have cost you around $201,000 when you factor in lost investment gains.

A risk not worth taking

It's easy to see why borrowing against a 401(k) balance is tempting. But before you go that route, consider the downside -- and look at other borrowing options.

One final thing you should know about 401(k) loans is that once you separate from your employer -- whether voluntarily or not -- your repayment window could shrink down to a matter of months. And if you can't pay back your loan during that time, you'll risk having it treated as an early withdrawal.

If you borrow money via a personal or home equity loan, your repayment period won't be tied to your employment status. So you may want to consider going that route if you need to drum up some cash.