What do the codes in W-2 Box 12 mean?

By Reba Donaldson · Last reviewed: April 2026 · Educational guidance, not tax advice

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.

Jump to a section

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:

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.

Want to skip to the answer? Use the free W-2 Predictor → — Box 12 doesn't matter for the prediction in most cases. Box 1 and Box 2 do.

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:

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.

Run the W-2 Predictor →

Common questions

What if my Box 12 is empty?
Common and totally fine. It just means none of the items that get reported there applied to you this year. No 401(k), no employer health insurance reported there, no stock options, etc.
What if there are multiple codes?
Normal. You can have up to four Box 12 entries (12a, 12b, 12c, 12d). If you have more than four — say, you contributed to a regular 401(k) AND a Roth 401(k) AND have an HSA AND group term life insurance AND something else — your employer will issue a second W-2 just to fit the extra codes. Same total tax; just a paperwork thing.
Code DD is huge — am I paying that?
No. Code DD is the total cost of your employer-sponsored health insurance, including the part your employer pays. Most of that big number is your employer's contribution, not yours. It's disclosed because of the Affordable Care Act, but it doesn't change your tax bill.
Is code D the same as my 401(k) deduction?
Yes — code D is exactly your pre-tax 401(k) contributions for the year. You don't get to deduct it again on your tax return; it's already been taken out of Box 1. Code D is just the bookkeeping.
I see a code my tax software doesn't ask about — should I worry?
Probably not. Most tax software only prompts for codes that affect the tax math (W, R, T, Z, A, B, etc.). The informational codes (D, DD, AA, etc.) often don't have a specific entry. If your software wants every code anyway, type them in — it'll handle it correctly.
What's the difference between code D and code AA?
Code D is for traditional (pre-tax) 401(k) contributions. Code AA is for Roth (post-tax) 401(k) contributions. The IRS tracks them separately because the money is taxed differently when you take it out at retirement.