When it comes to credit cards, the question we Fools are most often asked is whether it pays more to invest or pay off debt. The answer, of course, is that it depends.

The upside of debt
Not all debt is terrible. Consider your mortgage. Think you could buy that four-bedroom house you're in for cash? Probably not.

Companies, too, use leverage to their advantage. Some of the world's largest and greatest organizations owe billions, including General Electric (NYSE:GE), which carries $376billion in debt as I write.

But, hey, you're not GE, and there's a limit to what you should owe. Mortgage lenders, for example, prefer that your total monthly obligations, including a home loan, equal less than 50% of your income. If you're at or above that limit, you may be a threat to your financial security.

Choosing to invest
But even then the choice of paying off debt versus investing isn't so simple. Here's why: There are times when you can earn more than the cost of debt by investing.

Take our car loan, for example. We financed our minivan on the cheap through a national credit union open to employees of United Airlines (my dad worked there for more than three decades). There's just one condition: The loan payment must be automatically withdrawn from my account, which means I must maintain a balance.

That's a no-brainer. My account pays 4.65% in interest quarterly, which compares very well with the 3.90% it costs me to carry the loan. In investing, this is called creating value. I'm earning more than my debt costs. If you can do the same, then by all means, invest before you pay off debt.

Are you creating value? Or destroying it?
But, of course, such situations are not common. Furthermore, not all accounts are equal. I may be creating value in my credit union account, but my home equity line of credit costs 8% currently and the rate is likely to keep rising. I'd have to earn at least 9% -- and this isn't a great market in which to easily earn 9% -- on my other investing capital to justify paying the minimum on my HELOC. You'll pardon me if I'm not willing to take that chance.

Put even more simply, if you earn $7,000 per month and $2,000 of that is disposable income, where would you rather put the money? Into individual stocks that could fall or into paying off a credit card debt that costs you 12.9% to maintain? The latter is definitely the better choice!

As you take stock of your debt, rank your obligations by interest. Then pay off the highest interest obligations first. Doing so is like investing in hypergrowth stocks without the risk. And the result will be the same: A greater net worth with improved financial security.

The Foolish bottom line
It's a good rule of thumb to always pay off debt before investing. But like most rules, this one, too, may be broken. It all depends on whether, through investing, you're able to create value by earning more than the cost of your debt. So, rank your obligations, review your investing choices, and then act Foolishly.

And, of course, check back here often. We've plenty of great information about managing debt at the Credit Cards discussion board to get you started. Or, if you'd like more hands-on help, may I suggest Motley Fool GreenLight? Our upcoming newsletter service is tailor-made for Fools like you. Click here to get more information.

Fool contributor Tim Beyers hopes you don't have to struggle with debt as he has. Tim didn't own shares in any of the companies mentioned in this story at the time of publication. You can find out what is in his portfolio by checking Tim's Fool profile. The Motley Fool has an ironclad disclosure policy.