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

Direct answer: irs w-2 box 12 code d means you made pre-tax elective deferrals to a 401(k) plan during the year. The money came out of your pay before federal income tax was figured. It lowered your Box 1 wages. It did not lower your Social Security or Medicare wages.
Key Takeaways
- irs w-2 box 12 code d = pre-tax elective deferrals to a 401(k) plan, including SIMPLE 401(k) plans.
- Code D lowers Box 1 federal wages, but Boxes 3 and 5 still include the full amount.
- Do not subtract Code D on your tax return. Box 1 already excludes it.
- Code D and Code AA share one annual limit. Add them together before you compare to the limit.
- Code D does not include employer matching contributions or Roth contributions (Code AA).
## irs w-2 box 12 code d: Pre-Tax 401(k) Elective Deferrals
The IRS General Instructions for Forms W-2 and W-3 define the code as: “Code D — Elective deferrals under a section 401(k) cash or deferred arrangement (plan).” That includes SIMPLE 401(k) plans.
“Elective” means you chose it. You told your employer to send part of your pay into your 401(k) instead of paying it to you as cash. “Pre-tax” means the money skipped federal income tax on its way in. You pay that tax later, when you withdraw the money in retirement.
Code D is the most common Box 12 code most employees will ever see. If you contribute to a traditional 401(k) at work, this is where it shows up.
If your W-2 also shows Roth contributions, read [IRS W-2 Box 12 Code AA Meaning: Roth 401(k) Contributions](https://bhcpatax.com/irs-w-2-box-12-code-aa/). If it shows a health coverage cost, read [IRS W-2 Box 12 Code DD Meaning: Health Coverage Cost](https://bhcpatax.com/irs-w-2-box-12-code-dd/). Each Box 12 code reports a different kind of money.
## How Box 12 Works: Slots 12a to 12d
Box 12 has four slots: 12a, 12b, 12c, and 12d. The small letters are just slot labels. They are not part of the code. A Code D entry means the same thing whether it sits in 12a or 12d.
Each slot holds one code and one dollar amount. Your employer fills the slots in order. If you have only one Box 12 entry, it lands in 12a.
A W-2 can hold up to four Box 12 entries. If you have more than four, the extra entries go on a second W-2 from the same employer. Add the Code D amounts from both forms together to get your yearly total.
## How Code D Changes Boxes 1, 3, and 5
Here is a simple example. Suppose your gross pay for the year is $60,000. You deferred $5,000 pre-tax into your traditional 401(k). You made no Roth contributions.
– **Box 1 (federal taxable wages): $55,000.** The $5,000 pre-tax deferral is removed from Box 1. You did not pay federal income tax on it yet.
– **Box 3 (Social Security wages): $60,000.** Pre-tax 401(k) deferrals are still subject to Social Security tax.
– **Box 5 (Medicare wages): $60,000.** Pre-tax 401(k) deferrals are still subject to Medicare tax.
– **Box 12 Code D: $5,000.** This is the record of your pre-tax deferral.
This split explains a common confusion. Your Box 1 figure is lower than your gross pay, but your Box 3 and Box 5 figures are not. Nothing is wrong. Federal income tax treats Code D differently from Social Security and Medicare taxes.
Your W-2 Box 2 federal withholding is a separate number. It flows to your tax transcript as [IRS Code 806: Credit for Withheld Taxes](https://bhcpatax.com/irs-code-806/). Code D has nothing to do with withholding. When you file with this W-2, any refund the IRS issues posts to your transcript as [IRS Code 846: Refund Issued](https://bhcpatax.com/irs-code-846/).
## Code D vs. Code AA, E, and Other Deferral Codes
Box 12 uses a different code for each plan type. Mixing them up is easy. Here is the split for the codes employees meet most often:
| Code | Plan | Tax timing |
|—|—|—|
| D | 401(k), including SIMPLE 401(k) | Pre-tax; lowers Box 1 now |
| AA | Designated Roth 401(k) | After-tax; stays in Box 1 now |
| E | 403(b) plan (schools, nonprofits) | Pre-tax; lowers Box 1 now |
| BB | Designated Roth 403(b) | After-tax; stays in Box 1 now |
| F | SARSEP (salary reduction SEP) | Pre-tax; a different plan from a 401(k) |
| G | 457(b) deferred compensation | Pre-tax; government and some nonprofit employers |
| W | Health Savings Account contributions | Not a retirement deferral at all |
irs w-2 box 12 code d: Pre-Tax 401(k) Elective Deferrals
The IRS General Instructions for Forms W-2 and W-3 define the code as: “Code D — Elective deferrals under a section 401(k) cash or deferred arrangement (plan).” That includes SIMPLE 401(k) plans.
“Elective” means you chose it. You told your employer to send part of your pay into your 401(k) instead of paying it to you as cash. “Pre-tax” means the money skipped federal income tax on its way in. You pay that tax later, when you withdraw the money in retirement.
Code D is the most common Box 12 code most employees will ever see. If you contribute to a traditional 401(k) at work, this is where it shows up.
If your W-2 also shows Roth contributions, read IRS W-2 Box 12 Code AA Meaning: Roth 401(k) Contributions. If it shows a health coverage cost, read IRS W-2 Box 12 Code DD Meaning: Health Coverage Cost. Each Box 12 code reports a different kind of money.
How Box 12 Works: Slots 12a to 12d
Box 12 has four slots: 12a, 12b, 12c, and 12d. The small letters are just slot labels. They are not part of the code. A Code D entry means the same thing whether it sits in 12a or 12d.
Each slot holds one code and one dollar amount. Your employer fills the slots in order. If you have only one Box 12 entry, it lands in 12a.
A W-2 can hold up to four Box 12 entries. If you have more than four, the extra entries go on a second W-2 from the same employer. Add the Code D amounts from both forms together to get your yearly total.
How Code D Changes Boxes 1, 3, and 5
Here is a simple example. Suppose your gross pay for the year is $60,000. You deferred $5,000 pre-tax into your traditional 401(k). You made no Roth contributions.
- Box 1 (federal taxable wages): $55,000. The $5,000 pre-tax deferral is removed from Box 1. You did not pay federal income tax on it yet.
- Box 3 (Social Security wages): $60,000. Pre-tax 401(k) deferrals are still subject to Social Security tax.
- Box 5 (Medicare wages): $60,000. Pre-tax 401(k) deferrals are still subject to Medicare tax.
- Box 12 Code D: $5,000. This is the record of your pre-tax deferral.
This split explains a common confusion. Your Box 1 figure is lower than your gross pay, but your Box 3 and Box 5 figures are not. Nothing is wrong. Federal income tax treats Code D differently from Social Security and Medicare taxes.
Your W-2 Box 2 federal withholding is a separate number. It flows to your tax transcript as IRS Code 806: Credit for Withheld Taxes. Code D has nothing to do with withholding. When you file with this W-2, any refund the IRS issues posts to your transcript as IRS Code 846: Refund Issued.
Code D vs. Code AA, E, and Other Deferral Codes
Box 12 uses a different code for each plan type. Mixing them up is easy. Here is the split for the codes employees meet most often:
| Code | Plan | Tax timing |
|---|---|---|
| D | 401(k), including SIMPLE 401(k) | Pre-tax; lowers Box 1 now |
| AA | Designated Roth 401(k) | After-tax; stays in Box 1 now |
| E | 403(b) plan (schools, nonprofits) | Pre-tax; lowers Box 1 now |
| BB | Designated Roth 403(b) | After-tax; stays in Box 1 now |
| F | SARSEP (salary reduction SEP) | Pre-tax; a different plan from a 401(k) |
| G | 457(b) deferred compensation | Pre-tax; government and some nonprofit employers |
| W | Health Savings Account contributions | Not a retirement deferral at all |
Two mix-ups deserve special attention. First, Code D never covers Roth contributions. Roth 401(k) money is always Code AA. Second, Code D never covers SARSEP deferrals. A SARSEP uses Code F. If you work for a school or nonprofit and see Code E, that is a 403(b), not a 401(k). The tax treatment is similar, but the plan is different.
| Check this | What it tells you |
|---|---|
| Is Box 1 lower than gross pay by the Code D amount? | It should be. Box 1 excludes pre-tax deferrals. If it does not, ask payroll. |
| Are Boxes 3 and 5 higher than Box 1? | They should be, by about the Code D amount. Social Security and Medicare taxes still apply. |
| Do you also have a Code AA amount? | Add Code D and Code AA together. The sum must fit under one annual limit. |
| Does the amount match your pay stubs? | Add the pre-tax 401(k) deductions on your final pay stub. It should match Code D. |
Two mix-ups deserve special attention. First, Code D never covers Roth contributions. Roth 401(k) money is always Code AA. Second, Code D never covers SARSEP deferrals. A SARSEP uses Code F. If you work for a school or nonprofit and see Code E, that is a 403(b), not a 401(k). The tax treatment is similar, but the plan is different.
## The Annual Limit and Excess Deferrals
Code D and Code AA share a single annual elective deferral limit for the same plan type. You cannot max out both separately. The IRS counts your pre-tax and Roth deferrals together.
For 2026, the base elective deferral limit is $24,500. If you are age 50 or older, an extra catch-up amount applies. The IRS adjusts these limits each year, so always check the limit for the year on your W-2.
Example: if you deferred $20,000 pre-tax (Code D) and $4,500 Roth (Code AA) in 2026, your total is $24,500. You are exactly at the limit.
The limit applies across all employers. If you changed jobs mid-year and contributed at both jobs, add every Code D and Code AA amount from every W-2. An excess can happen even when each single W-2 looks fine.
If your total went over the limit, the excess must be corrected. In general, the excess plus its earnings must be withdrawn by April 15 of the following year. If it is not corrected on time, the excess can become taxable income in two years instead of one. Contact your plan administrator as soon as you spot an excess. The fix has a deadline.
## What Code D Does NOT Include
– **It does not include employer matching contributions.** Your employer’s match does not appear in Box 12 at all. Code D covers only your own elective deferrals.
– **It does not include Roth contributions.** Roth 401(k) money is Code AA, not Code D.
– **It does not include SARSEP deferrals.** Those are Code F.
– **It does not include 403(b) deferrals.** Those are Code E.
– **It does not mean you get a second deduction.** Box 1 already excludes the Code D amount. Do not subtract it again on your return.
– **It does not mean you skipped Social Security and Medicare taxes.** Boxes 3 and 5 still include the full Code D amount.
## What To Do When You See Code D
Follow these steps, in order:
1. **Confirm the amount against your pay stubs.** Add up the pre-tax 401(k) deductions on your final pay stub of the year. The total should match Code D.
2. **Check the Box 1 math.** Your gross pay minus Code D should roughly equal Box 1, before other pre-tax items like health premiums. A large unexplained gap is worth a question to payroll.
3. **Add Code D and Code AA together.** Check the sum against the annual limit for that year. Include amounts from every employer if you changed jobs.
4. **Do not subtract Code D on your return.** Box 1 already excludes it. Subtracting it again would understate your income.
5. **Check your wage transcript if anything looks off.** Pull it through the [IRS Get Transcript tool](https://www.irs.gov/individuals/get-transcript) and compare the wage figures to your W-2. If you are unsure how to read it, use [How to Read an IRS Account Transcript: Step-by-Step Guide](https://bhcpatax.com/how-to-read-irs-account-transcript/).
6. **Keep the W-2 with your tax records.** Future withdrawals from the plan are taxed, and the deferral record supports your account history.
Once your return is filed, you can follow [Tax Refund Status](https://bhcpatax.com/tax-refund-status/) to track any refund.
## When to Ask Your Employer or a Tax Professional
Contact your employer or plan administrator when:
– The Code D amount does not match your pay stubs.
– Box 1 does not drop by roughly the Code D amount, with no other explanation.
– Your combined Code D and Code AA total went over the annual limit.
– Code D is missing even though you deferred pre-tax all year.
– You received a corrected W-2 (W-2c) and the Code D amount changed.
Talk to a tax professional when an excess deferral needs correcting, or when you deferred to more than one employer’s plan in the same year. Excess corrections have deadlines and tax effects in two years if mishandled.
The official code list is in the [IRS General Instructions for Forms W-2 and W-3](https://www.irs.gov/instructions/iw2w3).
## Related Guides
– [IRS Transcript Codes: Complete List and Meanings](https://bhcpatax.com/irs-transcript-codes/)
– [IRS W-2 Box 12 Code AA Meaning: Roth 401(k) Contributions](https://bhcpatax.com/irs-w-2-box-12-code-aa/)
– [IRS W-2 Box 12 Code DD Meaning: Health Coverage Cost](https://bhcpatax.com/irs-w-2-box-12-code-dd/)
– [How to Read an IRS Account Transcript: Step-by-Step Guide](https://bhcpatax.com/how-to-read-irs-account-transcript/)
## FAQ
### What does irs w-2 box 12 code d mean?
It means you made pre-tax elective deferrals to a 401(k) plan during the year. Per the IRS General Instructions for Forms W-2 and W-3, Code D reports “Elective deferrals under a section 401(k) cash or deferred arrangement (plan),” including SIMPLE 401(k) plans.
### Does Code D lower my taxable income?
Yes, for federal income tax. Box 1 excludes the Code D amount. But Boxes 3 and 5 still include it, because Social Security and Medicare taxes apply to pre-tax deferrals.
### Do I need to report Code D on my tax return?
No separate entry is needed. Box 1 already excludes the amount. Do not subtract Code D again on Form 1040. Doing so would understate your income.
### What is the difference between Code D and Code AA?
Code D is pre-tax. It lowers Box 1 now, and withdrawals are taxed later. Code AA is Roth. It leaves Box 1 unchanged now, and qualified withdrawals are tax-free later. Both share one annual elective deferral limit.
### Does Code D include my employer’s matching contributions?
No. Code D covers only your own elective deferrals. Employer matching contributions are tracked separately by the plan and do not appear in Box 12.
### What happens if my Code D plus Code AA total goes over the limit?
The excess plus its earnings must generally be withdrawn by April 15 of the following year. Contact your plan administrator right away. If the excess is not corrected on time, it can be taxed twice — once in the year deferred and again when withdrawn.
**Disclaimer:** This post is general information only and is not tax advice. Every tax situation is different. For advice about your own W-2 or retirement plan, consult a qualified tax professional or contact the IRS directly.
—
The Annual Limit and Excess Deferrals
Code D and Code AA share a single annual elective deferral limit for the same plan type. You cannot max out both separately. The IRS counts your pre-tax and Roth deferrals together.
For 2026, the base elective deferral limit is $24,500. If you are age 50 or older, an extra catch-up amount applies. The IRS adjusts these limits each year, so always check the limit for the year on your W-2.
Example: if you deferred $20,000 pre-tax (Code D) and $4,500 Roth (Code AA) in 2026, your total is $24,500. You are exactly at the limit.
The limit applies across all employers. If you changed jobs mid-year and contributed at both jobs, add every Code D and Code AA amount from every W-2. An excess can happen even when each single W-2 looks fine.
If your total went over the limit, the excess must be corrected. In general, the excess plus its earnings must be withdrawn by April 15 of the following year. If it is not corrected on time, the excess can become taxable income in two years instead of one. Contact your plan administrator as soon as you spot an excess. The fix has a deadline.
What Code D Does NOT Include
- It does not include employer matching contributions. Your employer’s match does not appear in Box 12 at all. Code D covers only your own elective deferrals.
- It does not include Roth contributions. Roth 401(k) money is Code AA, not Code D.
- It does not include SARSEP deferrals. Those are Code F.
- It does not include 403(b) deferrals. Those are Code E.
- It does not mean you get a second deduction. Box 1 already excludes the Code D amount. Do not subtract it again on your return.
- It does not mean you skipped Social Security and Medicare taxes. Boxes 3 and 5 still include the full Code D amount.
What To Do When You See Code D
Follow these steps, in order:
- Confirm the amount against your pay stubs. Add up the pre-tax 401(k) deductions on your final pay stub of the year. The total should match Code D.
- Check the Box 1 math. Your gross pay minus Code D should roughly equal Box 1, before other pre-tax items like health premiums. A large unexplained gap is worth a question to payroll.
- Add Code D and Code AA together. Check the sum against the annual limit for that year. Include amounts from every employer if you changed jobs.
- Do not subtract Code D on your return. Box 1 already excludes it. Subtracting it again would understate your income.
- Check your wage transcript if anything looks off. Pull it through the IRS Get Transcript tool and compare the wage figures to your W-2. If you are unsure how to read it, use How to Read an IRS Account Transcript: Step-by-Step Guide.
- Keep the W-2 with your tax records. Future withdrawals from the plan are taxed, and the deferral record supports your account history.
Once your return is filed, you can follow Tax Refund Status to track any refund.
When to Ask Your Employer or a Tax Professional
Contact your employer or plan administrator when:
- The Code D amount does not match your pay stubs.
- Box 1 does not drop by roughly the Code D amount, with no other explanation.
- Your combined Code D and Code AA total went over the annual limit.
- Code D is missing even though you deferred pre-tax all year.
- You received a corrected W-2 (W-2c) and the Code D amount changed.
Talk to a tax professional when an excess deferral needs correcting, or when you deferred to more than one employer’s plan in the same year. Excess corrections have deadlines and tax effects in two years if mishandled.
The official code list is in the IRS General Instructions for Forms W-2 and W-3.
Related Guides
- IRS Transcript Codes: Complete List and Meanings
- IRS W-2 Box 12 Code AA Meaning: Roth 401(k) Contributions
- IRS W-2 Box 12 Code DD Meaning: Health Coverage Cost
- How to Read an IRS Account Transcript: Step-by-Step Guide
FAQ
What does irs w-2 box 12 code d mean?
It means you made pre-tax elective deferrals to a 401(k) plan during the year. Per the IRS General Instructions for Forms W-2 and W-3, Code D reports “Elective deferrals under a section 401(k) cash or deferred arrangement (plan),” including SIMPLE 401(k) plans.
Does Code D lower my taxable income?
Yes, for federal income tax. Box 1 excludes the Code D amount. But Boxes 3 and 5 still include it, because Social Security and Medicare taxes apply to pre-tax deferrals.
Do I need to report Code D on my tax return?
No separate entry is needed. Box 1 already excludes the amount. Do not subtract Code D again on Form 1040. Doing so would understate your income.
What is the difference between Code D and Code AA?
Code D is pre-tax. It lowers Box 1 now, and withdrawals are taxed later. Code AA is Roth. It leaves Box 1 unchanged now, and qualified withdrawals are tax-free later. Both share one annual elective deferral limit.
Does Code D include my employer’s matching contributions?
No. Code D covers only your own elective deferrals. Employer matching contributions are tracked separately by the plan and do not appear in Box 12.
What happens if my Code D plus Code AA total goes over the limit?
The excess plus its earnings must generally be withdrawn by April 15 of the following year. Contact your plan administrator right away. If the excess is not corrected on time, it can be taxed twice — once in the year deferred and again when withdrawn.
Disclaimer: This post is general information only and is not tax advice. Every tax situation is different. For advice about your own W-2 or retirement plan, consult a qualified tax professional or contact the IRS directly.