Skip to content
Independent money guidance
Clear Money Guide
Start here
Menu

W-2 Box 12 Code D: 401(k) Elective Deferrals

Updated September 29, 2026. Quick answer: code D in Box 12 is the amount you elected to defer from your pay into a 401(k) plan during the year. The employer reports it in Box 12, leaves it out of Box 1 wages, and still counts it in Box 3 (social security wages).

What the IRS tells the employer

The 2026 General Instructions for Forms W-2 and W-3 define code D as “Elective deferrals under a section 401(k) cash or deferred arrangement (plan). Also show deferrals under a SIMPLE retirement account that is part of a section 401(k) arrangement.”

How it is entered

The instructions give the format: “if you are reporting $5,300.00 in elective deferrals under a section 401(k) plan, the entry would be D 5300.00”. The code goes to the left of the vertical line in boxes 12a through 12d and the dollar amount to the right.

Why Box 1 is lower than your pay

Box 1 is defined as taxable wages, and the same instruction says “do not include elective deferrals (such as employee contributions to a section 401(k) or 403(b) plan) except section 501(c)(18) contributions.” That is why a code D amount does not raise your Box 1 number. Box 3 works the other way: “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.” The side-by-side is on Box 12 vs Box 1 and Box 3.

What happens if the deferral went over the limit

The instructions work an example: “Even though the 2026 limit for elective deferrals and designated Roth contributions is $24,500, Alex’s total elective deferral amount of $26,500 is reported in box 12 with code D (D 26500.00).” It continues: “The amount deferred in excess of the limit is not reported in box 1. The return of excess elective deferrals and excess designated Roth contributions, including earnings on both, is reported on Form 1099-R.” The current year’s limits are on the 401(k) limits page.

What is not code D

The instructions list items that are “not elective deferrals and may be reported in box 14a, but not in box 12.” They include nonelective employer contributions, required employee contributions and employer matching contributions. Roth contributions to the same plan use a different code: see code AA.

Common mistakes

  • Expecting the code D amount to appear inside Box 1. The IRS instruction excludes elective deferrals from Box 1.
  • Treating employer matching contributions as code D. The instructions say they are not elective deferrals and do not belong in Box 12.
  • Mixing up D and AA. Code AA is for designated Roth contributions to a 401(k), and the AA instruction says not to use it for elective deferrals.

Related: code E, code G, code AA, code S, the 401(k) contribution limits, and what pre-tax versus Roth does to a paycheck.

Every code in one place: the Box 12 codes table. If a withdrawal from one of these accounts is your question, see the Form 1099-R Box 7 codes.

Figures verified against the IRS 2026 General Instructions for Forms W-2 and W-3 on September 30, 2026.

Sources

Optional next step

Want help with this decision?

Ask an adviser how this choice fits your broader retirement and financial plan.

  • No fee to request a match
  • No obligation to hire

Expect questions about your situation, your name, email and phone, and phone verification by text. A match is not guaranteed.

The form is run by Kapitalwise, our advisor-matching partner. Kapitalwise sends your details to advisers who pay for the introduction, so expect calls and texts. Clear Money Guide is paid when you submit the form, whether or not you ever hire anyone. This is free to you and there is no obligation to hire anyone.

Opens here. Nothing loads and nothing reaches Kapitalwise until you press the button.

How our partner relationships work

Code meanings are read from the IRS 2026 General Instructions for Forms W-2 and W-3 (Box 12) at irs.gov on September 29, 2026. General information, not tax advice. Your own facts decide the outcome, and a payroll professional, a preparer or the IRS is the right place to confirm anything consequential.