Having a healthy investment account balance is key to a secure retirement since you can't live on Social Security alone. Building the nest egg you need is going to require making smart moves throughout your career -- as well as avoiding major mistakes. 

Unfortunately, according to recent data from Edelman Financial Engines, there's one big error that could cut your 401(k) account balance in half. Here's what it is -- and how you can avoid it.

Older woman sitting on couch looking at financial paperwork.

Image source: Getty Images.

This is a 401(k) mistake you can't afford to make

According to Edelman Financial Engines, defaulting on a single 401(k) loan is the mistake that could cut your retirement savings by 50%. 

Edelman's calculation was based on a hypothetical worker with $100,000 invested by age 45. The worker had 9% annual 401(k) contributions (including employer match) and 7% average annual returns, which would've resulted in a nest egg of $1.2 million by age 70. One defaulted 401(k) loan at age 45, however, would leave the person with just $590,247 instead.

This example may be different than your situation. You may be thinking of taking a smaller loan that you could easily pay off, or borrowing at a younger or an older age. But it's still illustrative of an important point.

When you take money out of a 401(k) and don't put it back, you're losing much more than the amount you've withdrawn. You're not only going to be hit with early withdrawal penalties for the defaulted loan, but you're also going to lose all the compound interest the withdrawn funds would have earned over the rest of your working life. 

Say, for example, you borrow less than the hypothetical worker mentioned above, taking just a $10,000 loan and defaulting on it -- but you do it 40 years before retirement. Over the 40 years the $10,000 would've been invested, that money would have grown to just over $217,000 (assuming an 8% average annual return). But if it's not in your account, that won't happen.

Obviously, the more you borrow and the younger you are when you do it, the more outsized the consequences of a defaulted 401(k) loan are. Ultimately, however, the price is far too high for most people to pay -- even without factoring in the 10% penalty that comes from defaulting. 

Of course, not everyone who takes out a 401(k) loan ends up defaulting. But there's a very real risk of this occurring -- especially since the repayment timeline can be accelerated if you lose your job.

And even in a best-case scenario where you're able to pay back the money, you'll still lose out on the returns it would have earned during the time your money wasn't invested. Edelman Financial found even this has consequences, with the hypothetical worker above seeing their account balance fall 15% from $1.2 million to $992,519 even if the 401(k) loan was fully repaid.

The damage isn't as extreme, but losses still occur due to missed investment returns -- and a lost opportunity to make contributions if your plan doesn't allow them until the loan is repaid. And if the stock market happens to perform especially well during the period you aren't invested, you could suffer even bigger losses. 

The bottom line is, when you borrow money from your retirement accounts, you are taking a big gamble that you won't default. And you're missing out on the chance for your money to work for you. The damage to your retirement accounts can be dramatic, so these loans are to be avoided except in situations of dire need where there are no other viable options.