The question comes to investment adviser Jim Miller in various guises, but it comes frequently and it boils down to this: Is money better used to pay down debts or to build an investment nest egg?

Most often the inquiry involves a home mortgage. The other day, Mr. Miller says, it involved a pickup truck.

A client had just bought a vehicle, and wondered if he should pay for it by selling some investments. Miller asked him first to check what rate of return those investments had achieved over the past few years. The exercise prompted the client to change gears: He took out a loan for the truck so that he could keep more money invested.

The equation doesn’t always work out that way, Miller says. Sometimes “eliminate debt” wins over “invest.”

But the question is central to American family finances today. Household debt has reached a historic high, while personal savings are running low for many.

Interest rates add another wrinkle to the pocketbook puzzle: A recent rise in rates means that investors may be able to earn higher interest on a certificate of deposit than they’re paying on their mortgage. In such cases, plowing free cash into investments may be more lucrative than paying down the mortgage.

“My take on it is pure bottom line,” says Miller, a registered investment adviser in Columbiana, Ohio. “If in fact the rate that they’re paying on a loan … is substantially less than the rate that they’re earning on their investments through real life experience, I encourage them to extend the mortgage as long as they can.”

The phrase “real life experience” is key.

Some people invest on their own, others with help from a broker or adviser. But either way, it’s important to gauge whether your money has been earning 10 percent or 3 percent annually – after averaging out the good and bad years. The rate of return is crucial, but just one of several factors in deciding whether to invest money rather than use it to pay down a mortgage.

Other factors include your level of financial discipline, your willingness to take on additional risk, your taxes, and your time horizon. Indeed, the choice is probably less about spreadsheet calculations than about temperament. For some people, paying off debt brings great peace of mind, while investing brings worry.

Others advocate keeping the largest mortgage possible – even borrowing home equity to put more money into stocks during market downturns.

In essence, this wealth-building strategy applies the principle known as “arbitrage.” It’s what bankers or bond traders do when they borrow at one interest rate, and lend (invest) at a higher one. This adds risk in the form of investment price swings. But in another way it reduces risk, since less of your net worth is tied to the value of a single asset: your home.

“Do the math,” says Jon Hanson, an author and speaker on personal finance based in Columbus, Ohio. “The best reason” to pay off a mortgage, he says, “is just having the emotional peace of mind.”

Here’s how the math works in the case of a couple with a 25 percent federal tax rate and a 6 percent rate on their mortgage. Because mortgage interest is tax-deductible, their effective interest rate, with the tax-benefit figured in, is 4.5 percent. If stocks return about 7 percent a year – which some analysts see as a reasonable forecast – the couple stands to gain by investing rather than paying down the mortgage. But much of the financial benefit vanishes if the investment isn’t tax-sheltered.

And be careful with bonds, experts say. If they aren’t held in a tax-sheltered account, Treasury notes earning 5 percent would net only 3.75 percent for the couple, after taxes.

Often financial experts refer to certain loans as “good debt.” A mortgage leads toward home ownership, and a student loan can pave the way to a high-paying career.

On the other hand, “I don’t think it can ever be considered ‘good debt’ unless you can actually show a return on it,” says Mr. Hanson, author of “Good Debt, Bad Debt.”

He warns that the tax advantages of a home mortgage, while real, may not be as big as people think.

The standard deduction on federal taxes for a married couple filing jointly, for example, is $10,300. The interest paid on a $200,000 loan might not be much more than that in a given year. So for households that don’t have other deductions that approach $10,300, the after-tax mortgage rate may be similar to the pretax mortgage rate.

The math may be arcane, but doing it can bring rewards for young and old alike. “Managing the last few pennies out of a dollar, for a lot of people, is going to mean the difference between comfort and a tight belt,” says Miller, author of “Retire Dollar Smart.”

For a young couple, with the option of tucking money into a tax-sheltered retirement account, “it doesn’t make much sense to pay down your mortgage,” says Greg McBride, a senior financial analyst at Bankrate.com.

One exception, he says, is that people might want to pay down a high-interest “jumbo” loan. Once the debt falls below $417,000, it can be converted to a lower-rate conforming loan.

Experts offer some other nuggets:

Don’t fall further into debt. Many have borrowed against their home equity, but used the cash for spending rather than for investing or discharging other debts.

Have a cushion in case home prices don’t keep rising. If you need to sell your home, you’ll have to cover transaction costs (such as broker’s commission) as well as pay off your loan. The cushion may come from investment dollars or from paying down mortgage debt.

Seek professional help if the choices seem hard to fathom, but find a seasoned adviser.

Consider locking in a low-interest rate. Whether you’re paying down your mortgage or not, adjustable-rate mortgages are ratcheting upward. Refinancing with a fixed rate may make sense.