Where to Find 401k Contributions on W2: Box 12, Code D [Step-by-Step Tutorial]

401(k) contributions appear on your W-2 in Box 12. Look for Code D for traditional 401(k) contributions. If you contributed to a Roth 401(k), look for Code AA. The dollar amount next to each code shows your employee contribution.
KEY
POINTS
  • Box 12, Code D shows traditional 401(k) contributions.

  • Roth 401(k) contributions appear under Code AA.

  • Traditional 401(k) contributions reduce Box 1 taxable wages.

  • Boxes 3 and 5 may still include 401(k) contributions.

  • Box 13 indicates participation in an employer retirement plan.

  • Employer 401(k) matching contributions typically don’t appear on a W-2.

401(k) contributions are reported in Box 12 of Form W-2.

Pre-tax 401(k) contributions are reported with Code D, while designated Roth 401(k) contributions use Code AA.

Employer matching contributions are generally not included with employee contributions in Box 12.

Do I Get A Tax Form For My 401(k)?

Find out when you’ll receive a W-2 or 1099-R, what each form reports, and what to do if your tax form is missing.

See Your Tax Forms

Code D in Box 12

Code D in Box 12 on your W-2 means money you put into a 401(k) from your paycheck before federal income tax.

For example:

  • You put $18,000 into your 401(k).
  • Your W-2 may show D 18000.00 in Box 12.
  • Code D is also used for a SIMPLE 401(k).
  • Code S is for a SIMPLE IRA, not a SIMPLE 401(k).
SAMPLE DATA — FOR ILLUSTRATION ONLY — NOT A REAL TAX DOCUMENT
SAMPLE
a  Employee’s social security number 000-00-0000
1  Wages, tips, other compensation $77,000.00
2  Federal income tax withheld $8,500.00
b  Employer identification number (EIN) 12-3456789  ·  Acme Robotics, Inc.  ·  500 Fabricator Way, Springfield, ST 00000
3  Social security wages $95,000.00
4  Social security tax withheld $5,890.00
5  Medicare wages and tips $95,000.00
6  Medicare tax withheld $1,377.50
7  Social security tips $0.00
8  Allocated tips $0.00
e  Employee’s name and address Jordan A. Sample  ·  12 Maple Street, Springfield, ST 00000
W‑2  Wage and Tax Statement
2025
12  Codes and amounts (up to four entries, 12a–12d)
D 18,000.00 ← Elective deferral to a 401(k) plan
   
   
15  State  /  Employer’s state ID ST  /  999-9999-9
16  State wages, tips, etc. $77,000.00
17  State income tax $3,200.00
Why Box 1 is lower than Box 3/5: The $18,000 Code D deferral is pre-tax for federal income tax, so it’s subtracted from Box 1 (95,000 − 18,000 = 77,000). It’s still subject to Social Security and Medicare tax, so Boxes 3 and 5 stay at the full $95,000.
All names, numbers, and amounts on this form are fictional demo data for illustration purposes only.

This code is used only for qualified plan deferrals; non-401(k) plans (e.g. 403(b), 457) use other codes.

What If I Have a Roth 401(k)?

Designated Roth 401(k) contributions are shown with Code AA in Box 12.

Because Roth deferrals are after-tax, they remain part of federal taxable income; thus Box 1 still includes the Roth amount unlike pre-tax deferrals.

An employee’s gross wages are not reduced by Roth contributions; the W-2 will show the full wages in Box 1, with the Roth portion separately coded in 12AA.

IMPORTANT
IRS Publication 525 confirms that designated Roth contributions to a 401(k) are reported using Code AA in Box 12 and are included in Box 1 wages on Form W-2.

This means Roth 401(k) contributions are included in federal taxable wages for income-tax purposes, even though they are not subject to federal income tax again when qualified distributions are taken.

Roth 401(k) deferrals are taxed currently but qualify for tax-free treatment on future qualified distributions.

SAMPLE DATA — FOR ILLUSTRATION ONLY — NOT A REAL TAX DOCUMENT
SAMPLE
a  Employee’s social security number 000-00-0000
1  Wages, tips, other compensation $95,000.00
2  Federal income tax withheld $12,100.00
b  Employer identification number (EIN) 12-3456789  ·  Acme Robotics, Inc.  ·  500 Fabricator Way, Springfield, ST 00000
3  Social security wages $95,000.00
4  Social security tax withheld $5,890.00
5  Medicare wages and tips $95,000.00
6  Medicare tax withheld $1,377.50
7  Social security tips $0.00
8  Allocated tips $0.00
e  Employee’s name and address Jordan A. Sample  ·  12 Maple Street, Springfield, ST 00000
W‑2  Wage and Tax Statement
2025
12  Codes and amounts (up to four entries, 12a–12d)
AA 18,000.00 ← Designated Roth 401(k) deferral (after-tax)
   
   
15  State  /  Employer’s state ID ST  /  999-9999-9
16  State wages, tips, etc. $95,000.00
17  State income tax $4,100.00
Why Box 1 didn’t shrink: The $18,000 Roth deferral is after-tax, so it stays inside Box 1’s $95,000 — unlike a traditional 401(k), where the same $18,000 would have been subtracted out.
Per IRS Publication 525: designated Roth contributions to a 401(k) plan are reported with code AA in box 12, and they are included in wages in box 1 of Form W-2.

Pre-tax vs. Roth, side by side — same employee, same $18,000 deferral, same $95,000 gross pay:

Box Traditional 401(k) — Code D Roth 401(k) — Code AA
Box 1 (federal taxable wages) $77,000.00 $95,000.00
Box 3 / Box 5 (SS / Medicare wages) $95,000.00 $95,000.00
Box 12 entry D 18,000.00 AA 18,000.00
Taxed now? No (pre-tax) Yes (after-tax)
Taxed at qualified withdrawal? Yes No (tax-free)
All names, numbers, and amounts on this form are fictional demo data for illustration purposes only.

Why Isn’t My 401(k) Contribution in Box 1?

Pre-tax 401(k) contributions reduce an employee’s federal taxable wages.

So, elective deferrals are not subject to federal income tax when made.

As a result, Box 1 (federal wages) is lower by the amount of pre-tax deferrals.

For example, if gross salary is $100k and $18k is deferred to 401(k), Box 1 shows $82k.

These contributions are not reported as taxable income on the employee’s individual income tax return.

Your salary is run less the 401(k) deferral for income-tax withholding, so Box 1 excludes it.

What Do Boxes 1, 3, and 5 Have to Do With My 401(k)?

For a traditional (pre-tax) 401(k), the key question is which payroll taxes the contribution is exempt from. 

A pre-tax 401(k) contribution reduces wages for federal income-tax purposes, but it remains subject to Social Security and Medicare taxes.

W-2 Box What It Shows Effect of Pre-Tax 401(k) Deferral $100k Gross / $18k Deferral Example
Box 1 — Federal Wages Wages subject to federal income tax Reduces Box 1 $82,000
Box 3 — Social Security Wages Wages subject to Social Security tax, up to the annual wage base Does not reduce Box 3; elective deferrals are included $100,000
Box 5 — Medicare Wages Wages subject to Medicare tax Does not reduce Box 5; elective deferrals are included $100,000

A $18,000 pre-tax 401(k) contribution on $100,000 of gross wages generally reduces Box 1 to $82,000, while Boxes 3 and 5 remain $100,000 (assuming the Social Security wage base has not been reached).

The contribution itself is also reported in Box 12 with Code D.

Box 13 Retirement Plan Checkbox

The Retirement plan checkbox in Box 13 signals that the employee was an active participant in an employer-sponsored retirement plan during the year.

For a 401(k) plan participant, this box will normally be checked.

SAMPLE DATA — FOR ILLUSTRATION ONLY — NOT A REAL TAX DOCUMENT
SAMPLE
a  Employee’s social security number 000-00-0000
1  Wages, tips, other compensation $77,000.00
2  Federal income tax withheld $8,500.00
b  Employer identification number (EIN) 12-3456789  ·  Acme Robotics, Inc.  ·  500 Fabricator Way, Springfield, ST 00000
3  Social security wages $95,000.00
4  Social security tax withheld $5,890.00
5  Medicare wages and tips $95,000.00
6  Medicare tax withheld $1,377.50
7  Social security tips $0.00
8  Allocated tips $0.00
e  Employee’s name and address Jordan A. Sample  ·  12 Maple Street, Springfield, ST 00000
W‑2  Wage and Tax Statement
2025
12  Codes and amounts (up to four entries, 12a–12d)
D 18,000.00 ← Elective deferral to a 401(k) plan
   
13  Statutory employee  /  Retirement plan  /  Third-party sick pay
Statutory employee
Retirement plan  ✓
Third-party sick pay
15  State  /  Employer’s state ID ST  /  999-9999-9
16  State wages, tips, etc. $77,000.00
17  State income tax $3,200.00
Why it’s checked: Jordan deferred part of their pay into the employer’s 401(k) (see Box 12, Code D), which makes them an active participant in an employer-sponsored plan for the year — so the employer checks the Retirement plan box.
Per the IRS W-2 instructions: if the retirement plan box is checked, special limits may apply to the amount of traditional IRA contributions the employee may deduct. Publication 590-A gives the precise phase-out ranges.

What a checked Box 13 changes — traditional IRA deduction, single filer, 2024 example range:

Box 13 status Traditional IRA deduction (single filer)
Not checked (no employer plan) Fully deductible at any income
Checked, MAGI below $73,000 Fully deductible
Checked, MAGI $73,000–$83,000 Partially deductible (phases out)
Checked, MAGI above $83,000 Not deductible
2024 phase-out figures shown for illustration; consult Pub. 590-A for the current year and for other filing statuses. All names, numbers, and amounts on this form are fictional demo data.

So, if Box 13 is checked, depending on filing status and MAGI, they may not be entitled to a full deduction for their traditional IRA contributions.

IMPORTANT
A checked Box 13 means your IRA deductibility may be subject to lower income phaseout limits because you were covered by a retirement plan at work.

For example, in 2024, the full IRA deduction for a single active participant phases out as MAGI rises from $73,000 to $83,000.

Does My Employer’s 401(k) Match Appear on My W-2?

Usually, no. 

Your employer’s matching contribution generally does not appear in Boxes

  • 1
  • 3
  • 5, or 12 of your W-2.

Employer matching contributions are generally not taxable to you when they are contributed to a 401(k). 

401(k) Contribution Box 1 Box 3 Box 5 Box 12
Your pre-tax contribution Reduces Included Included Code D
Your Roth contribution Included Included Included Code AA
Employer match Not included Not included Not included Not reported*

How Do I Calculate My Total 401(k) Contributions?

To find the year’s total 401(k) contributions, sum all pre-tax and Roth deferrals reported on the W-2(s).

  • Find Box 12 on your W-2.
  • Look for Code D and write down the amount. This is your traditional 401(k) contribution.
  • Look for Code AA and write down the amount. This is your Roth 401(k) contribution. Then add the two amounts together.
Your W-2 Shows Amount
Code D — Traditional 401(k) $_____
Code AA — Roth 401(k) $_____
Total 401(k) contributions $_____

Example: If

  • Code D is $15,000 and
  • Code AA is $5,000,

Add them together: $15,000 + $5,000 = $20,000. So, you contributed $20,000 to your 401(k) that year.

How to Fill W-2 Form?

Here is a demo example W-2 with a $100,000 salary, $18,000 pre-tax deferral, and $5,000 Roth deferral.

Box 1 is reduced, Box 3 and Box 5 still reflect full wages, Box 12 contains the D and AA amounts, and Box 13 is checked.

SAMPLE DATA — FOR ILLUSTRATION ONLY — NOT A REAL TAX DOCUMENT
SAMPLE
a  Employee’s social security number 000-00-0000
1  Wages, tips, other compensation £82,000.00
2  Federal income tax withheld £11,400.00
b  Employer identification number (EIN) 12-3456789  ·  Acme Robotics, Inc.  ·  500 Fabricator Way, Springfield, ST 00000
3  Social security wages £100,000.00
4  Social security tax withheld £6,200.00
5  Medicare wages and tips £100,000.00
6  Medicare tax withheld £1,450.00
7  Social security tips £0.00
8  Allocated tips £0.00
e  Employee’s name and address Jordan A. Sample  ·  12 Maple Street, Springfield, ST 00000
W‑2  Wage and Tax Statement
2025
12  Codes and amounts (up to four entries, 12a–12d)
D 18,000.00 ← Pre-tax elective deferral, traditional 401(k)
AA 5,000.00 ← After-tax deferral, designated Roth 401(k)
   
13  Statutory employee  /  Retirement plan  /  Third-party sick pay
Statutory employee
Retirement plan  ✓
Third-party sick pay
15  State  /  Employer’s state ID ST  /  999-9999-9
16  State wages, tips, etc. £82,000.00
17  State income tax £3,800.00
£100,000 salary £18,000 pre-tax (D) = £82,000 in Box 1
£5,000 Roth (AA) stays inside Box 1 — no separate subtraction
The short version: pre-tax deferrals (Code D) come out of Box 1; Roth deferrals (Code AA) stay in Box 1. Both still count toward Boxes 3 and 5, and both mean Box 13’s Retirement Plan box gets checked.
Sample W-2 Walkthrough — £100,000 salary, £18,000 pre-tax + £5,000 Roth deferral
Box Item Example Value Comments
1 Federal wages, tips, etc. £82,000 £100,000 salary minus £18k pre-tax deferrals; includes £5k Roth
3 Social security wages £100,000 Full salary (up to SS wage base)
5 Medicare wages and tips £100,000 Full salary (no limit)
12 D — Elective deferrals (401(k)) £18,000 Pre-tax deferrals to 401(k)
12 AA — Roth 401(k) contributions £5,000 After-tax (Roth) deferrals
13 Retirement plan (checkbox) Employee participated in a 401(k) (active participant)
All names, numbers, and amounts on this form are fictional demo data for illustration purposes only.
401(k) Contributions on Your W-2 FAQs

401(k) Contributions on Your W-2 FAQs

Only pre-tax 401(k) deferrals appear under Box 12 code D. If you made designated Roth contributions, those appear under code AA, so add Box 12D and 12AA to determine your total 401(k) employee contributions.

Yes, Box 13 can be checked even if you contributed nothing because you may have been an active participant in a retirement plan, such as receiving an employer contribution. This can affect whether your traditional IRA contribution is fully deductible.

No, employer matching contributions generally aren’t included in Box 1 and aren’t taxed until you receive a distribution from the plan.

Excess elective deferrals generally must be distributed to you, and if the excess isn’t corrected by April 15 of the following year, it may be taxed twice. Your W-2 can still report the full amount of your elective deferrals, including an excess contribution.

No, Box 1 cannot show negative wages, and elective deferrals generally cannot exceed your compensation.

First, check with your payroll department, and if your employer made an error, it generally must issue a corrected W-2, or W-2c. You may also need to amend your tax return if you have already filed it.

Catch-up contributions are included in the Box 12 total under the applicable code, such as D for pre-tax 401(k) contributions or AA for Roth 401(k) contributions, rather than being reported under a separate catch-up code.

No, Box 1 and Box 5 can differ because some income is excluded from federal income tax but remains subject to Social Security and Medicare taxes. For traditional 401(k) deferrals, Box 1 is generally lower than Box 5 because pre-tax contributions reduce federal taxable wages.

Your W-2 is the main tax form for checking your employee 401(k) contributions, but you can also review your pay stubs or 401(k) plan statements. Form 1099-R reports distributions from the plan, not your contributions.

Usually, many states follow the federal treatment and exclude pre-tax 401(k) contributions from state taxable wages, but state rules vary.

Your W-2 generally reports 401(k) contributions under code D or AA and 403(b) contributions under code E or BB. The annual elective deferral limit generally applies in aggregate to 401(k), 403(b), SARSEP, and SIMPLE plans, while 457(b) plans have a separate limit.

References:

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *