It depends on what that debt is costing you, what cushion you've got, and how you'd handle a bad stretch. Expensive debt is a known cost going out the door; investing is an unknown. Most people do better clearing the expensive stuff and keeping a cushion before they start reaching.
A Known Cost Versus an Unknown Outcome
Paying off a debt removes a cost you can be certain about. Investing offers a result nobody can promise you. Those two aren't the same kind of thing, which is why comparing them with one number misses the point.
We're not going to print a crossover figure here, because the honest answer moves with your situation and nobody should make this call off a web page.
Cushion Comes Before Either
If you have no cushion, both paths are fragile. Throw everything at debt with nothing set aside and the next emergency goes straight back onto the card you just cleared.
A small cushion first, then attack, is slower on paper and far more durable in practice.
Do Not Skip Free Money or Your Own Nerves
If an employer puts money alongside yours in a retirement plan, passing that up to pay debt faster is usually worth a second look.
And be honest about temperament. Some people sleep better with no debt and should probably just have no debt.
This is exactly the kind of question worth working through with your CPA and a licensed professional who can see your whole picture.
Want a Straight Answer for Your Own Situation?
Thirty minutes, no pitch, no obligation — just a plain look at where you stand.