Retirement is becoming more expensive than ever, with the average American expecting to need nearly $2 million to enjoy their senior years comfortably, according to a survey from Charles Schwab.

Because it's crucial to save as much as possible for retirement, that also means avoiding costly mistakes. And there's one blunder that may seem harmless on the surface, but it can cost you tens of thousands of dollars or more.

Woman looking at a calculator and a notebook

Image source: Getty Images.

The expensive mistake you may not realize you're making

Your 401(k) is a powerful investing tool, but it's important to use it wisely. When you have thousands of dollars socked away in your retirement fund, it may be tempting to use your 401(k) as a savings account and withdraw some cash here and there for emergencies. However, that can cost you big time in the long run.

Generally, when you withdraw money from your 401(k) before age 59 1/2, you're subject to income taxes and a 10% penalty on the amount you take out. The more dangerous consequence, though, is how much you'll lose in potential investment gains over time when you withdraw from your savings.

Your savings rely on compound interest to grow, and every time you take money out of your 401(k), you're limiting your investments' growth potential. Withdrawing a few hundred or thousand dollars here and there may not seem like it would make a significant difference, but even one withdrawal can potentially cost you tens of thousands of dollars over time.

How just one withdrawal could cost you $30,000

To see just how much a single withdrawal could affect your long-term savings, let's look at an example.

Back in April, when many Americans were raiding their retirement funds due to the coronavirus pandemic, the average withdrawal was $5,500, according to date from Fidelity Investments. The average 401(k) account balance is approximately $104,400.

Say you have $104,400 stashed in your 401(k), and you take a $5,500 withdrawal. Here's how much that one withdrawal could affect your long-term savings, assuming you're earning a 7% annual rate of return on your investments and you're not making any additional contributions.

Number of Years Total Savings After Taking a Withdrawal Total Savings Had You Not Taken a Withdrawal
0 (Today) $98,900 $104,400
15 $272,868 $288,043
20 $382,712 $403,995
25 $536,773 $566,624

Source: Author's calculations

After 25 years, that $5,500 withdrawal can amount to $29,851 in lost potential gains. And if you were to continue saving for more than 25 years, you could potentially miss out on even more money.

It's also important to keep in mind that this is a result of just one withdrawal. If you were to make repeated withdrawals over the years, you'd see an even greater impact on your total savings.

Leaving your savings alone can help it grow faster

Although tapping your 401(k) may not seem so bad in the short term, it can wreak havoc on your long-term savings -- especially if you withdraw a lot of cash or make several withdrawals over time. While in true financial emergencies you may have no choice but to raid your savings, try your best to avoid dipping into your 401(k) if at all possible. By leaving your money alone, it will be easier to build a healthy nest egg by retirement age.