On your W-2, deferred compensation shows up in Box 12 as a letter code paired with a dollar amount. The letter identifies the type of plan, and the amount is what you deferred during the year. The code also tells you where else that money appears: pre-tax retirement deferrals are subtracted from Box 1 but stay in Boxes 3 and 5, Roth deferrals stay in all three, and non-qualified deferrals follow their own rules. Reading the Box 12 codes for deferred compensation on your W-2 correctly is how you confirm your taxable wages, your Social Security and Medicare wages, and whether anything on the form needs fixing.
What Pre-Tax Deferrals Do to Your Wage Boxes
Contribute pre-tax to a 401(k), 403(b), or similar qualified plan and your employer subtracts that amount from the federal taxable wages in Box 1. Earn $100,000, defer $20,000, and Box 1 reads $80,000. You will not owe federal income tax on the deferred portion until you take it out of the plan.1Internal Revenue Service. General Instructions for Forms W-2 and W-3 – Specific Instructions for Form W-2
Social Security and Medicare are a different story. Elective deferrals under codes D, E, F, G, and S have to be included in Box 3 (Social Security wages) and Box 5 (Medicare wages).1Internal Revenue Service. General Instructions for Forms W-2 and W-3 – Specific Instructions for Form W-2 So if you deferred pre-tax dollars this year, expect Box 3 and Box 5 to be higher than Box 1. That gap is normal, not an error. Social Security tax stops applying above $184,500 in 2026; Medicare has no ceiling.2Social Security Administration. 2026 Cost-of-Living Adjustment (COLA) Fact Sheet
Codes for Traditional Qualified Retirement Plans
Your W-2 has room for up to four Box 12 entries, labeled 12a through 12d. Each holds one code and one amount. For traditional pre-tax retirement contributions, these are the codes you will see:
- Code D. Elective deferrals to a 401(k), including a SIMPLE 401(k). By far the most common retirement code on W-2s.
- Code E. Elective deferrals to a 403(b), the plan type used by public schools and many tax-exempt employers.
- Code G. Deferrals to a governmental 457(b). Code G is broader than D or E because it captures both your elective deferrals and any nonelective employer contributions to the plan.
- Code S. Employee salary reduction contributions to a SIMPLE IRA under Section 408(p), including contributions routed to a Roth SIMPLE IRA.
- Code F. Salary reduction contributions to a SARSEP established before 1997. You will only see this on W-2s from employers with grandfathered plans.
All of these behave the same way on the form: the amount comes out of Box 1 and stays in Boxes 3 and 5.3Internal Revenue Service. Common Errors on Form W-2 Codes for Retirement Plans
Codes for Designated Roth Contributions
Roth deferrals are made with money that has already been taxed, so they don’t come out of Box 1. They still get a Box 12 code so the IRS can track how much went into the Roth side of the plan. You pay income tax and FICA now; qualified withdrawals later are tax-free.
- Code AA. Designated Roth contributions under a 401(k).3Internal Revenue Service. Common Errors on Form W-2 Codes for Retirement Plans
- Code BB. Designated Roth contributions under a 403(b).3Internal Revenue Service. Common Errors on Form W-2 Codes for Retirement Plans
- Code EE. Designated Roth contributions under a governmental 457(b).4Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026)
Because these are after-tax dollars, the Roth deferral amount is included in Boxes 1, 3, and 5.4Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026) The five-year rule and age 59½ requirement (or disability or death) govern whether later distributions come out tax-free.5Internal Revenue Service. Retirement Plans FAQs on Designated Roth Accounts
Codes for Non-Qualified Deferred Compensation
Non-qualified deferred compensation is a different animal. NQDC plans are contractual arrangements, typically for executives and highly compensated employees, and they are governed by Section 409A of the Internal Revenue Code.6Office of the Law Revision Counsel. 26 USC 409A – Inclusion in Gross Income of Deferred Compensation Under Nonqualified Deferred Compensation Plans Two Box 12 codes attach to them.
Code Y
Code Y reports what you elected to defer under a Section 409A non-qualified plan during the year. The amount is excluded from Box 1, so your income tax deferral is preserved. Code Y is essentially informational, letting the IRS see the deferral.4Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026)
FICA works differently for these plans. Under the special timing rule of Section 3121(v)(2), Social Security and Medicare tax is owed at the later of when you perform the services or when the compensation is no longer subject to a substantial risk of forfeiture. In plain terms, FICA usually hits at vesting, which may be years before you actually receive the money. When vesting happens, the employer adds the vested balance to Boxes 3 and 5 but not to Box 1. That is why an executive’s Social Security and Medicare wages can be far larger than federal taxable wages in a vesting year.
Code Z
Code Z is the code you don’t want to see. It means compensation previously deferred under a non-qualified plan has failed Section 409A and must be included in income now. The amount is also added to Box 1, and you owe a 20% additional tax plus an interest charge on top of regular income tax on the same amount.4Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026) The 20% penalty and interest are your responsibility to calculate and pay on Form 1040; the W-2 only reports the income inclusion. If Code Z shows up, talk to a tax advisor before filing.6Office of the Law Revision Counsel. 26 USC 409A – Inclusion in Gross Income of Deferred Compensation Under Nonqualified Deferred Compensation Plans
Deferrals That Won’t Appear in Box 12
Not every deferred-compensation arrangement produces a Box 12 code. Two worth knowing about:
SEP-IRA contributions. Employer contributions to a SEP-IRA are not reported anywhere on your W-2. The employer deducts them on the business return, and the amount is reported to you on Form 5498 instead.3Internal Revenue Service. Common Errors on Form W-2 Codes for Retirement Plans
Section 457(f) plans. Tax-exempt organizations and state or local governments sometimes offer deferred compensation through a 457(f) plan, which is a non-qualified arrangement outside the eligible 457(b) framework. There is no dedicated Box 12 code. Instead, the deferred amount is included in Box 1 for the first year in which it is no longer subject to a substantial risk of forfeiture.7Office of the Law Revision Counsel. 26 US Code 457 – Deferred Compensation Plans of State and Local Governments and Tax-Exempt Organizations You can owe tax at vesting even without receiving cash.
When the Box 12 Amount Is Too High
The dollar figure next to a code like D, E, G, AA, BB, or EE has to stay within the annual elective deferral limit. For 2026, that limit is $24,500 across all your traditional and Roth contributions to 401(k), 403(b), and governmental 457(b) plans combined. Age-50 catch-ups add up to $8,000, and employees aged 60 through 63 can add up to $11,250 under SECURE 2.0.8Internal Revenue Service. 401(k) Limit Increases to $24,500 for 2026, IRA Limit Increases to $7,500
The trap is two employers. Each 401(k) plan tracks only its own contributions, so if you switched jobs mid-year or worked two jobs, your combined Code D amounts across both W-2s can exceed the limit without either employer noticing. It is your job to catch it and to notify at least one plan administrator before March 1 of the following year. If the excess plus its earnings is distributed back to you by April 15, the excess is taxed only in the year you originally deferred it, and the earnings are taxed in the year distributed.9Internal Revenue Service. 401(k) Plan Fix-It Guide – Elective Deferrals Werent Limited to the Amounts Under IRC Section 402(g) for the Calendar Year and Excesses Werent Distributed
Miss April 15 and the excess is taxed twice: once in the deferral year and again when it eventually leaves the plan. If you are under 59½, the corrective distribution can also draw the 10% early distribution penalty. A timely correction is reported on Form 1099-R with distribution Code 8 or Code P in Box 7.10Internal Revenue Service. 2025 Instructions for Forms 1099-R and 5498
So when your W-2 arrives, work down Box 12 line by line. Match each letter to the plan you actually participate in. Confirm that pre-tax codes cut Box 1 but leave Boxes 3 and 5 alone, that Roth codes appear in all three boxes, and that any Code Y or Code Z entry lines up with what you know about your NQDC arrangement. The codes are short, but they carry the whole story of how your deferred compensation was taxed this year.