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
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 Optimizer
Form W-4 allowances, 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.