US Tax Tools

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 year-end pay stub YTD totals for 401(k), HSA, FSA, etc., plus any employer-provided benefit statements.

What Box 12 means

Box 12 on the W-2 is a catch-all for specific payments and benefits identified by a two-letter IRS code. Each entry appears with its code letter(s) and a dollar amount (12a, 12b, 12c, 12d). The IRS has roughly 30 codes in use today — a W-2 can have up to four, and employers issue a second W-2 if needed.

The most commonly seen codes are D (traditional 401(k) deferrals — reduces Box 1), DD (cost of employer-sponsored health coverage — informational only, not taxable), W (HSA contributions by employer plus employee pre-tax — feeds Form 8889), and AA (Roth 401(k) — already included in Box 1, taxed now, tax-free at retirement).

Some codes trigger specific tax-return actions: code V requires reporting nonqualified stock option exercise, code T requires Form 8839 for adoption assistance, and code P (excludable moving expenses) is only available to active military in 2018–2025.

Tax return implications

  • Check each Box 12 code against its impact — many are pre-tax adjustments already baked into Box 1, others (like V, T, J) require additional forms.
  • Code DD is purely informational — the cost of your employer-sponsored health coverage does not affect your tax liability.
  • Codes D, E, F, G, H, S, AA, BB, EE feed the Saver's Credit calculation on Form 8880 (phased out at higher AGIs).

Common pitfalls & things to check

  • A single W-2 can only show 4 Box 12 entries. If you have more, your employer issues a second W-2 with additional Box 12 entries — don't miss it when filing.
  • Code DD totals often include both your and your employer's share — don't mistake it for something you can deduct.
  • Code W (HSA) requires Form 8889; skipping it is a common error that prevents HSA distributions from being classified as qualified on the 1099-SA.

FAQ

What do the letters in Box 12 mean?

Each pair of letters is an IRS code identifying a specific type of compensation or benefit — e.g. D = 401(k), DD = employer health cost, W = HSA, AA = Roth 401(k). See the full list in the IRS General Instructions for Forms W-2 and W-3.

Is Box 12 taxable?

Depends on the code. Pre-tax items like D, E, G, W reduce Box 1 and aren't taxed now. After-tax items like AA, BB, EE are already in Box 1. Purely informational items like DD have no effect on your tax.

Related W-2 boxes

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.

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.

Last updated May 14, 2026 Tax year 2025-26

Data sources: IRS (irs.gov), Social Security Administration

This tool is general information only, not financial advice.

Reviewed by USTax Tools Editorial Desk

Read our methodology →