Both. But not equally.

The standard advice is to build a small emergency fund ($1,000 to $2,000) first, then attack debt aggressively, then build up a full 3 to 6 month emergency fund after the debt is gone. That sequence works for most people and here's why.

Without any emergency savings, one unexpected $800 car repair puts you right back on the credit card. You're running on a treadmill. The small emergency fund breaks that cycle. It's not enough to cover a job loss, but it handles the everyday surprises (car repairs, medical copays, appliance breakdowns) that derail debt payoff plans.

The math strongly favors paying off high-interest debt over saving. If your credit cards charge 24% interest and your savings account earns 4.5%, every dollar you put in savings instead of toward debt is costing you a net 19.5% per year. That's an expensive choice.

That said, if your employer matches 401k contributions, contribute enough to get the full match even while paying off debt. A 100% employer match is an instant 100% return on your money. No debt payoff strategy beats that.

Here's the practical sequence:

1. Build a $1,000 to $2,000 starter emergency fund (1 to 2 months).

2. Contribute enough to your 401k to get the full employer match.

3. Throw everything else at your highest-interest debt.

4. Once debt is cleared, build up 3 to 6 months of expenses in savings.

5. Then increase retirement contributions to 15% or more.

If your debt is relatively low interest (under 7%, like some student loans), the calculus shifts. At those rates, splitting your extra money between debt payoff and saving/investing is reasonable because the math is much closer.