What do the codes in W-2 Box 12 mean?
Box 12 is the most confusing part of a W-2. Here's every code, in plain English.
Box 12 has letters next to numbers. Each letter is a code that tells the IRS what kind of money the number is — a 401(k) contribution, the cost of your health insurance, a stock option you exercised, and so on. Most don't change your taxes. They're just for the IRS's records. Some do. Here's the difference, code by code.
How Box 12 actually works
On your W-2, Box 12 is split into four small spots labeled 12a, 12b, 12c, and 12d. Each spot holds two things — a letter code on the left, a dollar amount on the right.
So you might see something like this:
- 12a — Code D · $5,000
- 12b — Code DD · $12,400
- 12c — (blank)
- 12d — (blank)
That'd mean you put $5,000 into your 401(k) (code D) and your employer paid $12,400 toward your health insurance (code DD). Neither one changes your tax bill — they're informational. We'll explain why below.
Codes you'll see most often
Code D — 401(k) contributions
The amount you put into a regular (pre-tax) 401(k) this year. This money is already taken out of your Box 1 wages, so it doesn't reduce your taxes a second time. Code D is just so the IRS knows what you contributed.
Why it matters: it counts toward your yearly 401(k) limit ($23,500 in 2025; the 2026 number is similar). If you switched jobs and contributed at both, add up the D amounts on both W-2s to make sure you didn't go over.
Code DD — Health insurance cost
Total cost of your employer-sponsored health insurance — both the part you paid and the part your employer paid. This is often a big number ($10,000 to $25,000 is normal for family coverage).
It does not mean you owe tax on it. Code DD is purely a disclosure required by the Affordable Care Act. It's so you and the IRS can see what your health insurance actually costs. Your taxes don't change because of it.
Code AA — Roth 401(k) contributions
Same as code D, but for the Roth (post-tax) version of a 401(k). The money was already taxed before it went in, so Box 1 already includes it. Code AA is just for the record.
Code W — HSA contributions
What you and your employer put into your Health Savings Account this year, combined. This is already excluded from Box 1, so it doesn't reduce your taxes again — but it does affect Form 8889 if you also made HSA contributions outside of payroll. Most HSA contributors will reference this number when filing.
Code C — Group term life insurance over $50,000
If your employer pays for life insurance worth more than $50,000, the cost of the coverage above $50,000 is taxable. Code C shows that taxable amount. It's already in Box 1 — code C is just labeling it.
Code E — 403(b) contributions
Same as code D, but for 403(b) plans. These are common for teachers, hospital workers, and people who work for nonprofits.
Code G — 457(b) contributions
Same idea, for 457(b) plans. These are common for state and local government workers.
Less common codes you might still see
One or two sentences each. Most of these are rare — if you don't see them, that's normal.
- Code A — Uncollected Social Security tax on tips. Means your tip income wasn't enough to cover the Social Security tax on it. You'll owe the difference at tax time.
- Code B — Uncollected Medicare tax on tips. Same idea, but for Medicare.
- Code F — Salary reduction for a SEP IRA. Rare; for self-employed people with employees.
- Code H — Contributions to a 501(c)(18)(D) plan. Very rare.
- Code J — Sick pay that wasn't subject to Social Security tax. Usually third-party paid (like through an insurance company).
- Code K — A 20% excise tax on excess "golden parachute" payments. If you see this, you already know what it is.
- Code L — Reimbursed business expenses. The amount was already excluded from Box 1; code L is the record.
- Code M — Uncollected Social Security tax on group-term life insurance over $50,000 (former employees).
- Code N — Uncollected Medicare tax on the same. Same situation as M.
- Code P — Excludable moving expense reimbursements for active-duty military. Civilians don't get this anymore.
- Code Q — Nontaxable combat pay (military). Worth knowing about because some tax credits let you choose whether to count combat pay as income for the credit.
- Code R — Employer contributions to an Archer MSA. Affects the MSA deduction on Form 8853.
- Code S — Salary reduction for a SIMPLE IRA. Already excluded from Box 1.
- Code T — Adoption benefits. May be partially or fully tax-free; you'll work that out on Form 8839.
- Code V — Income from non-statutory stock options you exercised. Already in Box 1; code V is the record.
- Code Y — Deferrals under section 409A (deferred compensation plan). Informational.
- Code Z — Income from a 409A plan that didn't meet the rules. This adds tax — see the IRS instructions if you see it.
- Code BB — Roth 403(b) contributions. Like AA, but for 403(b).
- Code EE — Roth 457(b) contributions. Like AA, but for 457(b).
- Code FF — Permitted benefits under a QSEHRA (small-employer health reimbursement).
- Code GG — Income from qualified equity grants under section 83(i).
- Code HH — Total deferrals under section 83(i) elections.
Which Box 12 codes affect my taxes?
For most people, none of them. Your taxes are calculated from Box 1 (your taxable wages) and Box 2 (what was withheld). The Box 12 codes are mostly there so the IRS can see how the numbers in Box 1 came out the way they did.
The exceptions:
- Code W — your HSA contributions. If you also contributed to an HSA outside of payroll, you'll need this number for Form 8889. Doesn't usually change your tax much, but it's part of the calculation.
- Code R — Archer MSA contributions. Same idea, but for MSA contributions. Goes on Form 8853.
- Code T — adoption benefits. The taxable portion gets calculated on Form 8839.
- Code Z — 409A income that didn't meet the rules. This adds a 20% extra tax. Rare, but when you see it, talk to a tax pro.
- Code A or B — uncollected Social Security or Medicare tax on tips. You'll owe the uncollected amount when you file.
If none of those apply to you, your Box 12 codes are informational. You'll type them into your tax software to be safe — most tax programs ask for everything in Box 12 — but the math under the hood treats them as background information.
Want to know if you're getting a refund?
The W-2 Predictor uses your Box 1 and Box 2 (plus a few quick follow-ups about filing status and dependents) to tell you whether you'll get a refund or owe. Two minutes, no account.