Economy Talk

Pay off student loans early or invest? I keep going back and forth

I'm 26, work IT support, and I have student loans at a fixed rate around 5%. I've got a little extra each month now that I finally got a raise.

Half the internet says kill the debt first, it's a guaranteed return. The other half says invest, the market beats 5% over time. Which one is right? Is there a rule of thumb? Does it change if I don't have an emergency fund yet (I don't, really)?

Also, does anyone else feel weird investing while still in debt? Like it's not allowed?