W-2 Box 12 — Codes (401(k), HSA, health coverage, ISO, and more)
Up to four labeled amounts (12a–12d) using IRS codes. Common codes: D (401(k) elective deferral), DD (employer health coverage cost), W (employer + employee HSA contributions), AA (Roth 401(k)).
At a glance — Box 12
- Box name
- Codes (401(k), HSA, health coverage, ISO, and more)
- Reports to
- Varies by code. Some feed Form 8889 (HSA), others Form 3903 (moving), etc. Many are informational only.
- Check against
- Your final pay stub's YTD deduction totals for each benefit — 401(k)/403(b), HSA, FSA, group-term life over $50,000, stock option exercises — plus any employer benefits statement, since each Box 12 code maps to a different underlying payroll item.
What Box 12 means
12a, 12b, 12c, and 12d are not codes — they're the four line positions the IRS gives employers to report Box 12 entries. Each line pairs a two-letter code (D, DD, W, and so on) with a dollar amount, and the letter 'a', 'b', 'c', or 'd' just marks which of the four slots that entry happens to occupy on your particular W-2. Code DD lands on 12a for one employee and 12b for another, depending on what else the employer reports and in what order their payroll software prints it. So 'what is 12a' has no fixed answer — you always read the two-letter code sitting next to the amount, not the line letter it's printed on.
The IRS's current General Instructions for Forms W-2 and W-3 list 33 distinct Box 12 codes, up from 30 the year before. Three were added for 2026 — TA, TP, and TT — to report Trump account contributions, total cash tips, and qualified overtime compensation under the 2025 One Big Beautiful Bill Act (OBBBA). A single Form W-2 only has room to print four of them; if you have more, your employer issues a second W-2 for the overflow rather than cramming a fifth entry onto the first one.
Most codes cluster into four groups. Elective deferrals to a retirement plan sit at the top: code D (traditional 401(k)) and E (traditional 403(b)) reduce Box 1 because they're pre-tax; their Roth counterparts AA and BB do the opposite — already taxed and already counted in Box 1. Code G (governmental or nongovernmental 457(b)) also lives in this family, though it can include certain employer contributions and not only what you personally elected. HSA and health-account codes report money set aside for medical costs, led by W (HSA contributions). A taxable-benefit group flags pay that needs extra handling — group-term life insurance over $50,000, a nonstatutory stock option exercise, a deferred-comp plan that failed to comply. And a purely informational group changes nothing about your tax bill: DD (cost of employer health coverage) is the biggest one by search volume, joined for 2026 by the new tip and overtime totals, TP and TT, which feed the OBBBA no-tax-on-tips and no-tax-on-overtime deductions but don't themselves add anything to Box 1.
A few codes send you to a specific extra form: code V means you exercised a nonstatutory stock option (already in Box 1), and code T sends you to Form 8839 for adoption benefits. Code P used to be described here as military-only 'through 2025' — that is out of date. The moving-expense deduction and the reimbursement exclusion have been suspended for employees generally since 2018, and code P survives as a narrow carve-out: a member of the Armed Forces on active duty moving under a military order incident to a permanent change of station. The IRS extended the same treatment to employees and new appointees of the intelligence community for moves in 2026 or later. Outside those two groups, an employer-paid or reimbursed move is simply taxable wages and lands in Box 1, not in code P.
Tax return implications
- Box 12 isn't one number that flows to one line — each code routes differently: pre-tax deferrals are already subtracted from Box 1, Roth deferrals and taxable benefits are already included in it, and informational codes like DD, Q, and II require no action on your return at all.
- Codes D, E, F, H, and S (traditional elective deferrals) plus AA, BB, and EE (Roth) can feed the Retirement Savings Contributions Credit on Form 8880 when your AGI is under the phaseout for your filing status. Governmental 457(b) deferrals under code G count too — nongovernmental 457(b) deferrals reported under that same code don't, since they're a non-qualified plan.
- Code W (HSA) requires Form 8889 to reconcile against your contribution limit; skipping it is a common reason HSA distributions don't get classified correctly.
- Code C (group-term life insurance over $50,000) and code V (stock option exercise) are already taxed and already in Box 1 — you don't add them again, but an unusually large amount is worth understanding before you file.
- If you are not Armed Forces on a permanent change of station — or, for a move in 2026 or later, intelligence community personnel — an employer-paid or reimbursed move is taxable wages in Box 1 rather than a code P amount.
Common pitfalls & things to check
- 12a, 12b, 12c, and 12d are positions, not codes — if a tax form or software field asks for '12a', it wants whichever code-and-amount pair happens to print on your first Box 12 line, not a specific benefit type.
- Box d (control number), printed near the top of the W-2 above the employee's SSN, is unrelated to Box 12 code D. The control number is an optional internal identifier a payroll system may assign to a specific W-2; it carries no code letter and has no tax meaning.
- More than four Box 12 items means a second W-2 exists somewhere — check for it before you file, or you'll under-report a benefit that needs its own form (HSA, adoption, stock options).
- Codes AA, BB, and EE (Roth) look similar to D, E, and G (traditional) but have opposite tax treatment — mixing them up when estimating a refund is a common error.
- New codes get added periodically (TA, TP, and TT arrived for 2026) and the full list changes almost every year — if a code on your W-2 doesn't look familiar, check the current General Instructions for Forms W-2 and W-3 rather than assuming it's a mistake.
FAQ
What is Box 12a on a W-2?
'12a' isn't a code by itself — it's just the first of four lines the IRS gives employers for Box 12 entries. Read the two-letter code printed next to the dollar amount on that line (D, DD, W, and so on); that code, not the letter 'a', tells you what the amount is.
Is 12a always the same code, like D or DD?
No. Employers list Box 12 entries in whatever order their payroll software outputs them, so code DD might land on 12a on one employee's W-2 and 12b on another's. Match by the two-letter code next to the amount, never by which line it's printed on.
What is code W in box 12?
Code W reports HSA contributions for the year — your pre-tax payroll amount plus anything your employer added — combined into one figure. It feeds Form 8889, where you reconcile it against your HSA contribution limit.
What is the difference between codes AA and DD on a W-2?
Code AA is your Roth 401(k) contributions — already taxed, already included in Box 1. Code DD is the total cost of your employer-sponsored health coverage — informational only, not taxable, and not related to AA at all.
Related W-2 boxes
Box 12 Code D — Elective deferrals to a 401(k) plan
Your traditional (pre-tax) 401(k) elective deferrals. Reduces Box 1 dollar-for-dollar, up to the annual §402(g) elective deferral limit (higher with age-50 catch-up and SECURE 2.0 ages-60–63 super-catch-up).
Box 12 Code DD — Cost of employer-sponsored health coverage
The total cost (employer + employee share) of your employer-sponsored group health coverage. Informational only — does not affect your tax.
Box 12 Code E — Elective deferrals to a 403(b) plan
Your traditional (pre-tax) 403(b) elective deferrals. Reduces Box 1 up to the annual §402(g) limit, with a special 15-year catch-up for long-tenured employees of certain nonprofits.
Box 12 Code W — Employer and employee HSA contributions
Total Health Savings Account contributions — both employer and employee (via pre-tax payroll). Capped at the §223 annual HSA limit for your HDHP coverage tier, plus the $1,000 age-55+ catch-up under §223(b)(3)(B)(ii).
Reconciling your W-2 at tax time? Use the paycheck calculator to verify expected federal, Social Security, and Medicare withholdings on your salary, and the federal income tax calculator to estimate your refund or balance owing before you file.
Related Calculators
Paycheck Calculator
Federal, state, FICA withholding, net take-home, W-4 alignment
Federal Income Tax Calculator
10–37% brackets, $15,750 standard deduction, progressive calculation
W-4 Withholding Calculator
Form W-4 steps, correct federal withholding, avoid penalties
FICA & Social Security
6.2% SS to $176,100, 1.45% Medicare, 0.9% additional Medicare
Tax Refund Estimator
Estimate federal refund, withholding vs liability, adjustments
401(k) Calculator
Contribution limits, employer match, tax-deferred growth
Sources
W-2 box definitions per IRS General Instructions for Forms W-2 and W-3 and IRC §6051. Rates and thresholds current for tax year 2025 (file by April 15, 2026); 2026 figures included where published.