The average American thinks they'll need approximately $1.7 million to retire comfortably, a survey from Charles Schwab found. Considering the median amount baby boomers have saved for retirement is just $152,000, according to a report from the Transamerica Center for Retirement Studies, there's a significant gap between what workers have saved and how much they may need to last the rest of their lives.

To reach major saving milestones, like saving at least $1 million for retirement, you may think you simply need to supercharge your savings and make sacrifices to save as much as you can each month. But sometimes where you stash your money is just as important as how much you're saving. And more than half of those preparing for retirement are making this one mistake that could be setting them up for financial failure.

Two older people talking on a couch

Image Source: Getty Images

Where you put your money matters

Of those who are saving for retirement, 53% are stashing their money in a savings account, according to a survey from Morning Consult. At first glance that may seem like a perfectly acceptable place to store your cash. After all, savings accounts are safe, your money is protected from market downturns, and high-yield savings accounts can provide much higher returns than your average bank savings account.

However, while savings accounts are a good place to park your cash for short-term needs, they're not the best option for long-term financial goals.

Even the highest-yielding savings accounts have interest rates of just 1% to 2%, which may not even keep up with inflation. In other words, if left in a savings account for years or decades on end, your money may actually lose value. In addition, it's much harder to save as much as you need for retirement when you're earning a rate of return of only 1% to 2%.

For example, say you have a goal of saving $750,000 by age 67, and you started saving at age 30. If you're stashing your money in a savings account earning 2% interest per year, you'd need to save just under $1,200 per month for 37 years to reach your goal. But if you had invested in the stock market and earned a 7% annual rate of return, you'd only need to save around $400 per month.

Many people shy away from the stock market because it seems inherently risky. Especially given that so many investors are still recovering from their losses during the Great Recession, you may be hesitant to risk your hard-earned cash by putting it in the stock market. But the stock market isn't as risky as it may seem, and investing in it is the best way for workers to accumulate substantial savings in a relatively short time.

Investing your cash while limiting your risk

Of course, you'll still need to be smart about where to put your money to avoid losing everything. If you invest your entire life savings in a new tech stock that you have a gut feeling will become the next household name, and that company goes under, you'll be in a heap of financial trouble. But by investing in relatively safe funds, you can limit your risk while still reaping the rewards of high rates of return.

Index funds and mutual funds are good places to start. Essentially collections of dozens or hundreds of different stocks, these funds allow you to spread your money across different investments to limit your risk. That way, if one or a few of the stocks within the fund decrease in value, you won't lose a substantial amount of your investment. While there's still some risk involved (you'll never be able to completely avoid risk with the stock market), your money is still as protected as possible.

Exactly how much of your money you should put toward stocks and which funds you should invest in depend on a few factors, such as your age and how comfortable you are with risk. The younger you are, the more risk you can afford to take on. You'll likely earn higher returns, and if you do experience some losses, you still have decades to recoup your money before you retire. As you get older, you can weight your portfolio more heavily toward safer investments, like bonds, to further limit your risk as you get closer to retirement.

Also, it's not as confusing or difficult as you may think to invest in the stock market. In fact, all you need to do to start investing is start saving in a 401(k) or IRA. With IRAs in particular you have a wealth of investment options to choose from, so no matter how comfortable or uncomfortable you are with risk, there's an option for you. And if you have access to a 401(k) through your employer, you can probably transfer a portion of every paycheck to your retirement fund, which makes investing easy.

This isn't to say savings accounts aren't worthwhile at all. For short-term needs, like building an emergency fund or saving for a down payment on a house, they can be a great way to keep your money safe while still earning a solid interest rate. But for long-term financial goals, investing in the stock market is your best chance to establish a strong, healthy nest egg.