"Max out your 401(k)" is one of personal finance's most repeated pieces of advice. It is also, planners say, not always the right first step — because a dollar's best use depends on what else is happening in your finances. Here is the sequence many advisers actually recommend, and the reasoning behind it. (This is general information, not personalized advice.)

First, always grab the match

Nearly every planner agrees on the starting point: contribute at least enough to your 401(k) to capture your employer's full match. A match is, in effect, guaranteed free money — often 50 cents or a dollar for every dollar you put in, up to a limit — an immediate return no investment or debt payoff can beat. Skipping it to do anything else means leaving compensation on the table, which is why advisers treat the match as non-negotiable even while paying down debt, Fidelity notes.

Then attack high-interest debt

Once the match is secured, the math often favors debt over extra retirement contributions. Credit cards commonly charge around 20% or more, and paying off a balance at that rate is a guaranteed return equal to the interest you avoid. The stock market, by contrast, has historically returned something in the range of 7% to 10% a year over long periods — and it is not guaranteed. Beating a certain 20% loss, in other words, usually outweighs an uncertain 8% gain, so advisers generally say to clear high-rate balances before pouring more into a 401(k), as Kiplinger explains.

A common rule of thumb is to prioritize paying down debt carrying interest above roughly 6% to 8%. Below that — a low-rate car loan, say, or some mortgages — the case for investing instead grows stronger.

Build a cushion, then max out

Planners typically slot an emergency fund next: three to six months of expenses in accessible savings, so an unexpected bill does not send you back to the credit cards. Many suggest starting with a smaller buffer, around $1,000, while you knock down debt. Only after the match, the high-interest debt and the emergency fund are handled does maxing out a 401(k) or funding an IRA move to the front of the line, Charles Schwab advises.

The nuances

None of this is a rigid law. A very generous match, a stable income, or unusually low-rate debt can all shift the calculus, and a certified financial planner may sequence things differently for a given household. The one point advisers return to is balance: even while paying off debt, it is usually a mistake to stop retirement saving entirely, because years out of the market cost you compounding you can never fully recover — and, crucially, may cost you that free employer match.

The headline, then, is narrower than the slogan. Maxing out a 401(k) is a fine goal, but rarely the right first dollar if a 20% credit-card balance is sitting there. Get the match, kill the expensive debt, keep a cushion — then max away.