W-2 Box 12 Codes Explained: What Every Payroll Pro Needs to Know

Box 12 is the most coded area of the Form W-2 — and the one where employees ask the most questions. Each entry pairs a one- or two-letter code with a dollar amount, and every code tells a different story about wages, benefits, and tax treatment. Get one wrong and you’re looking at a corrected W-2 (Form W-2c), an IRS notice, or worse: an employee whose 401(k) reconciliation doesn’t match their tax return.

This page covers the Box 12 codes payroll pros encounter most often, what each one actually means, and how each one interacts with Boxes 1, 3, and 5.

Why Box 12 exists

Boxes 1 through 11 capture the headline numbers: wages, withholding, Social Security, Medicare, and state items. Box 12 captures everything else the IRS wants employees (and their preparers) to see — mostly pre-tax deferrals, employer-provided benefits that affect tax reporting, and special items from the tax code. The codes aren’t interchangeable. Using Code D when the right answer is Code DD, for example, tells the IRS the employee made a $24,500 401(k) deferral when what actually happened was the employer paid $24,500 toward their health insurance.

The Box 12 codes you’ll use most often

The following codes cover the vast majority of Box 12 entries a typical payroll operation will generate. This list is not exhaustive — the full IRS list runs to more than 25 codes — but these are the ones that show up every year.

Retirement-plan codes

Code What it reports Affects Box 1? Affects Boxes 3 & 5?
D Traditional 401(k) elective deferrals (pre-tax) Yes — reduces Box 1 No — Boxes 3 & 5 include the deferral
E Traditional 403(b) elective deferrals Yes — reduces Box 1 No
G 457(b) governmental plan deferrals Yes — reduces Box 1 No
S SIMPLE IRA employee salary reduction Yes — reduces Box 1 No
AA Roth 401(k) contributions (after-tax) No — Box 1 already taxed No
BB Roth 403(b) contributions No No
EE Roth 457(b) contributions No No

The pattern is worth memorizing: pre-tax retirement deferrals reduce federal income wages only. They still hit Social Security and Medicare wages in full. Roth contributions are already after-tax money, so they don’t reduce any wage box — the amount is reported in Box 12 purely for informational and IRS cross-check purposes.

Health and fringe-benefit codes

Code What it reports Affects Box 1? Affects Boxes 3 & 5?
DD Cost of employer-sponsored health coverage No (informational only) No
W Employer HSA contributions (through a cafeteria plan) No — already excluded No — already excluded
C Cost of group-term life insurance over $50,000 Yes — this amount is IN Box 1 Yes — also in Boxes 3 & 5
P Excludable moving expense reimbursements Only military; otherwise taxable Only military

Code DD is where the most confusion happens. It’s informational. It does not affect taxable wages, it does not reduce any Box 1–5 amount, and the employee cannot deduct it. It exists solely because the ACA requires reporting the value of employer health coverage. Employees regularly think this is an amount they paid in or an amount they should subtract on their Form 1040. It is neither.

Codes for special compensation

Code What it reports
M Employee Social Security/RRTA tax on cost of group-term life insurance over $50,000 — for former employees
N Employee Medicare tax on the same GTL excess — former employees
Y Deferrals under a 409A nonqualified deferred compensation plan
Z Income included in gross wages under a 409A plan

Codes Y and Z typically appear only when the company offers an NQDC arrangement and the plan either had normal deferrals (Y) or had a compliance failure that triggered 409A income inclusion (Z). If you see a Z, call the plan administrator — it usually reflects a design or operational problem that needs remediation.

Common mistakes — and how to catch them before the W-2 is issued

  1. Confusing Code D (401(k)) with Code DD (health coverage). The codes look similar, but one is an employee deferral and the other is an employer cost. A useful mental check: if the amount appears in Box 1, it cannot be in Code D. If the amount does not appear anywhere else on the W-2, Code DD is a safe bet.
  2. Reporting SIMPLE IRA contributions as Code D. SIMPLE IRA goes in Code S. The FICA treatment is the same, but the code has to match the plan type or the employee’s contribution-limit reporting will be wrong.
  3. Adding Code DD to Box 1. Code DD is informational. Adding it to taxable wages overstates the employee’s income. Do not do this.
  4. Missing Code W when the employer funds an HSA through a cafeteria plan. The amount should be excluded from Boxes 1, 3, and 5 (Section 125 treatment) and reported in Code W. Missing the code is a reconciliation headache at year-end.
  5. Using Code P for non-military moving expense reimbursements. Post-TCJA, the moving expense exclusion survives only for active-duty military moves. All other moving expense reimbursements are fully taxable and belong in Box 1, not Code P.

Frequently asked questions

Do Box 12 codes change taxable wages?
Some do, some don’t. Codes D, E, G, and S reduce Box 1 only (not Boxes 3/5). Code C adds to all three wage boxes. Code DD is purely informational and changes nothing. Roth codes (AA, BB, EE) are informational on Roth contributions that are already fully taxed.

What’s the difference between Box 12 Code D and Code DD?
Code D is a traditional 401(k) employee elective deferral (pre-tax). Code DD is the cost of employer-sponsored health coverage. They sound similar but report entirely different things.

Do employer HSA contributions appear in Box 12?
Yes — Code W — when contributed through a Section 125 cafeteria plan. The amount is already excluded from Boxes 1, 3, and 5, and Code W is the required informational reporting.

Is Code DD taxable to the employee?
No. Code DD reports the cost of employer-sponsored health coverage for ACA transparency purposes only. It does not affect the employee’s tax liability in any way.

What gets reported in Code C?
The imputed income for employer-paid group-term life insurance coverage over $50,000, calculated using the IRS Table I monthly rates. This amount IS included in Boxes 1, 3, and 5 — Code C just flags it for the employee.

Can one W-2 have multiple Box 12 entries?
Yes. The form has four Box 12 sub-lines (12a through 12d) for this reason. If an employee has 401(k) deferrals, employer health coverage, and GTL over $50K, that’s three entries — D, DD, and C.

Keep learning

Practice with PrepToPay

Box 12 codes appear on both the FPC and CPP exams — in multi-step Form W-2 reconciliation questions and in stand-alone definition questions. PrepToPay’s question bank includes dozens of Box 12 scenarios with full explanations. Start your 14-day free trial on FPC or CPP. A valid payment method is required at signup; you will not be charged during the trial. Reference is $9.99/month with no trial.


PrepToPay is an independent exam preparation service not affiliated with, endorsed by, or sponsored by PayrollOrg (American Payroll Association). FPC® and CPP® are registered trademarks of PayrollOrg. Use of these marks is for descriptive purposes only. Study questions are written for exam preparation purposes based on publicly available KSA frameworks and do not guarantee exam success or reflect official exam content.