W-2 Box 12 uses a letter code plus an amount to identify a particular benefit, contribution or other reportable item. For the four codes covered here, D identifies traditional employee 401(k) deferrals, AA identifies designated Roth employee 401(k) contributions, DD reports health-coverage cost, and W reports employer HSA funding including employee cafeteria-plan contributions. They are not four interchangeable deductions.

Reviewed November 16, 2026 · Federal explanation using the current 2026 W-2 instructions, IRS retirement guidance and the currently published 2025 HSA publication. These are four selected codes, not the complete Box 12 list. Use the instructions for the year printed on the actual form. Fictional examples assume valid ordinary contributions within applicable limits.

Begin with the code, not the size of the number. A large DD amount can describe coverage cost without being a cash payment or new tax bill. A W amount can contain money withheld from the employee’s pay even though the code’s official label refers to employer contributions.

The letter in “12a” is not the benefit code

Boxes 12a, 12b, 12c and 12d are entry spaces. The separate code entered within a space identifies the item. Code D can appear in 12a; it does not belong only in the fourth space. Read the printed code together with its corresponding amount before entering it into tax software.

The IRS W-2 instructions explain this distinction. Copy the actual code rather than replacing it with A simply because it occupies the first slot. If a screen asks for a code and an amount in different fields, keep that pair together.

Form years matter. The current 2026 instructions contain additional codes, including qualified-overtime code TT. A four-code summary cannot resolve every Box 12 entry or establish whether a tax deduction is allowed. Use the applicable year’s full instructions for an unfamiliar code, and ask the issuer about an unclear or missing entry.

Four common codes answer different questions

Selected W-2 Box 12 codes and the records behind them
CodeItem covered hereUseful supporting recordCommon mistake
DTraditional employee 401(k) elective deferralsAnnual employee pre-tax deferral detailAdding the employer match to the employee amount
AADesignated Roth employee 401(k) contributionsAnnual designated Roth contribution detailTreating every after-tax deduction as Roth
DDReported employer-sponsored health-coverage costBenefits administrator’s reportable-cost calculationAssuming it is all employee premiums or extra taxable pay
WEmployer HSA contributions, including employee cafeteria-plan fundingEmployer and qualifying salary-reduction HSA detailAssuming only the company-funded share belongs here

Each row identifies a category; it does not calculate the employee’s annual contribution limit or final tax liability. A code appearing on a W-2 does not, by itself, prove that every contribution met its eligibility requirements. Follow up when the underlying records show an excess, correction or unusual allocation.

D and AA distinguish two employee 401(k) contribution types

The IRS retirement-contribution withholding chart separates ordinary pre-tax employee salary deferrals from designated Roth deferrals. Pre-tax deferrals generally reduce federal income-tax wages, while designated Roth deferrals remain in those wages. Both generally remain subject to employee Social Security and Medicare taxation under the chart’s ordinary rules.

Do not subtract the Box 12 amount again from a correctly prepared Box 1 simply because tax software also asks for the code. Box 1 and the coded disclosure serve different reporting purposes. Our guide to W-2 wage-box differences explains the wage reconciliation separately.

For an original annual example, assume 26 paychecks each contain $180 of traditional employee 401(k) deferrals and $70 of designated Roth employee contributions. The annual employee totals are $4,680 for D and $1,820 for AA. Together, those elective amounts equal $6,500.

A fictional annual retirement record has 4680 dollars of pre-tax employee 401(k) deferrals under code D and 1820 dollars of designated Roth employee 401(k) contributions under AA. A separate 1560 dollar non-Roth employer match is not added to code D.
A traditional employee deferral, a designated Roth employee contribution and an employer match are different source categories. This figure is a reconciliation example, not a contribution-limit calculation.

Assume the same employer separately contributes a $1,560 ordinary non-Roth match. That match does not turn the employee’s D total into $6,240. The source ledger should preserve who funded each amount and its contribution type.

“After-tax” also does not automatically mean “designated Roth.” A voluntary non-Roth after-tax plan contribution is a different category. Review the plan’s actual labels before mapping a payroll deduction to AA. Special employer Roth contributions have their own reporting treatment; this employee-deferral example does not cover them.

DD is coverage-cost reporting, not a second paycheck deduction

The IRS health-coverage reporting page explains that reporting the cost does not make otherwise excludable coverage taxable. The reportable amount generally combines employer and employee portions. Reporting rules and transition relief also mean a blank DD field does not automatically establish that the employee lacked coverage.

Consider a fictional benefits administrator’s calculation for coverage included under DD. It assigns $6,960 to the employer-funded share and $2,220 to the employee-funded share. The combined reportable cost is $9,180. Comparing $9,180 only with the employee’s $2,220 payroll deductions would incorrectly suggest a $6,960 deduction error.

Fictional DD coverage-cost reconciliation
ComponentAnnual amountMeaning in this example
Employer share$6,960Part of reportable coverage cost
Employee share$2,220Other part of the same cost
DD amount$9,180Combined reported coverage cost

The illustration assumes those are the administrator’s reportable components; it does not price a policy or decide which benefits must be included. HSA contributions belong under a different reporting rule, not automatically inside DD. Ask the administrator about coverage changes, employer contributions or included benefit types before expecting a simple deduction total to match.

Our employer-paid benefits guide gives further context for distinguishing a benefit’s cost from cash earnings and employee deductions.

W can include employee salary-reduction contributions

IRS Publication 969 treats employee HSA salary reductions through a cafeteria plan as employer contributions for this reporting purpose. Consequently, code W can include both company-funded money and the employee’s qualifying payroll funding. Its label should not be read as “company money only.”

Assume an eligible fictional employee receives $900 of employer HSA funding and contributes $1,500 through the employer’s cafeteria plan during the same year. Both are valid contributions within the applicable limit, with no prior-year allocation or correction. Their code W total is $2,400.

A fictional eligible employee has 900 dollars of employer HSA funding and 1500 dollars of salary-reduction funding through a cafeteria plan. These total 2400 dollars under code W. A separate 350 dollar personal contribution is not included in that W-2 amount.
The $1,500 salary-reduction amount is already part of W. Treating the whole $2,400 as a new personal deduction would count the same funding incorrectly.

Now assume the employee separately contributes $350 directly to the HSA from a personal bank account for that same contribution year. That personal funding is outside this W-2’s $2,400 W amount. The source worksheet therefore tracks $2,750 of contributions across both routes, subject to the employee’s actual eligibility and limit.

Use the applicable Form 8889 instructions to classify and report those amounts. Do not claim an additional personal deduction for employer or cafeteria-plan funding already receiving the relevant exclusion. Check contribution-year designations as well: the timing of a deposit, the W-2 reporting year and the HSA contribution year can require reconciliation rather than a blind comparison.

Code W is not the account’s year-end balance. Investment changes, distributions, transfers and earlier savings can affect a balance without being new W-2 contributions. Compare like-for-like funding records before asking payroll or the HSA custodian to investigate a difference.

Check the actual year and source records before preparing a form

Review the employer, employee and tax year first. Then trace each code to annual payroll or benefit records. Preserve the separate code-and-amount pairs, and investigate any year-end adjustment rather than assuming the final ordinary paycheck contains every annual reporting entry.

If the issuer’s W-2 appears wrong, request an explanation and an employer correction where appropriate. A privately edited replacement does not correct the issuer’s report. Our former-employer W-2 guide covers obtaining the issued record, and the deduction guide explains related paycheck labels.

As checked on November 16, 2026, the Check Stubs Online W-2 builder currently offers tax year 2025, with actual payroll-total entry and up to four Box 12 entries. This article’s current 2026 explanation does not mean the builder offers a 2026 form. Select the correct supported year and review its linked year-specific IRS instructions.

Use actual authorized annual records and inspect the completed preview. The PDF preparation tool is not government filing, does not verify contribution eligibility and does not replace an employer’s correction process. Do not change a form’s year or invent a code to fit an unsupported entry.

Box 12 questions

Should I add every Box 12 amount to wages?

No. Codes describe different items with different treatment. Adding the whole box can count an informational cost or an already-reported amount incorrectly.

Why is W larger than my employer’s HSA contribution?

It can include your salary reductions through the employer’s cafeteria plan. Compare both funding sources and the contribution-year details.

Does DD show the amount I paid for health insurance?

Generally it reports combined reportable coverage cost, rather than only your deductions. Use the administrator’s cost detail to reconcile it.

Is 12a the same as code A?

No. The slot and the entered code are separate. Read the actual code printed next to the amount.

The Check Stubs Online Editorial Team checked the current primary guidance and live builder, and independently reconciled the fictional retirement, coverage-cost and HSA examples.