One key to being smart financially is to allocate your assets intelligently. Generally speaking, that means putting your money in the best places for it to grow while managing its exposure to risk.

Given that definition, it makes sense that many of us wonder whether it would be smarter to make extra payments on our mortgage principal or invest that money. It's an interesting debate, and one worth considering.

Crunching the numbers
First off, let's look at some data. Over the past century, the stock market has earned approximately 10% annual returns (before taxes and after inflation). If your mortgage rate is 6% and your tax rate is 25%, your after-tax mortgage rate is 4.5%. (Here's the math, in case you don't believe me: (1 - your tax bracket) X your mortgage rate = after-tax interest rate.)

Thus, any investment that can earn a return above 4.5% is a no-brainer, right? But hold on. The market's 10% isn't nearly as much of a sure thing as the 4.5%. Over your investing period, which might be the next 10 years or the next 40 years, the stock market's average annual return might be 2%. Or 12%. No one knows. And since mortgage interest is tax-deductible, leaving your mortgage running offers a bit of a tax break, too.

However, if one possible destination for your dollars is a retirement account, such as an IRA or 401(k), there are extra tax benefits attached to that money as well. Plus, since you can contribute only a limited amount each year to these plans, it's worth contributing regularly as early as possible -- you won't be able to jump-start such an account with a $100,000 infusion later in life.

There's also the big economic picture to consider. Real estate has been hot over the past decade or so, but so have interest rates, which have hovered near record lows. But this has been changing. With interest rates rising, the real estate boom may end.

The big picture
But before we go further, let's back up and survey your personal situation more broadly. Is your main choice between the market and your mortgage, or are there other compelling options for your money? For example, do you have significant credit card debt? (Or, really, any credit card debt?) If you do, it's best to pay that off pronto. Otherwise you'll be losing money -- anywhere from 10% to 40% or more per year -- instead of making money.

Diversify
One big reason I'm not putting all my investment dollars into my mortgage is diversification. Doing so would be concentrating my investments too much in one asset -- my home. Sure, it has appreciated at a great clip in the past few years, but I can't assume that will continue. Home prices have been known to fall. If I had most of my eggs in this three-bedroom basket and it started shrinking, I'd be in trouble. So for me, it makes the most sense to keep making my regular mortgage payments while also investing in stocks for the long term.

To appreciate the value of both options, consider the recent words of The Automatic Millionaire author David Bach:

U.S. real estate values have been going up steadily for nearly four decades -- an average of 6.3% a year since 1968, which is when the National Association of Realtors first started keeping track. According to Freddie Mac (a.k.a., the Federal Home Loan Mortgage Corporation), since 1950 U.S. house prices have never experienced a year-to-year decline nationally. Compare that to the S&P 500, a major stock-market indicator that has had no less than a dozen down years in the same period -- or the market for U.S. Treasury bonds, which has fallen in 17 of the last 55 years.

Still, the stock market's annual average return over long periods is considerably better than real estate.

The Foolish bottom line
What should you do? Well, I think it's rational to not focus too much on your home, though you should still see it as the major asset that it is. If your investment horizon is long -- at least 10 years -- then the stock market is likely to be a great place for your money. Here are some ideas:

  • Keep paying off your mortgage on schedule and invest in the stock market when you can -- perhaps via a simple broad-market index fund such as the low-cost Vanguard S&P 500 Index (FUND:VFINX).

  • If you want to make a dent in your mortgage, consider making just one extra mortgage principal payment per year (assuming your mortgage's terms allow you to do so). That single extra payment can knock seven or eight years off a 30-year mortgage.

  • If you really want to invest more in real estate, consider doing so via real estate-related stocks. This strategy offers the benefits of diversification and liquidity. There are a wide range of real estate-related businesses to take a look at, such as home builders KB Home (NYSE:KBH) and Pulte Homes (NYSE:PHM), home improvement retailers such as Lowe's (NYSE:LOW) and Home Depot (NYSE:HD), and mortgage lenders such as Countrywide Financial. And to invest even more directly in real estate, check out real estate investment trusts (REITs).

The debate between the market and your mortgage can be a difficult one. But make sure you consider your own financial situation before proceeding.

Money matters keeping you up at night? We're offering an exclusive teleseminar with Motley Fool co-founders David and Tom Gardner. They'll tell you when to buy and sell stocks in this uncertain market.

Selena Maranjian owns shares of Home Depot. Home Depot is a Motley Fool Inside Value recommendation. For more about Selena, viewher bio and her profile. The Motley Fool is Fools writing for Fools.