Code D in Box 12 of your W-2 reports the pre-tax salary you elected to defer into a traditional 401(k) during the year. It is the reason your federal taxable wages in Box 1 are lower than your gross pay, and it is the figure your tax software uses to check whether you stayed within the annual contribution limit. For 2026, that limit is $24,500.1Internal Revenue Service. 401(k) Limit Increases to $24,500 for 2026, IRA Limit Increases to $7,500
What Code D Covers
Code D is defined by the IRS as elective deferrals to a “section 401(k) cash or deferred arrangement,” which also includes SIMPLE 401(k) plans.2Internal Revenue Service. Common Errors on Form W-2 Codes for Retirement Plans “Elective” means you chose to redirect that pay into the plan; your employer didn’t make the decision for you.
Two things Code D does not include. Employer matching contributions are tracked separately and do not appear in Box 12 at all.3Internal Revenue Service. 2026 General Instructions for Forms W-2 and W-3 Designated Roth 401(k) contributions use a different letter, Code AA. Code D covers only the traditional, pre-tax side of what you put in.
One boundary worth flagging: if you contribute to a Salary Reduction Simplified Employee Pension (SARSEP) rather than a 401(k), your deferrals are reported under Code F, not Code D.3Internal Revenue Service. 2026 General Instructions for Forms W-2 and W-3
Why Your Box 1 Wages Look Low
Traditional 401(k) deferrals are excluded from federal income tax withholding, so your employer subtracts them before filling in Box 1.3Internal Revenue Service. 2026 General Instructions for Forms W-2 and W-3 Earn $80,000 and defer $10,000, and Box 1 shows roughly $70,000.
Payroll taxes work differently. Box 3 (Social Security wages) and Box 5 (Medicare wages) include your Code D contributions, because deferrals are not excluded from those taxes.3Internal Revenue Service. 2026 General Instructions for Forms W-2 and W-3 In the same example, Boxes 3 and 5 would still reflect the full $80,000. You pay 6.2% Social Security tax and 1.45% Medicare tax on that higher figure, and the Social Security Administration credits you for the full earnings amount when calculating your future benefit.
Roth 401(k) contributions under Code AA are handled the opposite way in Box 1. They stay in your taxable wages now, but qualified withdrawals in retirement are tax-free. Both Code D and Code AA amounts show up in Boxes 3 and 5, and the $24,500 annual limit applies to the two combined, not each type separately.3Internal Revenue Service. 2026 General Instructions for Forms W-2 and W-3
2026 Contribution Limits
The standard elective deferral limit for 2026 is $24,500.1Internal Revenue Service. 401(k) Limit Increases to $24,500 for 2026, IRA Limit Increases to $7,500 Your Code D amount, added to any Code AA Roth contributions, should not exceed that figure unless you qualify for a catch-up contribution.
If you’re 50 or older at any point during the year, you can add another $8,000, bringing your cap to $32,500. Under a SECURE 2.0 Act change, employees ages 60, 61, 62, and 63 get a larger catch-up of $11,250 instead of $8,000, for a total of up to $35,750.1Internal Revenue Service. 401(k) Limit Increases to $24,500 for 2026, IRA Limit Increases to $7,500
The limit is per person, not per plan. If you contribute to a 401(k) at two employers, each plan only sees its own deferrals, so tracking the combined total is on you.4Internal Revenue Service. How Much Salary Can You Defer if You’re Eligible for More Than One Retirement Plan
Checking the Number Before You File
Compare the Code D figure on your W-2 to the year-to-date 401(k) deduction on your final pay stub. They should match. If they don’t, call your payroll department before filing, because the difference will flow through to your Box 1 wages.
When you enter your W-2 into tax software, you’ll type the code and dollar amount exactly as shown. Because Code D is already stripped out of Box 1, you don’t add or subtract anything manually. The software uses the number to confirm you stayed within the annual limit and to check whether you qualify for the Retirement Savings Contributions Credit.
The Saver’s Credit
The Saver’s Credit gives lower- and moderate-income taxpayers a credit worth 10%, 20%, or 50% of their retirement contributions, based on adjusted gross income and filing status.5Internal Revenue Service. Retirement Savings Contributions Credit (Saver’s Credit) Code D deferrals count as eligible contributions. To claim the credit, complete IRS Form 8880 and attach it to your return. The 2025 phase-out cutoffs were $79,000 for married filing jointly, $59,250 for head of household, and $39,500 for other filers; the 2026 numbers are adjusted for inflation and appear in that year’s Form 8880 instructions.6Internal Revenue Service. Form 8880 Credit for Qualified Retirement Savings Contributions
If Your Code D Amount Is Over the Limit
Excess deferrals are not tax-free. Under 26 USC 402, any elective deferral above the annual limit is included in your gross income for the year you made the contribution.7Office of the Law Revision Counsel. 26 USC 402 – Taxability of Beneficiary of Employees Trust
You have until April 15 of the following year to fix it. Contact your plan administrator, ask for a corrective distribution of the excess plus any earnings on it, and the money comes back out of the plan. You’ll owe income tax on the excess for the year you deferred it, but you avoid double taxation and the 10% early withdrawal penalty.8Internal Revenue Service. Consequences to a Participant Who Makes Excess Deferrals to a 401(k) Plan Filing a tax extension does not push this deadline back. April 15 is fixed regardless of when you file your return.9Internal Revenue Service. 401(k) Plan Fix-It Guide – Elective Deferrals Werent Limited to the Amounts Under IRC Section 402g for the Calendar Year and Excesses Werent Distributed
Miss April 15, and the outcome gets worse. The excess stays in the plan and gets taxed twice: once in the contribution year, and again when you eventually withdraw it. You also get no basis credit for the amount, so the IRS treats the future distribution as if it had never been taxed.8Internal Revenue Service. Consequences to a Participant Who Makes Excess Deferrals to a 401(k) Plan
If you had two employers, neither plan administrator may spot the overage on their own. Add the Code D amounts from both W-2s. If the combined figure is above your limit, contact one of the administrators before April 15 and request the corrective distribution.4Internal Revenue Service. How Much Salary Can You Defer if You’re Eligible for More Than One Retirement Plan
If the Code D Amount Is Wrong
When the Code D figure doesn’t match your records, your employer needs to issue a corrected form, a W-2c. The IRS instructs employers to file the W-2c as soon as possible after finding an error and to give you a copy at the same time.3Internal Revenue Service. 2026 General Instructions for Forms W-2 and W-3 The corrected form shows both the original amount and the accurate one.
If you already filed using the wrong number, you may need to submit an amended return on Form 1040-X. Because Code D affects Box 1 wages and can shift your Saver’s Credit eligibility, even a modest error can change what you owe or what you’re refunded.
If your employer won’t cooperate, contact the IRS through the number listed on IRS.gov or at a local Taxpayer Assistance Center. The IRS can reach out to your employer and, if the correction still doesn’t come, issue a substitute W-2 on your behalf.