Home/Learn
Retirement

How a 401(k) actually works

By Luigi PooleUpdated

A 401(k) is a payroll-deduction account your employer sponsors. You defer a share of each paycheck, the employer may match part of it, the money grows untaxed inside the plan, and how it is taxed on the way out depends on which of the two contribution types you used.

A 401(k) is a container, not an investment. It is an employer-sponsored account that takes money out of your paycheck before it reaches your bank, holds whatever you buy from a fund menu the employer picked, and shelters the growth from tax until the rules let the money out. Nearly everything people find confusing sits in that last clause: the rules on the way in are simple, and the rules on the way out are where the balance is quietly made or lost.

Five things decide how a plan turns out — the deferral, the match and its vesting schedule, the choice between traditional and Roth dollars, the fees, and what happens the day you leave the job. Fund selection, which absorbs most of the attention, matters less than any of them for the first decade.

The deferral: how money gets in

Your contribution is called an elective deferral, and it is set as a percentage of pay rather than a dollar amount, deducted every pay period before the money is ever yours to spend. That mechanical detail is the plan's real advantage over an account you fund manually: nobody has to decide to save on payday, because the decision was made once, months earlier.

Most plans now enroll new hires automatically at a low default rate and escalate that rate by a point each year until it hits a ceiling. The default is a starting point set by the plan, not a recommendation about your finances, and it is almost always lower than what a retirement plan needs — raising it is a two-minute change and the single highest-value action available inside a 401(k).

Deferring and investing are two separate decisions, and plans do not always make that obvious. The money leaves your paycheck on one screen and buys funds according to an allocation set on another; if the second screen was never touched, older plans could leave contributions parked in a capital-preservation fund earning almost nothing. Automatic enrollment now usually defaults the allocation to a target-date fund, which is a defensible place to sit indefinitely — but confirm which of the two your plan did, because a decade of diligent deferrals into a stable-value fund is the most disappointing possible version of doing everything right.

The match, and the schedule that decides whether you keep it

An employer match is stated as a formula, not a number. The most common shape is a partial match on a capped share of pay — 50% of the first 6% of salary, say. On a $70,000 salary that means deferring $4,200 to collect $2,100. Defer 3% instead and you contribute $2,100, collect $1,050, and leave $1,050 on the table that year. There is no market view or tax argument that beats an instant 50% return, which is why capturing the full match sits above everything else in the ordering.

Collecting a match is not the same as keeping it. Vesting decides when employer money legally becomes yours. Your own deferrals vest immediately and always; the match may not. A cliff schedule vests nothing until a service date and then everything at once. A graded schedule vests in annual slices — a common six-year version looks like this, applied to an $8,000 match balance:

Years of serviceVested share of matchMatch you keep if you leave
10%$0
220%$1,600
340%$3,200
460%$4,800
580%$6,400
6100%$8,000

The practical consequence shows up when you are weighing a job offer. Leaving two months before a cliff date forfeits the entire employer balance; leaving two months after it forfeits none. That is real, negotiable money — worth naming in a signing conversation rather than discovering in a final statement.

Traditional and Roth live in the same plan

A 401(k) offers up to two flavors of deferral, and the choice is per contribution rather than permanent. A traditional deferral comes out of pay before income tax, lowers this year's taxable income, and is taxed as ordinary income when withdrawn. A Roth deferral comes out of pay after tax, changes nothing about this year's return, and comes out untaxed later provided the account has been open long enough and you are past the qualifying age.

If your marginal rate is identical in both years, the two produce the same after-tax result — the arithmetic is symmetric, and every apparent advantage of one cancels against the other. What breaks the tie is the difference between your rate now and your rate at withdrawal, which is the whole of the analysis in how to choose between Roth and traditional and what the Roth versus traditional calculator models against your own numbers.

Two wrinkles are specific to the workplace plan. The employer match has traditionally landed in the pre-tax bucket regardless of which flavor you chose, so a Roth saver often ends up with a mixed balance by default; some plans now allow a Roth-designated match, which is taxable income to you in the year it is made. Separately, a minority of plans accept after-tax contributions that are neither traditional nor Roth, which opens a route covered in the mega backdoor Roth — powerful where available, and unavailable in most plans.

Fees, and the menu you did not choose

You do not shop for a 401(k) provider. Your employer does, and you inherit the result: a recordkeeping and administration fee, sometimes charged per participant and sometimes as a percentage of assets, plus the expense ratio of every fund you hold. Both come out of returns silently. Nothing appears on a statement as a charge — the balance is simply smaller than it would have been.

Over a career the gap is not a rounding error. Contribute $10,000 a year for 30 years into investments earning 7% before costs:

Total annual costNet returnBalance after 30 years
0.15% (index fund, lean plan fee)6.85%about $919,500
0.90% (managed fund, typical plan fee)6.10%about $804,600
Same contributions, same gross return — the cost of plan fees
0.15% a year: about $919,5000.15% a yearabout $919,5000.90% a year: about $804,6000.90% a yearabout $804,600
Same contributions, same gross return — the cost of plan fees
Same contributions, same gross return — the cost of plan fees
0.15% a yearabout $919,500
0.90% a yearabout $804,600

$10,000 contributed at the end of each year for 30 years, 7% gross annual return, fees deducted from the return.

The difference is roughly $115,000 — more than eleven years of contributions, surrendered to a decision that takes ten minutes. Most menus include a broad index fund with an expense ratio near the bottom of the range and a target-date series priced somewhat above it; a target-date fund buys you automatic rebalancing and a glide path, which is worth something, but check what the convenience costs before assuming it is free. If the entire menu is expensive, that is a genuine argument for contributing to the match and directing further savings elsewhere.

Two details are worth checking on the annual fee disclosure the plan is required to send you. The first is whether the same fund appears in more than one share class — institutional and retail versions of an identical portfolio can differ by a quarter of a percent for no difference in what you own, and plans do not always default participants into the cheaper one. The second is revenue sharing, where a fund rebates part of its expense ratio to cover the plan's administrative costs; it makes an expensive fund look like it is subsidizing everyone, when the participants holding it are simply paying the plan's overhead through a less visible channel.

Run your numbers401(k) calculator

Changing jobs: four doors, one of them a trap

The day you leave, your balance stops receiving contributions and you gain four options.

Leaving it in the old plan is the default and is often fine, particularly if the plan is large and cheap; large employers negotiate institutional pricing that a retail account cannot match. Rolling it into the new employer's plan keeps everything in one place and preserves the rule that lets you borrow, but it inherits whatever the new menu costs. Rolling it into an IRA opens the whole investable universe and usually the lowest fees available, at the cost of losing plan-level protections and complicating a future backdoor Roth conversion. Cashing it out is the fourth door, and it is the expensive one.

Cashing out a traditional balance triggers ordinary income tax on the whole amount plus a 10% early-distribution penalty if you are under the qualifying age. The plan withholds 20% for federal tax before it sends the check, which is a prepayment rather than a settlement — the rest comes due at filing, along with any state income tax. Here is a $30,000 balance at age 35, in a 22% federal bracket:

LineCash outRoll over
Balance at job change$30,000$30,000
Federal income tax at 22%−$6,600$0 (deferred)
Early-distribution penalty at 10%−$3,000$0
Left in hand$20,400$0
Still invested$0$30,000
Value at 65, 7% a year for 30 yearsabout $228,400

The plan withholds $6,000 up front; the remaining $3,600 of tax and penalty arrives with the return, which is where the surprise usually lands. Even if the $20,400 were invested rather than spent — and it rarely is, because people cash out to spend — it grows to roughly $155,300 against the rolled-over $228,400.

Small balances have their own hazard: below a statutory threshold a plan can force you out without your consent, either mailing a check or rolling the money into an IRA of its choosing, often into cash. A forgotten small balance sitting in a money market fund for a decade is a common and entirely avoidable loss.

The other reason to deal with an old plan promptly is that plans move. Employers change providers, merge, and get acquired, and each of those events can relocate your balance to an administrator you have no relationship with and no login for. Nothing is lost permanently — abandoned accounts are traceable — but tracing one takes weeks of paperwork that a rollover in your final month of employment would have made unnecessary. Consolidating also makes the balance visible enough to include in a plan, which matters more than it sounds: money spread across four former employers is money nobody is managing an allocation for.

Loans and early withdrawals

Most plans let you borrow up to half your vested balance, subject to a statutory dollar cap, repaid through payroll over five years — longer if the loan buys a primary residence. The interest goes to your own account rather than a lender, which makes it look free. It is not: the borrowed money is out of the market while you repay, you repay with after-tax dollars that will be taxed again on withdrawal, and if you leave the employer the outstanding balance typically comes due by the following tax-filing deadline or converts to a taxable distribution with a penalty. A loan is better than a payday lender and worse than almost anything else.

Withdrawals before age 59½ face income tax plus a 10% penalty, with a narrow set of exceptions — disability, certain medical expenses, a qualified domestic relations order in a divorce, substantially equal periodic payments, and the rule that lets you draw penalty-free from the plan of the employer you left in or after the year you turn 55. Hardship withdrawals waive nothing about the tax; they only unlock access. At the other end of life, the plan stops being optional in the other direction — required minimum distributions begin at the age set in the tax code, covered in required minimum distributions.

The order that actually matters

Defer at least enough to collect the entire match, before anything else. Clear debt carrying a rate above what you expect a portfolio to return. Then raise the deferral rate with every raise, so the increase never passes through your checking account and becomes a habit. Choose the cheapest broad fund or the target-date fund closest to your horizon, and stop looking at it. On the way out of any job, roll the balance somewhere — the door you pick between the three good ones matters far less than not walking through the fourth.

What all of that adds up to is a projection worth checking rather than assuming: the 401(k) calculator turns a deferral rate and a match formula into a balance, and the retirement planner tests whether that balance actually funds the years it needs to.

Common follow-ups

What does vesting actually mean?

+

Vesting is the point at which employer money legally becomes yours. Your own deferrals are fully vested from the first paycheck and can never be taken back. The match may follow a cliff schedule, where nothing vests until a set service date and then all of it does at once, or a graded schedule that vests in slices each year.

Should I contribute to a traditional or a Roth 401(k)?

+

Compare your marginal tax rate now against the rate you expect when you withdraw. A higher rate today favors the traditional deferral; a higher or genuinely unknown rate later favors Roth. Splitting contributions between the two hedges an estimate that spans decades rather than betting the whole balance on it.

Is a 401(k) loan a bad idea?

+

It is cheaper than most credit and riskier than it looks. You repay yourself with interest, but the borrowed money stops compounding while it is out, and leaving the job usually accelerates the balance to a tax-filing deadline. Miss that deadline and the outstanding amount becomes a taxable distribution with a penalty attached.

What should I do with an old 401(k)?

+

There are four options — leave it in the old plan, roll it into the new employer's plan, roll it into an IRA, or cash it out. The first three preserve the tax shelter and only the last destroys it. Choose among the first three on fees and fund quality.

When can I take money out without a penalty?

+

Generally from age 59½. Two exceptions come up often — separating from service in or after the year you turn 55 allows penalty-free withdrawals from that employer's plan, and a short list of hardship and medical exceptions applies earlier. Income tax still applies to every traditional dollar regardless.

Does the employer match count toward my own contribution limit?

+

No. Employee deferrals and employer contributions sit under separate caps, so a match never crowds out your own contributions. There is a combined ceiling on everything that lands in the account in one year, but almost nobody reaches it through salary deferrals and a match alone.

Keep reading

Run your own numbers

All guides

Stop estimating

Connect your accounts and Hunch answers these questions with your real numbers, not a worked example.

Get started for free