Cash Flow & SurvivalJune 25, 2026·7 min read

W-2 Box 12 Codes Explained: What Every Code Means for Your Taxes

G
Written by Gary Sing·Reviewed for accuracy June 25, 2026

W-2 Box 12 reports specific types of compensation and benefits using letter codes. Code D is your 401(k) contribution; Code W is employer HSA contributions; Code AA is Roth 401(k). Here is what every common code means and whether it affects your taxable income.

⚙️

Want to run your own numbers? Open the interactive Debt Payoff Planner.

W-2 Box 12 codes are letter codes that report specific types of compensation and benefits to the IRS. Code D is your traditional 401(k) contribution; Code AA is your Roth 401(k) contribution; Code W is employer HSA contributions; Code DD is the cost of employer-sponsored health coverage. Most Box 12 amounts reduce your taxable income — a few rare codes increase it.

W-2 box 12 codes explained

  1. Find Box 12 on your W-2 — it has four rows labelled 12a through 12d, each with a letter code and a dollar amount.
  2. Match each code to its meaning — use the table below for the most common codes.
  3. Verify the amounts — Code D should match your 401(k) contribution records; Code W should match your HSA employer match.
  4. Enter in tax software — every code and amount must be entered when you file; most tax software prompts you for each one separately.
  5. Request a W-2C if wrong — if any amount is incorrect, contact your employer's payroll department to issue a corrected W-2C before you file.
W-2 Box 12 most common codes and their tax effectTable showing 8 common W-2 Box 12 codes: D, AA, W, DD, E, C, P, and V with their description and whether they reduce, add to, or have no effect on taxable income.W-2 Box 12 — most common codes at a glanceCodeDescriptionTax effectDTraditional 401(k)Reduces W-2 Box 1AARoth 401(k)No tax reductionWEmployer HSA contributionExcluded from incomeDDEmployer health plan costInfo only — no impactE403(b) contributionReduces W-2 Box 1CGroup-term life (>$50k)Adds to taxable incomePMoving expenses (military)Excluded from incomeVNon-qual stock optionsAdds to taxable incomeGreen = reduces federal taxable income · Red = increases taxable income · Grey = informational only
Code D is the most common — verify it matches your 401(k) contribution records

Complete reference: common W-2 Box 12 codes

CodeDescription2025 limitReduces taxable income?
DTraditional 401(k) elective deferrals$23,500 ($31,000 age 50+)Yes — excluded from Box 1 wages
AARoth 401(k) elective deferrals$23,500 (combined with D)No — already taxed; withdrawals tax-free
E403(b) elective deferrals$23,500Yes
BBRoth 403(b) deferrals$23,500 (combined with E)No
G457(b) government plan deferrals$23,500Yes
WEmployer + employee HSA contributions$4,300 single / $8,550 familyYes — excluded from Box 1, 3, and 5
DDCost of employer-sponsored health coverageInformational onlyNo — informational only, not reportable income
CTaxable cost of group-term life insurance over $50,000N/ANo — increases taxable wages
JNon-taxable sick payN/AExcluded from Box 1
LSubstantiated employee business expense reimbursementsN/AExcluded — not income
PMoving expense reimbursements (military only after 2017)N/AExcluded for military members
VIncome from exercise of non-statutory stock optionsN/ANo — already included in Box 1; informational
ZIncome under a Section 409A non-qualified deferred compensation planN/ANo — adds to Box 1 if plan is non-compliant

The three most important codes to verify every year

Code D — Traditional 401(k) contributions

Code D should match the total you contributed to your traditional 401(k) during the year. Cross-reference it against your final December statement from your plan provider. Errors here are rare but do happen, particularly after a mid-year employer change or plan provider switch. The amount in Box 12 Code D should also be the reason your W-2 Box 1 wages are lower than your gross annual salary.

Example: $75,000 salary, $4,500 contributed to a 401(k) (6%), $2,400 in pre-tax health insurance. W-2 Box 1 wages = $75,000 − $4,500 − $2,400 = $68,100. Box 12 Code D = $4,500.

Code W — Employer + employee HSA contributions

Code W captures both your payroll HSA contributions and any employer HSA match, combined. The 2025 HSA limit is $4,300 for self-only coverage and $8,550 for family coverage. Code W cannot exceed these limits — if it does, the excess is taxable income and you will owe a 6% excise tax. Verify Code W against your HSA account statements.

Code DD — Cost of employer-sponsored health coverage

Code DD reports the total cost of your employer-sponsored health plan — both the employee and employer share. This is purely informational: it does not affect your taxes, does not count as income, and should not be entered anywhere on your return except as reported in Box 12. It is required for the ACA's Cadillac tax reporting framework.

Worked example: reading a W-2 with three Box 12 codes

A $90,000 salaried employee contributes 10% to a traditional 401(k), has employer HSA contributions of $750, and has group-term life insurance worth $1,200/year above the $50,000 excluded amount.

W-2 fieldAmountExplanation
Box 1 (Wages)$81,072$90,000 − $9,000 (401k) + $72 (life ins imputed income)
Box 12a (Code D)$9,000Traditional 401(k) contribution (10% of $90,000)
Box 12b (Code W)$750Employer HSA contribution
Box 12c (Code C)$72Taxable group-term life insurance imputed income (added to Box 1)
Box 12d (Code DD)$7,200Total health plan cost — informational only, not taxable
🧾

Free Calculator

Calculate your federal and state income tax — no signup

Enter your W-2 Box 1 wages, filing status, and deductions to see your estimated federal and state tax liability and effective tax rate.

Calculate my taxes →

Authoritative sources

  • IRS Instructions for Forms W-2 and W-3 — The complete official guide to every W-2 box including all Box 12 codes, definitions, and reporting requirements. Updated annually for the current tax year.
  • IRS Form W-2 (PDF) — The actual W-2 form with field labels for reference, useful for locating each box number on your physical or electronic W-2.

Key takeaways

  • W-2 Box 12 uses letter codes to report specific compensation types. The W-2 has four Box 12 rows (12a–12d), allowing up to four separate codes on a single form.
  • Code D (traditional 401(k)) is the most critical to verify — it should match your contribution records and explains why W-2 Box 1 wages are lower than your gross salary.
  • Code W (HSA contributions) must not exceed the annual HSA limits ($4,300 single / $8,550 family in 2025). Excess contributions are subject to a 6% excise tax.
  • Code DD (employer health plan cost) is informational only — it has no tax impact and is not entered on your return, just reported for ACA compliance.
  • Most Box 12 codes reduce or exclude income from taxes. Codes C (group-term life insurance above $50k) and Z (non-compliant deferred comp) are rare exceptions that increase taxable income.
  • Enter every Box 12 code in your tax software exactly as shown on your W-2. Skipping them can cause calculation errors, particularly for HSA contributions and retirement plan limits.

Frequently asked questions

What is the most important W-2 Box 12 code to check?

For most employees, Code D (traditional 401(k) contributions) is the most important to verify. It should exactly match your 401(k) contribution records for the year. It directly explains the difference between your gross salary and the wages shown in Box 1, and it is used to confirm you did not exceed the annual 401(k) contribution limit.

Does a W-2 Box 12 amount increase my taxable income?

Most Box 12 codes reduce or have no effect on taxable income. Code D, E, G (retirement contributions), Code W (HSA), and Code J (non-taxable sick pay) all reduce or exclude amounts from Box 1. Code C (group-term life insurance above $50,000) is a common exception that adds to taxable income, as is Code Z (non-compliant deferred compensation).

What does it mean if Box 12 on my W-2 is blank?

Blank Box 12 means your employer had no compensation types requiring Box 12 disclosure. This is normal if you have no employer-sponsored retirement plan, no employer HSA contributions, no group-term life insurance above $50,000, and no company car.

Can my W-2 Box 12 have more than one code?

Yes. The W-2 has four Box 12 rows — 12a through 12d — so up to four separate codes can appear. If you have a 401(k) (Code D), employer HSA contributions (Code W), and employer health plan cost disclosure (Code DD), all three appear on separate rows in Box 12.

Do I need to enter W-2 Box 12 codes when filing my taxes?

Yes. Tax software prompts you to enter each Box 12 code and its dollar amount separately. Entering them correctly ensures retirement contributions are excluded from taxable wages, HSA limits are applied, and any taxable codes (like Code C) are included in your income calculation. Do not skip Box 12 inputs even when the amounts seem small.

Free tool

Try the Income Tax Calculator

Use our free income tax calculator to calculate results instantly — no signup required.

Open Income Tax Calculator
Tags:w-2box 12tax forms401khsaroth 401kemployer benefitsw2 codes
Share

Educational content only — not financial advice

The content published on Garypedia is provided solely for informational and educational purposes. It does not represent, and should not be interpreted as, financial, investment, tax, accounting, or legal advice of any kind. While reasonable care is taken to ensure the accuracy of figures, formulas, and data sources referenced, no warranty — express or implied — is made as to their completeness or suitability for any particular purpose. Garypedia, its operators, and contributors expressly disclaim all liability for any loss, damage, or adverse outcome — whether direct, indirect, or consequential — arising from reliance on material published on this site. All examples are illustrative only. Individual circumstances vary significantly; you should independently verify any information and seek guidance from a suitably qualified and regulated financial, tax, or legal professional before making any financial decision.