W-2 Box 12 Codes Explained: What Every Code Means for Your Taxes
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
- Find Box 12 on your W-2 — it has four rows labelled 12a through 12d, each with a letter code and a dollar amount.
- Match each code to its meaning — use the table below for the most common codes.
- Verify the amounts — Code D should match your 401(k) contribution records; Code W should match your HSA employer match.
- Enter in tax software — every code and amount must be entered when you file; most tax software prompts you for each one separately.
- 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.
Complete reference: common W-2 Box 12 codes
| Code | Description | 2025 limit | Reduces taxable income? |
|---|---|---|---|
| D | Traditional 401(k) elective deferrals | $23,500 ($31,000 age 50+) | Yes — excluded from Box 1 wages |
| AA | Roth 401(k) elective deferrals | $23,500 (combined with D) | No — already taxed; withdrawals tax-free |
| E | 403(b) elective deferrals | $23,500 | Yes |
| BB | Roth 403(b) deferrals | $23,500 (combined with E) | No |
| G | 457(b) government plan deferrals | $23,500 | Yes |
| W | Employer + employee HSA contributions | $4,300 single / $8,550 family | Yes — excluded from Box 1, 3, and 5 |
| DD | Cost of employer-sponsored health coverage | Informational only | No — informational only, not reportable income |
| C | Taxable cost of group-term life insurance over $50,000 | N/A | No — increases taxable wages |
| J | Non-taxable sick pay | N/A | Excluded from Box 1 |
| L | Substantiated employee business expense reimbursements | N/A | Excluded — not income |
| P | Moving expense reimbursements (military only after 2017) | N/A | Excluded for military members |
| V | Income from exercise of non-statutory stock options | N/A | No — already included in Box 1; informational |
| Z | Income under a Section 409A non-qualified deferred compensation plan | N/A | No — 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 field | Amount | Explanation |
|---|---|---|
| Box 1 (Wages) | $81,072 | $90,000 − $9,000 (401k) + $72 (life ins imputed income) |
| Box 12a (Code D) | $9,000 | Traditional 401(k) contribution (10% of $90,000) |
| Box 12b (Code W) | $750 | Employer HSA contribution |
| Box 12c (Code C) | $72 | Taxable group-term life insurance imputed income (added to Box 1) |
| Box 12d (Code DD) | $7,200 | Total 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.
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 →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.