Schema Tax

Box 12 Code D on W2: Your 401(k) Salary Deferrals

By Schema TaxPublished Updated

Box 12 code D on a W2 shows the part of your pay you chose to put into a traditional 401(k) plan during the year. The amount is your own elective deferral, not your employer's match. It is already left out of Box 1 taxable wages but still counted in Box 3 Social Security wages and Box 5 Medicare wages.

What code D reports: traditional 401(k) elective deferrals

Code D in Box 12 reports elective deferrals under a section 401(k) plan: the salary you asked your employer to send to the plan instead of paying it to you. The figure is only your own deferred pay for the calendar year. Employer matching contributions, profit-sharing money and after-tax savings that are not Roth are left out of code D.

The IRS General Instructions for Forms W-2 and W-3 (2026) define the amount narrowly. The amount reported as elective deferrals "is only the part of the employee's salary (or other compensation) that they did not receive because of the deferrals." The same instructions list what is not an elective deferral and so may go in Box 14a but not in Box 12: nonelective employer contributions, after-tax contributions that are not designated Roth contributions, required employee contributions, and employer matching contributions.

That list answers the most common question about code D. If your plan statement shows $6,000 going in for the year and code D shows $4,000, the difference may be your employer's match. The match is real money in your account, but the W2 does not report it under code D.

Code D also covers one plan that does not carry the 401(k) name. The instructions say employers should "also show deferrals under a SIMPLE retirement account that is part of a section 401(k) arrangement" under code D. A stand-alone SIMPLE IRA uses code S instead.

The format on the form is fixed. The instructions give the example of $5,300.00 in 401(k) deferrals entered as "D 5300.00," with the capital letter to the left of the line in one of the slots 12a through 12d and the amount to the right, with no dollar sign or comma. The slot letter has no meaning: code D can appear in 12a, 12b, 12c or 12d.

Roth 401(k) money is reported separately. Designated Roth contributions to a 401(k) plan use code AA, and the guide to Box 12 code AA covers how that code differs. Deferrals to 403(b) and 457(b) plans use codes E and G, and the 401(k) limit is shared with some of those plans; the section on the shared deferral limit across code D and code E plans explains how the plans count together.

Why does code D lower Box 1 but not Box 3 or Box 5?

Code D lowers Box 1 but not Box 3 or Box 5 because a traditional 401(k) deferral is excluded from income tax wages but is still wages for Social Security and Medicare tax. Box 1 measures income tax wages. Boxes 3 and 5 measure the wages those two payroll taxes apply to. The deferral sits inside the second group.

The IRS instructions spell out both sides. For Box 1, employers must "not include elective deferrals (such as employee contributions to a section 401(k) or 403(b) plan)." For Box 3, they must "report in box 3 elective deferrals to certain qualified cash or deferred compensation arrangements and to retirement plans described in box 12 (codes D, E, F, G, and S) even though the deferrals are not includible in box 1." Box 5 follows the Box 3 rules, without a wage cap.

IRS Tax Topic 424 on 401(k) plans puts it from the employee side: deferrals are "included as wages subject to withholding for Social Security and Medicare taxes," and they are "reported as an information item in box 12 of your Form W-2."

A worked example with code D, Box 1, Box 3 and Box 5

This example uses a fictional employee, Jordan Example, with a fictional salary and no other pretax deductions. Jordan earned $68,000 in gross salary and deferred 6% of each paycheck to the employer's traditional 401(k). The employer also matched 3%.

W2 entryExample amountHow it is figured
Gross salary paid in the year$68,000.00Before any deductions
Box 12a, code DD 4080.006% of $68,000 deferred by Jordan
Box 1, wages, tips, other compensation$63,920.00$68,000 minus the $4,080 deferral
Box 3, Social Security wages$68,000.00Deferral stays in
Box 5, Medicare wages and tips$68,000.00Deferral stays in
Box 13, Retirement planCheckedJordan was an active participant
Employer match, $2,040Not in code DMay appear in Box 14a or not at all

The pattern to look for is simple. Box 3 minus Box 1 equals the code D amount when the 401(k) deferral is the only difference between the two boxes. In real W2s the gap is often bigger, because other pretax deductions can lower Box 1 too, and Box 3 stops at the Social Security wage base, which the IRS instructions put at $184,500 for 2026. Jordan's salary is well under that cap, so Box 3 and Box 5 match.

Is the code D amount taxable?

The code D amount is not taxed as income in the year you defer it, because it is already left out of Box 1. It is taxed for Social Security and Medicare, because it stays in Boxes 3 and 5. Income tax on the money comes later, when it is paid out of the plan as a taxable distribution.

Tax Topic 424 says a 401(k) deferral "isn't subject to income tax withholding at the time of deferral." The IRS page on 401(k) general distribution rules for plan participants covers the other end: "Any taxable amount that is not rolled over must be included in income in the year you receive it." The same page says a participant "may have to pay a 10% additional tax" on some early distributions, with listed exceptions.

The practical meaning for the W2 is that you do not subtract code D from anything. Box 1 is already the reduced figure. The Form W-2 (2026) instructions for employees tell you to enter Box 1 "on the wages line of your tax return unless those instructions direct you to report it elsewhere." Subtracting code D a second time would understate wages.

There is one case where part of a code D amount becomes taxable now. The Form W-2 notice says elective deferrals under all plans are generally limited to a total of $24,500 for 2026, and "amounts in excess of the overall elective deferral limit must be included in income." The IRS instructions give an example: an employee age 45 who deferred $26,500 has the full $26,500 reported as "D 26500.00," and the return of the excess, with earnings, is reported later on Form 1099-R.

Code D answers how much went in. It does not show your balance, your investment gains or the match, so it cannot tell you what a later distribution will be. The explainer on D and DD in Box 12 covers the other double-letter code that sits next to it and is never taxed.

Code D catch-up contributions after age 50

Code D catch-up contributions after age 50 appear inside the code D amount, not on a separate line. An employee who was 50 or older at any time during the year and made extra 401(k) deferrals sees one code D figure that combines regular deferrals and catch-up deferrals. The W2 does not split them.

The IRS instructions say that for these employees, the employer should "report the elective deferrals and the elective deferral 'catch-up' contributions as a single sum in box 12 using the appropriate code." The same rule applies to Roth: designated Roth contributions and Roth catch-up contributions go in as a single sum under code AA.

That single sum is why code D can be higher than the general limit printed on the form without being an error. The Form W-2 notice for 2026 says that if you were at least age 50, "your employer may have allowed an additional elective deferral or designated Roth contribution (catch-up contribution) to your plan." It points to IRS Publication 525 for the catch-up limits, "including the higher limit if you were age 60 through 63 as of December 31, 2026."

How to read a code D above the general limit

If you were 50 or older and code D is above $24,500, compare it with your plan's year-end statement of employee contributions. A code D figure equal to your regular deferrals plus your catch-up deferrals is consistent with the single-sum rule. A figure above that total, or a code D above the limit for someone under 50, is the case the excess-deferral example in the IRS instructions describes.

Prior-year make-up contributions follow a different format. The instructions say deferrals made up for a prior year under USERRA, the military reemployment law, carry the year between the code and the amount, as in "D 25 1250.00." A code D with a two-digit year in the middle is a make-up entry, not a typo, and the Form W-2 notice says to consider those amounts "for the year shown, not the current year."

Code D that does not match your 401(k) statement

Code D that does not match your 401(k) statement usually reflects a difference in what each document counts, not an error. The W2 reports only your own deferrals from paychecks dated in the calendar year. A plan statement may include the match, Roth money, rollovers and investment results, and it may follow deposit dates instead of pay dates.

Work through the usual causes in order:

  1. Employer match and profit sharing. These are excluded from code D by the IRS instructions, so a statement total that includes them will be higher.
  2. Roth deferrals. Designated Roth contributions are reported under code AA, not D. A statement that shows one "employee contributions" line may be combining the two.
  3. Pay date versus deposit date. The instructions say W2 entries "must be based on wages paid during the calendar year." A deferral from a December 31 paycheck that reached the plan in January is on this year's W2 and may be on next year's statement.
  4. More than one employer. Each employer's W2 reports only the deferrals from its own payroll. If you changed jobs, add the code D figures from each W2 before comparing with a combined account.
  5. Make-up contributions. USERRA amounts for prior years appear as separate code D entries with a year attached.

If none of these explain the gap, the next step is your final pay stub of the year. Its year-to-date 401(k) line should equal code D. If the stub and the W2 disagree, payroll is the place to ask, and the W-2 forms category links to the guides on getting a corrected form.

When you have several W2s to reconcile, the comparison is a column of numbers. Schema Tax reads each W2's Box 12 slots into separate code and amount fields, so every code D entry lands in its own column next to Box 1, Box 3 and Box 5. The W2 fields it extracts are listed on the forms page, and the export is a spreadsheet you can total against your plan statements.

The comparison of codes D and DD helps when a W2 shows both and the second one looks like a duplicate. For the health coverage figure on its own, the guide to Box 12 DD explains why that amount is reported but never taxed.

All posts in W-2 Box 12 and Box 14 Codes