What Does Box 12 Code D Mean on a W-2?
401(k) contribution (traditional, pre-tax) โ what it means, whether it's taxable, and what to do with it.
By the Easy Guides Editorial Team ยท Updated for 2026
Code D in Box 12 of your W-2 means 401(k) contribution (traditional, pre-tax). Tax treatment: Pre-tax (already excluded).
What Code D means
The amount counts toward the annual 401(k) contribution limit. If you changed jobs, add up Code D from every W-2 to check you didn't over-contribute.
Does Code D affect my taxes?
This is what you put into a traditional 401(k) through payroll. It's already left out of your Box 1 taxable wages โ that's the tax break โ so you don't deduct it again.
Where to find Code D on your W-2
Box 12 has up to four slots โ labeled 12a, 12b, 12c, and 12d. Each slot shows a letter code and a dollar amount. The 12aโ12d labels are just line numbers; the actual code is the small letter next to the money. So "12a: D 5,000" means Code D with a $5,000 amount. When you file, enter the code and amount exactly as shown.