As a whole, Americans aren't doing a great job of saving for retirement, a fact that has been well publicized in recent years. In fact, the median 401(k) balance in the U.S. is just $29,603, which, as we'll see shortly, isn't nearly enough. And when you combine the ever-increasing life expectancy of Americans with the uncertain future of Social Security, it's more important now than ever to set yourself up for financial freedom in retirement.

With that in mind, here are three common retirement mistakes the average American makes, and how you can stop making them.

Paying too much interest

The average American household carries $5,700 in credit-card debt, as of the latest data. While this may not seem like a large amount of money, especially compared to other types of debt such as student loans and mortgages, you may be surprised at the effect of a seemingly small credit-card debt load on your financial comfort in retirement.

According to CreditCards.com, the national average credit-card APR is 15.07%, which implies that the average household spends about $859 per year in credit-card interest. Here's how this affects your retirement.

If, instead of simply handing that money over to a credit-card company each year, you invested it in a low-cost S&P 500 index fund, you could have about $13,350 after 10 years. After 20 years, your account could be worth more than $46,000, based on the S&P's historical returns. And after a 35-year career, investing your annual credit-card interest payments could result in $207,000 added to your nest egg. That's why credit-card debt is so dangerous to your retirement.

Note: This is based on average historical stock-market returns of 9.5%. Actual investment returns are likely to fluctuate significantly each year.

Finally, keep in mind that $5,700 is just the average debt, and it includes households that have none at all. Many households have credit-card debt of $10,000, $20,000, or much more. Just imagine how the interest you pay could be put to better use.

Not contributing enough to a 401(k) or IRA

How much will you need for retirement? A good rule of thumb is to plan on needing about 80% of your salary after you retire in order to maintain your lifestyle. This isn't perfect -- you're income needs may be more or less, depending on several factors -- but it's a good starting point.

Some of this income will come from Social Security. You can estimate this amount by creating an account at www.ssa.gov, and viewing your latest Social Security statement. The rest will need to come from your retirement savings.

Therefore, by multiplying your salary by 80%, and subtracting your expected Social Security income, you can get a pretty good idea of the amount of income you'll need from savings. And by using the general "4% rule" of retirement, you can estimate your savings needs by multiplying your annual income need by 25.

For example, if you and your spouse's combined salary is $100,000, you can estimate that you'll need $80,000 per year after retirement. If you expect $30,000 per year from Social Security, this leaves an income need of $50,000 per year from your savings. Multiplying by 25 reveals a savings target of $1.25 million.

The problem is that most people don't save nearly enough to meet their savings needs. According to Vanguard's 2015 How America Saves (link opens PDF) report, the average 401(k) participant defers 6.9% of his or her salary. Including employer-matching contributions, the total average contribution as a percentage of salary is 10.4%.

As an example, let's consider a worker who earns $50,000 per year. Assuming the average 10.4% contribution rate and 7% annual investment returns, this individual can expect to have $603,000 after 30 years (assuming 2% annual raises).

This sounds like a pretty substantial nest egg, but there are a few things to consider. First, this translates to just $24,120 in annual retirement income based on the 4% rule, which is unlikely to be enough. Second, don't forget about the effects of inflation: $603,000 will not have the same purchasing power in 30 years. In fact, even if we assume an historically conservative 2% inflation rate going forward, this nest egg will be the equivalent of $329,000 in today's dollars.

Experts generally suggest that you contribute 10%-15% of your salary to your retirement accounts, before employer-matching contributions. For 2016, you're allowed to defer up to $18,000 of your salary into your 401(k), so take advantage of this, and consider increasing your contribution rate. You may be surprised at the difference a percentage or two can make.

Staying away from stocks

According to a survey by Bankrate.com, more than half of Americans are not currently investing in the stock market (including through mutual funds). Even among Americans who do invest in a 401(k), only 72% of plan assets are invested in equities.

The younger age groups are getting it right. According to Vanguard, 401(k) participants under the age of 25 have 87% of their 401(k) assets in stocks. However, this drops off significantly for older age groups. In fact, 401(k) participants in the 55-64 age group have just 61% of their assets in stocks, with the rest in fixed-income investments, and 14% in cash.

Now, it's completely understandable to scale back one's exposure to equities somewhat as retirement approaches. However, 39% of a 55-year old's portfolio in non-stock investments is a bit too much -- especially the 14% sitting in cash at zero growth.

The problem is that, over time, stocks simply produce better returns than other asset classes. By keeping too much of your money in other assets as you approach retirement, you could deprive yourself of much-needed gains at the time you need them most. Consider the performance of three portfolios over a 35-year time period -- one in 90% equities and 10% fixed income (Portfolio 1), one in 80% equities and 20% fixed income (Portfolio 2), and another with 60% equities, 25% fixed income, and 15% cash (Portfolio 3), based on historical average returns.

Note: Assumes annual investment of $5,000.

As retirement approaches, it makes sense to scale back exposure to stocks a little bit, but they should still make up most of your portfolio. Instead of ditching equity funds altogether, consider switching from more-aggressive stock investments such as small-cap growth funds to more-stable equities, such as a blue-chip-value stock fund.

The bottom line on retirement savings

The overall takeaway here is that it's important not to underestimate seemingly small changes in your savings habits when it comes to your retirement nest egg. Simply paying down your credit cards a little more quickly, reallocating a bit more of your 401(k) to stocks, or increasing your savings rate by a percentage point or two could have a dramatic effect over the long run.