Ahhhhh….you've finally made it. 4 years in college, 4 years in medical school, 3-5 more in residency, and 1-3 more in fellowship and you're finally making the big bucks. You've just started getting your first 5 figure paychecks and you feel like you have some money that you don't need to spend on this month's necessities.  You've got a couple hundred thousand dollars worth of student loans hanging over your head, a big mortgage, and even a little bit of credit card debt.  But you're also looking at a huge tax bill, and besides, you don't want to work forever, so you've been studying up on 401Ks and IRAs.  How do you decide when to pay down loans and when to invest?

It turns out it can be a pretty personal decision, and there are a lot of factors that come into play, including loan interest rates, current interest rates and inflation, expected returns on your portfolio, current tax bracket, tax-sheltered accounts available to you, attitude about debt, and personal risk profile.  But there are some general rules to follow, and some factors to think about.  I'll also give you my recommendations for common situations.

Loan Interest Rates

The higher the interest rate on your loans, the faster you should try to pay them off.  Remember to look at the after-tax rate of the loans.  For instance, if you make less than $150,000 per year, the interest on your student loans may be deductible.  If your marginal tax bracket is 25%, and your loan interest rate is 8% AND your interest is fully-deductible, then your after-tax rate is 6%.  (8%*(1-25%).  Part or all of your mortgage interest may also be deductible for you.   Credit cards and car loans are not deductible.  For many Americans, and even many physicians, their best investment, no matter their tax bracket, is paying down high-interest rate consumer debt.  If your credit card debt is accumulating interest at 22%, you should pay that down as your first priority.  That's a guaranteed 22% investment.  You won't find that anywhere, with or without a tax break.  On the other hand, many of my med school classmates were able to consolidate their loans at 1.9%.  Although Dave Ramsey recommends paying off all your debts ASAP, many wise people are willing to carry non-callable debt at very low interest rates because of the opportunity costs you would give up by paying it off.

Current Interest Rates and Inflation

If your loans are at 3%, inflation is at 4%, and your savings account is paying 5%, it is easy to see mathematically why you might not want to prioritize paying that loan down.  Let me give you an example.  In 1993 I took out a $5000 loan for undergraduate studies.  It was a great loan from my state, with fantastic terms.  It was 8% interest, but the interest didn't accumulate and I didn't have to make payments while I was in college….in medical school….in residency…..or in military service.  I paid the loan off in full in one lump-sum payment when I got out of the military in 2010, just before it started accumulating interest.  I spent 1993 dollars, and I paid it back with the same amount of 2010 dollars.  Of course, 2010 dollars were only worth 66 cents of a 1993 dollar.  In essence, I borrowed $5000, and only paid back $3300, and I got to use the money for 17 years for free. Moral of the story?  When you're borrowing money at rates below current levels of inflation or the long-term inflation rate (around 3%), you might want to think twice before rushing to pay it back.  The CPI year over year inflation rate can be found here (it's currently 3.56%).

Likewise, when you're borrowing money at rates below guaranteed safe investment rates (such as money market funds, CDs, or FDIC-insured savings accounts), you might not want to pay it back too quickly.  Remember, of course, to adjust both rates for your current tax situation.  Borrowing money at a non-deductible interest rate of 5% to invest at 6% (4% after-tax) isn't exactly a winning proposition.

Expected Returns

I mentioned earlier that paying off a loan with 22% interest is a no-brainer.  That's because the expected returns on investments available to you are nowhere near that.  Don't believe me?  Imagine a world where 22% after-inflation returns were available to investors.  You could save 25% of your income for 7 years and retire.  Do you know anyone who did that?  Me neither.  Although estimates differ depending on who you ask, most experts agree that you can expect nominal (pre-inflation) stock market returns of 5-10% over the long run and bond returns of 3-6%.  Naturally, those returns aren't guaranteed.  It's one thing to borrow money at 3% and invest it at a guaranteed 5%.  It's entirely different to borrow it at 8% and invest it in the stock market that may or may not beat that return.  An enlightening poll on the Bogleheads forum once asked at what loan interest rate an investor ought to invest instead of paying down the loan.  The mean answer was 5%, but there was quite a bit of variation, from 2% to 10%.  I think 5% is about right.  Most loans at an interest rate above that should be given a pretty high priority.

Current Tax Bracket

Two investors who both have completely deductible 8% mortgages differ in one important aspect.  The first, lives in Texas and finds himself in the 15% federal tax bracket and the 0% state bracket.  The second, in California, is in the 33% federal bracket and the 9% state bracket.  The after-tax interest rate for the first is 6.8%, but it is only 4.6% for the second.  The second might very reasonably conclude that he should invest whereas the first might decide to pay down the mortgage. That high tax bracket investor might also decide to invest instead of paying down the loan because he saves a higher percentage of his income by contributing to his 401K or other accounts.  The Texan only gets a 15% tax break for 401K contributions, but the Californian gets a 42% tax break. Conclusion: The higher your tax bracket the less anxious you should be to pay down debt over investing in a tax-sheltered account, especially tax-deductible debt.

Available Tax-Sheltered Accounts

We saw above that the tax code can really mess with the loan vs investment decision.  The plethora of tax shelters available make the decision even more complicated.  For instance, I might prefer to invest in a 401K where I get a big tax break before paying down a 6% loan, but might prefer to pay down the loan before investing in a taxable account.  A resident who expects to soon be in a high tax bracket might prefer to get more money into a Roth IRA where it will never be taxed again rather than pay down his loans.  Even college savings accounts, UGMA accounts, and health savings accounts offer some type of tax break to the investor.  The more tax breaks available to you as an investor, the more you should lean toward investing instead of paying down loans.

Attitude Toward Debt

Many of us hate debt, no matter what the interest rate.  I was listening to Dave Ramsey the other night when a caller called in asking if he should use his spare cash to pay off his mortgage.  Dave's suggestion was to pay it off, then in a few months if he really missed it he could take out another one.  Obviously, nobody does that.  There is a wonderful feeling associated with not owing anyone anything.  Owning a house free and clear of the bank and knowing it can't be foreclosed on (as long as you pay your property taxes that is) provides a great deal of security.  Not having loans also provides financial freedom in that you need less cash flow to service them, and thus can work fewer hours, take a more attractive job that happens to pay less, or retire early.  There is also the behavioral factor.  Many of us say we'll invest instead of paying down a loan, but in reality we spend the money.  Obviously, paying down a loan is more likely to help your bottom line than blowing your cash on hookers and coke.  The more you hate debt, the more you should lean toward paying off your loans, even if the interest rates are reasonably low. If you think debt is the best thing since sliced bread, I suggest you read the tale of “Market-Timer” a Bogleheads poster who managed as a grad student to lose a couple hundred thousands of dollars borrowed on credit cards and invested on margin in stock market futures.

Personal Risk Profile

Each investor differs in his need, ability, and desire to take risk.  If you are a relatively conservative investor, or close to retirement, or simply don't need to take on much risk, you should pay off loans before investing.  The less risky your portfolio, and thus the lower the expected returns on it, the less sense it makes to carry loans while investing.  For this reason I think it is stupid to carry a mortgage into retirement.  It is foolish for anyone to take on more risk than they can handle or than they need to take.  As Warren Buffett likes to say, only when the tide goes out do you see who's been swimming naked.  If you are mostly invested in CDs and treasury bonds, you're probably going to do better paying down your mortgage and student loans than adding to your portfolio, especially with today's interest rates. My Recommendations I think it is important to use moderation in all things.  You don't want to pay unnecessary interest on loans, but you also don't want to miss out on investment and loan-related tax breaks or miss out on years of portfolio compounding.

I suggest you use the following list of loan/investing priorities:

1) Pay off high interest debt.  Any credit cards or consumer debt at 8% or higher should be paid off ASAP.  Honestly you should have never accumulated this.  Live like a resident until it is gone.

2) Invest in tax-protected accounts.  If you are a resident max out your personal and spousal Roth IRAs.  If an attending, max out your 401K, SEP-IRA, HSA and any other retirement account that allows you full marginal tax rate deductions.

3) Pay off non-deductible loans between 5% and 8%.  These include most current student loans.

4) Consider investing in other accounts that offer a tax break, such as 529s (kid's college accounts), UGMAs, and backdoor Roth IRAs if your circumstances merit.

5) Invest in risky assets in a taxable account (stock mutual funds or investment properties).

6) Pay off loans with after-tax rates of 3%-5%.  These include most mortgages.

7) Pay off loans with after-tax rates below 3%.

8) Invest in safe assets in a taxable account such as CDs, bonds, and savings accounts.  If these types of assets return to historic norms (4-5% returns) instead of their current 1-2% returns, then it is okay to invest in these prior to paying off very low interest debt.

9) Don't carry any debt into retirement.  Losing the safety net of on-going employment income makes this a risky affair.  It's one thing to get foreclosed on when you're 30. It's entirely different when you're 70.

What do you think? How did you decide whether or not to pay off your student loans early? Comment below!