Box 12a with code D is where your employer reports how much you contributed to your 401(k) or similar workplace retirement plan

Box 12a on your W2 form shows money you put into a 401(k), 403(b), or other employer-sponsored retirement plan during the tax year. The letter "D" in the code column identifies this as a retirement plan contribution. This amount is separate from your regular wages and appears in Box 1 (your taxable income). The money in Box 12a reduces your taxable income for federal tax purposes — you do not pay income tax on it in the year you contribute.

Your employer fills in this box automatically based on payroll records. If you contributed $8,500 to your 401(k) throughout the year, Box 12a code D will show $8,500. This happens whether your contributions came from each paycheck or in a lump sum.

Key Takeaways

  • Box 12a code D reports your pre-tax contributions to a workplace retirement plan like a 401(k) or 403(b).
  • The amount in Box 12a is subtracted from your gross pay to calculate your taxable income, lowering your federal tax bill for that year.
  • This box only appears if you contributed to a retirement plan through your employer; if you did not, it will be blank.
  • The figure on your W2 should match what you see in your pay stubs and your plan statement for the same year.

How Box 12a code D affects your taxes

When you contribute to a traditional 401(k) or 403(b), the money comes out of your paycheck before federal income tax is calculated. Box 12a code D shows this pre-tax amount. The IRS uses this number to reduce your taxable wages, which means you owe less federal income tax that year.

For example, if your W2 shows $60,000 in Box 1 (wages) and $8,500 in Box 12a code D, your taxable income starts at $51,500 instead of $60,000. You file your tax return using the Box 1 amount, but the code D amount is already factored into how your employer withheld taxes from each paycheck. The two numbers work together — your employer withheld based on the lower amount, so you should not owe extra tax or receive a surprise refund because of this box alone.

When Box 12a code D appears and when it does not

Box 12a code D appears on your W2 only if you made contributions to a workplace retirement plan during the year. If you did not contribute, or if your employer does not offer a plan, this box will be empty or will not appear at all.

Code D specifically marks pre-tax retirement contributions. If you contributed to a Roth 401(k) instead, your employer may use a different code (usually code AA). Roth contributions are made with after-tax money, so they do not reduce your taxable income in the year you contribute. If you contributed to both a traditional and a Roth plan at the same employer, you may see both codes on your W2.

Checking Box 12a code D against your records

The amount in Box 12a code D should match the total you contributed to your retirement plan during the calendar year. You can verify this by looking at your plan statement or your pay stubs. Most employers send a year-end statement showing total contributions; some plans also show this in an online portal you can access anytime.

If the W2 amount does not match what you contributed, contact your employer's payroll or benefits department. Errors can happen — a contribution might have been recorded in the wrong year, or a payroll system might have missed a contribution. Your employer can issue a corrected W2 (called a W2-c) if needed. Do not file your tax return until the number is correct, because it affects your taxable income.

Box 12a code D and your tax filing

You do not need to enter Box 12a code D separately on your tax return. The IRS already knows about it because your employer reports it. When you file, you use the amount from Box 1 (your total wages), and the tax software or tax preparer automatically accounts for the code D amount in calculating your taxable income.

If you are self-employed or have income from other sources, you may also contribute to a SEP-IRA or Solo 401(k). Those contributions do not appear on a W2 — you report them on your tax return using Schedule 1 or Schedule C. Box 12a code D only covers contributions through an employer's plan.

Box 12a code D and retirement plan contribution limits

The IRS sets an annual limit on how much you can contribute to a 401(k) or 403(b). For 2024, the limit is $23,500 (or $31,000 if you are 50 or older and make catch-up contributions). Your Box 12a code D amount should not exceed this limit. If it does, your employer made an error, and you should report it to your benefits department when ready.

If you worked for more than one employer during the year and contributed to a 401(k) at each one, each W2 will show only the contributions to that employer's plan. You are responsible for tracking the total across all employers to make sure you did not exceed the annual limit. If you did, you must report the overage to the IRS, and the excess amount may be subject to tax and penalties.

Frequently Asked Questions

Why is Box 12a code D different from my gross pay on my paycheck?

Box 12a code D shows only your retirement plan contributions, not your total pay. Your paycheck shows your gross pay minus all deductions (retirement contributions, taxes, health insurance, and others). Box 1 on your W2 shows your wages after pre-tax deductions like retirement contributions are removed, which is why it is lower than your gross pay.

Do I report Box 12a code D on my tax return?

No. Your employer reports it to the IRS, and tax software automatically accounts for it when calculating your taxable income. You only enter your Box 1 amount (wages) on your return. The code D amount is already factored into your withholding.

What if I see code AA instead of code D on Box 12a?

Code AA means you contributed to a Roth 401(k) or Roth 403(b), not a traditional plan. Roth contributions are made with after-tax money, so they do not reduce your taxable income. You still report Box 1 wages on your return the same way.

Can I claim Box 12a code D as a deduction on my tax return?

No. The deduction already happened when your employer withheld the money from your paycheck before calculating your taxable wages. Claiming it again would be double-dipping. The amount is built into your Box 1 figure.

What should I do if Box 12a code D is wrong on my W2?

Contact your employer's payroll or benefits department right away. They can verify the amount against their records and issue a corrected W2 (W2-c) if needed. Do this before you file your tax return so your taxable income is correct.