W-2 Box 12 Codes for the 1040: Wages, Deductions, and Schedule 2

Most codes in Box 12 of your W-2 are informational: the dollar amounts are either already included in your Box 1 wages or already excluded from them, and you don’t touch them again on your 1040. A smaller set does real work on your return, either unlocking a deduction, changing a stock sale calculation, or adding tax on Schedule 2. Sorting the W-2 Box 12 codes into those buckets is the whole task.

Every code is a single letter or double letter followed by a dollar amount. What matters is what that letter tells you to do, or not do, when you file.

Codes Already Included in Your Box 1 Wages

These amounts are taxable and already sitting in Box 1. The Box 12 entry exists to explain the composition of your wages or to let the IRS cross-check a limit. Do not add them to income again.

Code C is the taxable cost of employer-provided group-term life insurance above $50,000. It is already in Boxes 1, 3, and 5. Code C simply explains why your Box 1 figure may be higher than your salary.

Code DD reports the total cost of your employer-sponsored health coverage, employer share and employee share combined. It is not taxable and does not affect Box 1, Box 3, or Box 5. This one is pure disclosure.

Codes AA, BB, and EE are designated Roth contributions to a 401(k), 403(b), and governmental 457(b), respectively. Roth money is after-tax, so it is already in your Box 1 wages. The IRS uses these figures to confirm you stayed within the annual deferral limit, which Roth and pre-tax contributions share within the same plan type.

Code V is compensation from exercising nonstatutory stock options, measured as the spread between fair market value at exercise and what you paid. It is already in Boxes 1, 3, and 5. Code V matters later, when you sell the stock; see the cost basis note below.

Code Y reports deferrals under a Section 409A nonqualified deferred compensation plan. The amount is not in Box 1 and is not currently taxable, but it also does not require any action from you. Reporting Code Y is not even mandatory for employers.

Codes Already Excluded from Box 1 (Nothing to Deduct)

These amounts were removed from your taxable wages at the payroll level. The exclusion is done. You do not deduct them again on your return.

Codes D, E, G, and S are pre-tax retirement deferrals: Code D for 401(k) plans (including SIMPLE 401(k)), Code E for 403(b) plans, Code G for 457(b) plans, and Code S for SIMPLE IRA salary reduction contributions. Because the deferral happened before federal income tax was calculated, the amount is not in Box 1. For 2026, the elective deferral ceiling for 401(k), 403(b), and governmental 457(b) plans is $24,500, with an $8,000 catch-up at age 50 and a higher $11,250 catch-up for those turning 60 through 63 during the year.1Internal Revenue Service. 401(k) Limit Increases to $24,500 for 2026, IRA Limit Increases to $7,500 SIMPLE IRA deferrals have their own limit of $17,000 for 2026, with a $4,000 catch-up at 50 and older.2Internal Revenue Service. Common Errors on Form W-2 Codes for Retirement Plans

Code P is qualified moving expense reimbursements for active-duty Armed Forces members who moved on military orders. This exclusion is available only to military personnel. Civilian moving reimbursements are taxable and appear in Box 1 instead.3Internal Revenue Service. Frequently Asked Questions for Moving Expenses

Code J is nontaxable sick pay from a third-party payer, such as an insurance company, when you paid the premiums into the sick pay plan. Because you funded it, the benefit comes back tax-free and is excluded from Box 1.4Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026)

Code L reports substantiated employee business expense reimbursements paid under an accountable plan. When your documented reimbursement did not exceed your actual costs, it is nontaxable and excluded from Box 1, and nothing goes on your 1040. Any excess over documented expenses would appear separately in Box 1 as taxable wages.

Codes That Unlock a Deduction or a Form

Code W is the total of employer and payroll-deducted employee contributions to a Health Savings Account. Payroll-route contributions are already excluded from federal income tax, Social Security tax, and Medicare tax, so the amount is not in Box 1.5Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026) You still report Code W on Form 8889. If you also made HSA contributions directly from a personal bank account, you add those on the same form; the resulting deduction flows to Schedule 1 as an adjustment to income and reduces AGI whether or not you itemize. For 2026, the HSA contribution limit is $4,400 for self-only coverage and $8,750 for family coverage, with a $1,000 catch-up at age 55 and older.6Internal Revenue Service. Expanded Availability of Health Savings Accounts Under the One, Big, Beautiful Bill Act (OBBBA) – Notice 2026-5 Contributions above these limits face a 6% excise tax each year they remain in the account, reported on Form 5329.

Code R is employer contributions to an Archer Medical Savings Account, an older cousin of the HSA. Report Code R on Form 8853, not Form 8889. Contributions within allowable limits are excluded from income.4Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026)

Code H is elective deferrals to a Section 501(c)(18)(D) tax-exempt organization plan. These plans are uncommon, and unlike the D/E/G/S codes, the amount is included in Box 1 wages. You claim the deduction on your return rather than having it removed at the payroll stage. Code H is not for SEP contributions.2Internal Revenue Service. Common Errors on Form W-2 Codes for Retirement Plans

Codes That Add Tax on Schedule 2

Code Z is income from a nonqualified deferred compensation plan that failed to meet the requirements of Section 409A. The amount is already in Box 1 as ordinary wages, but on top of regular income tax you owe an additional 20% tax plus interest, reported on Schedule 2, Part II. The interest calculation is genuinely intricate, and the penalty is steep enough to justify professional help.

Code M is uncollected Social Security tax on group-term life insurance above $50,000 provided to former employees. Code N is the uncollected Medicare tax on the same benefit. These appear when a former employer kept you covered but had no wages left to withhold from. You pay the amounts directly on Schedule 2.5Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026)

Code Q: Combat Pay and the EITC Election

Code Q is nontaxable combat zone pay for members of the military. It is excluded from Box 1 and owes no federal income tax. The wrinkle is the Earned Income Tax Credit. Combat pay is left out of the earned income calculation by default, but you can elect to include it. The election is all-or-nothing on the Code Q amount, and it helps some filers and hurts others depending on where they sit on the EITC curve. For some, adding combat pay boosts the credit meaningfully; for others, it pushes earned income into the phase-out and shrinks the credit. Calculate it both ways before choosing.

Two Watch-Outs Hidden in the Codes

Excess Deferrals Across Multiple Jobs

If you changed jobs during the year and both employers withheld retirement contributions, add up your Code D, E, G, or S amounts across every W-2. The combined figure has to stay within the annual limit, and no code by itself will flag a problem. When the total exceeds the ceiling, notify one plan administrator and request a corrective distribution of the excess plus earnings by April 15 of the following year. That deadline does not move if you file an extension. The excess deferral is taxable in the year contributed; the earnings are taxable in the year distributed, and both are reported on Form 1099-R.7Internal Revenue Service. Retirement Topics – 401(k) and Profit-Sharing Plan Contribution Limits Miss the deadline and the excess is taxed twice: once when contributed and again when eventually distributed from the plan.

Code V and Your Stock Sale Cost Basis

When you sell shares acquired through nonstatutory stock options, the Code V compensation amount gets added to what you paid at exercise to produce your adjusted cost basis. Many broker 1099-Bs report only the exercise price and understate basis. If you accept the 1099-B figure as-is, you will pay tax twice on the Code V income: once as wages in Box 1 and again as capital gain. Correct the basis on Form 8949, and the gain or loss flows to Schedule D.5Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026)