I have a student loan with a balance of $95,000 that has an interest rate of 2.4% over 20 years. I save at least 18% of each paycheck for retirement and only pay the minimum on my student loan balance. If I have money left over at the end of a pay period should I invest it or pay more on my student loan? -- Joe

At the core of Joe's question is a challenge a lot of us face: Where should my next dollar go? There are almost always competing priorities and it can be tricky to know which is the better bet.

Joe is in a pretty solid financial position despite being in debt. The interest rate on his student loan is pretty low and he got a great jump on saving for retirement while making minimum payments on his debt.

If he has money left over after a paycheck, he wants to know if it's better to invest it or use it to pay down his student debt faster.

The short answer is to try to do both.

"If there's money left over at the end of the month, we generally recommend a split approach," said Chuck Cumello, the president of Essex Financial.

But dealing with debt can be emotional, Cumello said. Even if the math shows that investing some of the money makes sense, some people may still want to rid themselves of the debt as soon as possible.

Everyone's situation is different. Here are five questions to ask yourself before deciding to pay down your student debt early.

1. Do I have an emergency fund?

Make sure you have some cash set aside for emergencies before you start making additional loan payments or investing.

If you find yourself facing unexpected medical bills, a car breakdown, or a leaky roof, this emergency fund will help keep you from taking on even more debt. Experts suggest keeping three to six months of expenses in cash, just in case.

Related: Should I use my savings to pay off credit card debt?

2. Do I have savings put away for retirement?

As a young person, time is on your side. Joe is already taking advantage of the power of compounding interest by setting aside 18% of his paycheck for retirement.

If you're not setting aside that much, many experts suggest saving at least 10% of your pay or enough to receive the full match from your company's 401(k) plan if it offers one.

Retirement accounts like a 401(k) or IRA are good places to start investing because of the tax advantages. But remember, you generally won't be able to access your money before you retire without paying a penalty.

3. What are the interest rates on my debt?

The 2.4% interest rate on Joe's student loan is lower than most.

"If there is such a thing as good debt, a loan with a 2.4% fixed rate would be good debt," Cumello said.

Federal student loans currently charge an interest rate somewhere between 4% and 7%. Other debt is usually more expensive. The average interest rate on credit cards, for example, is around 15%.

If you do have other debts with high interest rates, Cumello suggests paying those down first.

Related: How to survive a career change -- and a pay cut

4. What do I expect to earn on my investment?

There is no crystal ball that can tell you how the stock market will perform in the future. That's partly why making the decision to invest is a tough one.

But the move to invest could pay off if your return ends up being greater than the interest you pay on your debt.

Use an online calculator or consult a financial advisor to help you walk through some hypothetical situations. This Student Loan Hero calculator allows you to see how much money you'll save over the long term by paying your student debt off faster.

If Joe puts an additional $100 aside each month toward his student loan, he'll pay off his debt about four years faster and pay about $5,300 less in interest.

If he invests $100 a month and assumes a 6% rate of return, he'll earn about $11,000 and have a total of about $30,000 invested over the same time it takes to pay off his debt, according to this CNNMoney calculator.

Related: So, why shouldn't I buy bitcoin?

5. What are my future money goals?

Ask yourself what your next big purchases will be. Will you need money for a new car, a wedding, kids or a new home?

Generally, if the expense is coming up within the next two years, Cumello suggests keeping money for that purchase out of the stock market. But if you don't need the money until later on, it could be a good idea to invest.

If you do decide to invest, create a portfolio with stocks and bonds that matches your risk tolerance. Look for low-fee index funds or ETFs that offer exposure to a diversified mix of stocks, he said.

But if you can afford to invest and make additional student loan payments, that's what Cumello says his firm recommends more often than not.

Have a money question for Money Moves? Ask us here to be included in a future column.