U.S. · W-2 box 12

W-2 box 12 code D.

Your pre-tax 401(k) contributions for the year, and how they relate to the limit.

Code D is the money you put into a 401(k) from your pay before income tax. It is already left out of box 1, so you do not add it back, but it is still counted in boxes 3 and 5. The 2026 limit is $24,500 for pre-tax and Roth deferrals combined, plus a catch-up if you are 50 or older.

IRS General Instructions for Forms W-2 and W-3 (2026)Read November 1, 2026

Advertisement

Check your code D amount

$
The dollar figure on your W-2.
$
Other jobs, plus any pre-tax or Roth deferral codes on other lines. Leave 0 if none.
Age 50 and over gets a catch-up in most plans.
$

Result

Advertisement

What code D means

IRS description: Code D: 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.

Code D reports the part of your pay that went into the plan instead of reaching you, which is why the IRS describes the figure as only the pay you "did not receive because of the deferrals." It includes your catch-up contributions in the same single number if you are 50 or older. Employer matching money is not part of it: the IRS says matching and nonelective employer contributions may be listed in box 14, but never in box 12. The entry reads like D 5300.00: the letter in the left half of box 12a, 12b, 12c or 12d and the dollar amount on the right. The IRS notes the codes do not follow any order, so a lone D can sit in 12a or 12d.

If the plan allowed you to elect make-up amounts for an earlier year under USERRA (military service), the earlier years are listed on separate lines such as D 24 2250.00.

Where code D shows up on your W-2 and return

Worked example

Dana earns $78,000 and defers 6%. Her payroll sends $4,680 to the 401(k), so box 12 shows D 4680.00. Box 1 is $78,000 − $4,680 = $73,320, while boxes 3 and 5 stay at $78,000. She owes nothing extra for the deferral, and the $4,680 counts against her $24,500 limit for 2026.

The IRS gives its own example of a 45-year-old who defers $26,500 under a 401(k) and also makes a $1,000 designated Roth contribution. The W-2 shows D 26500.00 and AA 1000.00, even though the 2026 limit is $24,500, because box 12 reports what was deferred, not what is allowed. The excess is dealt with through the plan, not by changing the W-2.

Limits and what to check

For 2026 the limit on employee deferrals to a 401(k), 403(b) and governmental 457(b) is $24,500. Catch-up for age 50 and over is generally $8,000 (a total of $32,500), and for ages 60 to 63 it is $11,250 (the IRS news release, read November 1, 2026). Designated Roth contributions (code AA) share the same limit, and the limit follows you across employers, so two jobs can push you over without either W-2 looking wrong. If your total deferrals went over, the 2025 Form 1040 instructions say the excess goes in the "other income" line 1h and recommend contacting your plan administrator, since the plan can return the excess and its earnings (reported on Form 1099-R).

Common mistakes

See every code in one searchable table on the W-2 box 12 codes lookup.

Sources

Primary sources opened on November 1, 2026. The plain-English parts of this page are our summary of them, not IRS guidance.

Advertisement

Frequently asked questions

What does code D mean on a W-2?

Code D is the amount you deferred into a 401(k) plan from your pay for the year. The IRS describes it as elective deferrals under a section 401(k) cash or deferred arrangement.

Is the code D amount taxable?

It is not part of box 1, so it does not raise your taxable wages for the year. It is still in boxes 3 and 5, so Social Security and Medicare tax applied to it.

Does code D include my employer match?

No. The IRS says employer matching and nonelective contributions are not reported in box 12. They may appear in box 14 if the employer chooses to list them.

What is the code D limit for 2026?

$24,500 for employee deferrals, plus $8,000 catch-up at 50 and over or $11,250 at ages 60 to 63. Pre-tax deferrals and Roth contributions count toward the same limit.

Why is my box 3 higher than box 1?

Because the 401(k) deferral is excluded from box 1 but included in box 3. Subtract your code D amount from the box 3 figure and you should land near box 1.

What if code D is more than the limit?

Contact the plan administrator quickly. The plan can return the excess and its earnings, and the Form 1040 instructions explain where an excess deferral is reported as income.

Not tax advice

This page summarizes IRS instructions written for employers and is not tax advice. Your payroll provider, plan administrator or a tax professional can confirm what a code means on your own form. Everything runs in your browser; nothing you enter is sent anywhere.