Your 401(k) contributions appear on your W-2 in Box 12, marked with a letter code next to the dollar amount. They don’t show up in the wage boxes at the top of the form, which is what confuses most people the first time they go looking. The letter code tells you whether the money was pre-tax or Roth, and that single detail explains how the rest of the numbers on the form fit together.
Where to Find Box 12
Box 1 at the top of the W-2 shows your federal taxable wages. Pre-tax 401(k) contributions have already been subtracted from that figure, so you won’t see them itemized there. Box 12 sits in the lower-middle portion of the form and is reserved for deferred compensation and other special benefits.1Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026)
Box 12 has up to four slots, labeled 12a, 12b, 12c, and 12d. Each slot pairs a letter code with a dollar amount. The code identifies what type of contribution or benefit the amount represents, and the dollar figure is the year’s total. If you made both traditional and Roth deferrals, or participated in more than one plan type, you may see multiple codes stacked in these slots.
What the Letter Codes Mean
For 401(k) plans, two codes do the work:
- Code D is a pre-tax (traditional) 401(k) contribution. The dollar amount next to it has already been excluded from the taxable wages reported in Box 1.2Internal Revenue Service. Common Errors on Form W-2 Codes for Retirement Plans
- Code AA is a designated Roth 401(k) contribution. Because Roth money is contributed after tax, this amount is still included in the wages shown in Boxes 1, 3, and 5.1Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026)
You may run into related codes if your workplace uses a different type of plan. Code E covers pre-tax contributions to a 403(b) plan, common at schools, hospitals, and nonprofits. Code G reports 457(b) deferrals, typical for government employees.1Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026) The same logic applies: pre-tax deferrals reduce Box 1, Roth deferrals do not.
Codes That Are Not Your 401(k)
Box 12 is also used for items unrelated to retirement, and one in particular causes confusion. Code DD reports the total cost of your employer-sponsored health coverage, including what your employer paid. It’s informational only and doesn’t affect your taxes.3Internal Revenue Service. Reporting Employer-Provided Health Coverage on Form W-2 A large number next to DD is not a 401(k) contribution.
Where the Employer Match Isn’t
Your employer’s matching contributions don’t appear anywhere on the W-2. Box 12 reports only what you personally deferred from your paycheck. Employer matches aren’t taxable income to you at the time they go in, so there’s no reason for them to sit on a wage statement. For your full plan balance, check your account statement or the plan provider’s portal.
How the Code Changes Your Taxable Wages
The reason Code D and Code AA are worth telling apart is that they hit different boxes on the form.
Traditional Contributions (Code D)
Pre-tax 401(k) deferrals come out of your gross pay before federal income tax is calculated. If you earned $100,000 and put $10,000 into a traditional 401(k), Box 1 shows $90,000. That immediate reduction is the whole point of a traditional plan.1Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026)
Those same contributions do not reduce Social Security wages in Box 3 or Medicare wages in Box 5. Pre-tax 401(k) money is still subject to FICA.1Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026) That’s why Boxes 3 and 5 often look higher than Box 1 on a W-2 with a Code D entry. The gap is normal, and it’s exactly the size of your pre-tax deferral.
Roth Contributions (Code AA)
A Roth 401(k) contribution doesn’t reduce any of the three wage boxes. If you earned $100,000 and put $10,000 into a Roth 401(k), Boxes 1, 3, and 5 all show $100,000. You’ve already paid income tax on that money, and qualified withdrawals in retirement come out tax-free.
Check Box 13 While You’re There
Box 13 has a “Retirement plan” checkbox. If your employer marks it, you were covered by a workplace retirement plan during the year.4Internal Revenue Service. Are You Covered by an Employers Retirement Plan The box doesn’t state a dollar amount, but it carries a consequence: being covered can limit or eliminate the deduction you can take for traditional IRA contributions. If you’re funding an IRA on the side, this is the box that matters.
Using the Numbers at Tax Time
The Box 1 figure goes straight onto the wages line of Form 1040. Because pre-tax 401(k) deferrals are already baked into that number, you don’t claim a separate deduction for them anywhere else on your return. The reduction has already happened.
Tax software will still ask you to type in the Box 12 codes and amounts. That entry works as a verification check, confirming your deferrals stayed within the annual limit under Section 402(g).5Office of the Law Revision Counsel. 26 USC 402 – Taxability of Beneficiary of Employees Trust If your combined Code D and Code AA totals across multiple W-2s go over the limit, the IRS will notice.
The Code D or AA amount is also what you’ll use if you qualify for the Retirement Savings Contributions Credit, sometimes called the Saver’s Credit. It’s a dollar-for-dollar credit worth up to $1,000 for single filers and $2,000 for married filing jointly, claimed on Form 8880 using your Box 12 contributions.6Internal Revenue Service. Retirement Savings Contributions Credit (Savers Credit)
If the Amount Looks Wrong
Pull out your last pay stub of the year. It should show year-to-date 401(k) deferrals, and that figure should line up with what Box 12 reports under Code D or AA. A dollar or two of rounding is normal. A meaningful gap is not.
If the numbers don’t match, start with your employer’s payroll department. If there’s a genuine error, they can issue a corrected form called a W-2c. Don’t file a return with numbers you know are wrong. If payroll won’t respond or won’t fix it, you can call the IRS at 800-829-1040 for help; the agency can contact your employer on your behalf, though it takes time. Miscoded Box 12 entries are one of the more common W-2 errors turned up in retirement plan audits.2Internal Revenue Service. Common Errors on Form W-2 Codes for Retirement Plans