Some debt is corrosive and should be paid off quickly. For other debt, it can actually be a winning proposition to pay it off slowly and invest the rest of your money. With student loans, it can sometimes feel daunting to determine with which liability you are dealing.

There are a few types of Federal student loans, each with different interest rates. To add to the complexity, any given student likely has a combination of subsidized and unsubsidized loans spanning four different disbursement years.

The U.S. government online documentation, “Interest Rates and Fees,” lists both current and historical interest rates for the student loans they offer. The lowest undergraduate interest rate they have recorded is 3.4% for “Direct Subsidized Loans” between 2011-2013. The highest undergraduate interest rate they have recorded is 6.8% for “Direct Unsubsidized Loans” prior to 2013.

There are two typical repayment plans that Federal Student Aid offers: standard or graduated. Both of these plans require the loan be paid back in 10 years, one payment a month for 120 payments.

However, all lenders, including the federal government, will try to convince you that you should be repaying the loan faster. Their argument goes like this:

Imagine you have $25,000 of student loans at the worst recorded undergraduate interest rate of 6.8%. If you do a standard level repayment plan, your payment every month would be $287.70 and, for the first few years, your loan would be accumulating interest of $140 every month. The amount to repay would barely go down.

At the end of 10 years, you will have paid $9,524.11 in interest over and above your $25,000 loan. This feels terrible. Money down the toilet, the lender tells you.

Instead, he would argue, imagine if you paid double. Instead of paying $287.70 each month, what if you paid $575.40? Rather than 120 payments of agony, your 51st payment would be your last. And rather than $9,524.10 of interest lost, you would only have paid $3,780.40 of interest.

The scheme sounds enticing and implies a savings of $5,743.70. For those who do not want to be investors, a fast-track repayment may be best. But for those willing to save and invest, there is a better third option.

The stock market is inherently volatile, but it does trend upward.

When you look at the return of the S&P 500 for all the time periods between January 1970 and May 2015 (a little over 45 years), 79.59% of the 534 twelve-month periods have a positive annualized return and 84.12% of the 510 three-year periods have a positive annualized return.

In fact, the percentage is higher for longer periods: 88.68% of the 486 five-year periods, 94.37% of 426 ten-year periods, and 100% of the 306 twenty-year periods and 186 30-year periods all have a positive annualized return.

This strong upward trend is the reason that the stock market has such promise for investors. However, as probability shows, positive returns are not guaranteed.

This relates back to student loans because if you are capable of double paying your loan, as your lender seems to be pushing you to do, then you are also capable of paying the minimum required by your loan and matching that payment with a contribution to your investment account.

Thus, instead of throwing $575.40 at your lender trying to pay down your loan faster, what if you paid $287.70 toward the loan and then saved $287.70 and invested it in the S&P 500?

The average annualized return for the S&P 500 over 10-year time periods between 1970-2015 is 11.27%. Using that return and the magic of compound interest, at the end of your 10-year payment period, you would have paid off your entire loan and have $62,009.35 of savings in your investment account.

Furthermore, at the start of your fifth year of payment, your loan would only have $16,970.36 left while you would have $17,305.82 in your savings account. If at this point you chose to liquidate and clear out your loan, you would have successfully paid off your loan in 48 payments, instead of the 51 payments that double paying takes.

If you did that, at that 48th payment you’d actually pay off the whole balance of your loan and be left with $335.45 in savings. This would grow along with your monthly contributions of $575.40. By the end of the 10 years your savings would only have $58,961.74, which is $3,047.61 less than not liquidating and letting the money continue to grow.

For a fair comparison of saving and investing your extra payment and the strategy of paying double, we should compare this strategy of saving and investing to finishing the loan early through double payment and then saving and investing your payment amount.

In the double-pay-then-invest model, in year five at the fifty-first payment, you finish the loan and make your first contribution to your savings account.

At this point, the invest-while-paying model has $18,082.67 saved and a loan balance of $16,392.50 but is only contributing half the amount of the double-pay-then-invest model each month ($287.70 vs. $575.40).

As the contributions accumulate, the double-pay-then-invest account grows faster and the gap slowly closes but not quickly enough. By the end of the 10th year, the double-pay-then-invest model has $56,125.30 saved, but this is $5,884.05 less than the invest-while-paying-model which has $62,009.35 at the end of the 10 years.

But remember again, the stock market is inherently volatile. There is no guarantee that average returns will be the returns you experience.

The question you need to answer given your own loan data is: when given a 10-year investment period, what is the probability that the market’s returns will be higher than your interest rate?

For our example interest rate of 6.8% (the worst recorded interest rate) and using the same data of returns from January 1970 through May 2015, 81.22% of ten-year time periods have a return greater than 6.8%. In other words, 346 of the 426 ten-year time periods had a return better than 6.8%.

These are good odds.

If you look at the best recorded interest rate (3.4%), the odds get better with 90.38% of ten-year time periods having a greater return.

The best 10-year time period was August 1990 through 2000. This time period saw a 19.49% annualized return. The 10-year time periods ending in September and October also saw similar annualized returns, both with a 19.44% annualized return.

The worst 10-year time period was Feb 1999 through 2009. This period saw a -3.43% annualized return. This is the largest loss of negative 10-year rolling returns spanning from October 2008 until 2010. The ten years ending Feb 2009 had the worst returns in large part because 2008 had an annual return of -38.63%.

Of the years that don’t make it, the average annualized return is 2.78% (vs. 11.27% return for all ten-year time periods). How do the invest-while-paying and double-pay-then-invest models compare when the return is so low?

With a 2.78% return, double paying for your student loan and then investing wins by $3,947.70 ($43,718.74 vs. $39,771.05) as the interest rate is more painful than the investments are helpful.

If you lengthen the time horizon to twenty-year periods between 1970 and 2015, then 100% of 306 twenty-year time periods have returns greater than 6.8%. This means that if you are investing for the long term (i.e. for retirement in your Roth IRA as a 22-year-old), then the odds are even more in your favor for investing while paying the minimums.

If you have graduated with student loans you are probably anxious to leave those loans behind you and get on with your life. The best way to accomplish this is to pay the minimum and start saving and investing toward your future financial security.

Photo used here under Flickr Creative Commons.