The U.S. Census Bureau estimates that 79% of Americans have access to a 401(k) or similar type of retirement plan. If that's the case for you, one of your most important responsibilities is to pick the best funds based on your timeline before retirement. 

What it really comes down to is this: If you don't make the best asset allocation decisions, you'll probably come up short in retirement. Taking a few hours each year to make sure you are putting your money into the best funds in your 401(k) could very well add up to tens -- or even hundreds -- of thousands of dollars more when you retire.  

Diagram of two light bulbs with risk and reward written under them and a dotted line separating them.

Image source: Getty Images.

Two simple charts to get you on the right track

When it comes to where to invest in your 401(k), it really boils down to allocating between stocks and bonds. And while it is often described in terms of risk, with bonds being lower risk and stocks being higher risk, I think that's a bad definition, because it's terribly misleading. 

As the chart below illustrates, stocks versus bonds is really more about time

VBTLX Total Return Price Chart

VBTLX Total Return Price data by YCharts.

This chart shows the total returns generated by stocks versus bonds since October 2007 -- the stock market peak before the Financial Crisis and Great Recession. In this chart, stocks are represented by the Vanguard 500 Index Fund Admiral Shares (NASDAQMUTFUND:VFIAX), and bonds are represented by the Vanguard Total Bond Market Index Fund Admiral Shares (NASDAQMUTFUND:VBTLX)

As you can see, anyone 100% invested in stocks would have lost over half their investment by early 2009, and taken over four years to get back to breakeven. Someone 100% invested in bonds, on the other hand, would have never really been in trouble of losing much money. So over the short term, bonds are the clear winner here. 

But here's the kicker: Once we start looking at the long term, stocks have raced ahead, generating far greater returns than bonds over the past decade. And this isn't some recent aberration. Stocks have generally always been a better-performing asset than bonds over the long term. 

The wealth-building power of stocks is even more apparent when we measure it from the stock market's bottom in March 2009:

VBTLX Total Return Price Chart

VBTLX Total Return price data by YCharts.

The lesson? Don't think about stocks versus bonds in terms of your comfort with risk, but with how long your time horizon is. If you're 30 or 40 or even 50, and still more than a decade away from retiring, the vast majority of your 401(k) should probably be invested in stocks, while your exposure to bonds will start ramping up as you close in on retirement. 

Let's move on to the funds that make the most sense for 401(k) savers. 

3 top stock-based funds

In addition to the Vanguard 500 Index Fund discussed above, which tracks to the S&P 500 Index (SNPINDEX:^GSPC), the Vanguard Total Stock Market Index Fund Admiral Shares (NASDAQMUTFUND:VTSAX) is a solid consideration. It is comprised of more than 3,700 different individual stocks, and offers the same low cost structure as the Vanguard 500 Fund, with expense ratios of 0.04%, which works out to about $4 per $10,000 invested per year. Why does the expense ratio matter? In short, because there is a lot of evidence that the more expensive a fund's fees are, the lower its returns tend to be. And since you still pay the fees -- not your employer, even in a 401(k) -- the less you pay in fees, the better your returns will generally be. 

Retirement investors should consider having some exposure to real estate. Real estate investment trusts (REITs) are publicly traded like other stocks, but are companies that must have at least 75% of their assets in real estate, cash, or federal treasuries, and 75% of gross income must come from real estate.

A top REIT index fund is the Vanguard Real Estate Index Fund Admiral Shares (NASDAQMUTFUND:VGSLX), which is invested in just over 180 different publicly traded REITs, and has a 0.12% expense ratio. 

The downside of investing in a real estate fund is that, since it will be more concentrated than a broader index fund, it can be more volatile. But the upside is that it will generate substantially higher income. At recent prices, the Vanguard Real Estate Index Fund pays a 4.5% dividend yield, compared to 1.76% for the Vanguard 500 fund. This can make for a solid long-term holding that generates a steady source of cash for income. 

2 best bond funds

In addition to the Vanguard Total Bond Market Index Fund, which is comprised of a broad swath of approximately 30% high-quality corporate bonds and 70% U.S. government bonds, retirement savers who are closer to retirement may want to allocate some of their 401(k) into the Vanguard Short-Term Treasury Index Fund Admiral Shares (NASDAQMUTFUND:VSBSX). While the Total Bond Market Index Fund will generally provide higher rates of return, it is more volatile:

VBTLX Chart

VBTLX data by YCharts.

The chart above doesn't include yield generated from the bonds held in the funds, but just shows the change in value of each share of the fund. This is very important when you start thinking about assets you'll be selling in the very short term, such as only a few years.

As you can see, there have been multiple periods over the past decade when the Total Bond Fund lost more than 5% of its value within a few months, while the short-term Treasury Index Fund held very steady in value. This makes it a wonderful tool to help maintain predictable value of retirement assets you'll be cashing out in the very shortest of terms. 

Use low-cost index funds: Stocks for growth, bonds for predictability 

If the Vanguard funds described above aren't available in your 401(k), you should have access to similar funds from a different fund manager, probably with similar fee structures and rates of return. 

The most important takeaway: Use the right fund for the job at hand. For your long-term needs, invest in stocks. This means you'll want to own some stocks even in retirement, since the average 65-year-old American will live past 80. For your short-term needs, invest in bond funds. They won't generate the same kinds of returns as stocks, but you'll also avoid that unexpected 25% -- or more -- drop in value a few months before you need to cash out. 

Jason Hall has no position in any of the stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.