Code W in Box 12 of your W-2 is the total amount of Health Savings Account contributions that ran through your employer’s payroll during the year. That figure combines two things in one number: what your employer put into your HSA on your behalf, and what you contributed from your own paycheck on a pre-tax basis through a cafeteria (Section 125) plan.1Internal Revenue Service. General Instructions for Forms W-2 and W-3 You do not claim a separate deduction for it, because the tax break is already built into your lower Box 1 wages, but you do have to report the amount on Form 8889 when you file.
What the Code W Number Actually Includes
Employers are required to lump both sources of payroll HSA money into a single Code W figure. Your W-2 will not break out how much came from the employer versus how much came from your own pre-tax paycheck deductions. If you need that split, look at your final pay stub of the year or ask your benefits department for a breakdown.
What Code W does not include is any money you deposited directly into your HSA from a personal bank account. Those after-tax contributions never touched payroll, so they never show up on the W-2. You have to track them yourself and add them in separately when you do your return.
How Code W Already Affects Your Taxes
Contributions reported under Code W have already been excluded from the taxable wages in Box 1, so no federal income tax was withheld on them. In most employer plans they are also excluded from Social Security wages in Box 3 and Medicare wages in Box 5, which saves you another 7.65% in payroll taxes that a direct contribution to your HSA would not.2Office of the Law Revision Counsel. 26 USC 223 – Health Savings Accounts
Because the benefit is baked in at the payroll stage, you do not take a second deduction for the Code W amount on your return. Trying to deduct it again would double-count the same dollars. Direct contributions work in reverse: they go in with after-tax money, and you claim the deduction later on Form 8889.
How Code W Counts Toward the Annual HSA Limit
The IRS caps total HSA contributions from all sources combined, and the Code W amount counts toward that cap. For 2026, the limits are:
- $4,400 for self-only HDHP coverage
- $8,750 for family HDHP coverage
- An additional $1,000 catch-up if you are 55 or older by December 31
These caps apply to the combined total of employer contributions, your pre-tax payroll deductions (all inside Code W), and any direct deposits you made on your own.3Internal Revenue Service. Revenue Procedure 2025-19 The IRS does not care where the money came from. A dollar over the limit is an excess contribution whether the source was your employer, your paycheck, or your checking account.
To see whether you are within the limit, take the Code W number and add any direct contributions you made from personal funds. You have until the tax filing deadline, typically April 15 of the following year, to make direct contributions that count toward the prior tax year.4Internal Revenue Service. Publication 969 – Health Savings Accounts and Other Tax-Favored Accounts
The catch-up amount is per person, not per family. If you and your spouse are both 55 or older and both covered by a family HDHP, each of you can add $1,000, but the extra amounts have to go into separate HSAs in each spouse’s own name.5Fidelity. HSA Contribution Limits and Eligibility Rules for 2025 and 2026
Reporting Code W on Form 8889
If you had an HSA at any point during the year, you have to file Form 8889 with your return, even if the only contributions were the ones in Code W and you have nothing extra to deduct.
The Code W figure goes on Line 9 of Form 8889. The instructions are explicit: enter employer contributions, including your pre-tax payroll deductions, as shown in Box 12 with Code W on your W-2.6Internal Revenue Service. 2025 Instructions for Form 8889 Line 2 is reserved for after-tax contributions you made directly. The form then compares your total contributions against the annual limit for your coverage type and months of eligibility and calculates any deduction you are entitled to.
Any deduction that comes out of Form 8889 flows to Schedule 1 (Form 1040), Part II, line 13.6Internal Revenue Service. 2025 Instructions for Form 8889 It is an above-the-line deduction, so it lowers your adjusted gross income whether or not you itemize. If all your HSA contributions came through payroll and you were within the limit, you will have nothing to enter on Line 2 and no separate deduction; you are just documenting the activity.
What to Do If the Code W Amount Looks Wrong
Errors in Code W happen more often than you would expect, usually because a payroll system lumps health insurance premiums in with HSA contributions or mishandles a mid-year enrollment change. Compare the Code W amount against the year-end statement from your HSA custodian, which shows what was actually deposited.
If the numbers do not match, ask your payroll department to issue a corrected W-2 (Form W-2c). Bring the custodian’s statement with you. Employers generally want to fix these because an inaccurate W-2 can create audit exposure for the company, not just for you.
If your employer will not correct it before you need to file, report the actual contribution amounts on Form 8889. The IRS reconciles Form 8889 against the W-2, so keep the custodian’s statement and pay stubs showing the deductions in case the IRS asks for backup.
When Code W Puts You Over the Limit
If employer and pre-tax payroll contributions alone push you above the annual cap, the excess triggers a 6% excise tax, and that tax hits every year the excess stays in the account.7Office of the Law Revision Counsel. 26 USC 4973 – Tax on Excess Contributions to Certain Tax-Favored Accounts The recurring nature of the penalty makes catching it early worth the trouble.
To avoid the 6% tax, withdraw the excess and any earnings on it before the tax filing deadline, including extensions. When you pull the money out, the excess contribution itself is not deductible and gets included in your gross income for the year it was contributed. Any earnings on the excess must also come out and be reported as other income.
If you already filed without catching the overage, you can still take the withdrawal up to six months after the filing deadline (without extensions) and file an amended return. Write “Filed pursuant to section 301.9100-2” at the top of the amended return.8Internal Revenue Service. Instructions for Form 8889 The 6% excise tax itself is reported on Form 5329.9Internal Revenue Service. Form 5329 – Additional Taxes on Qualified Plans and Other Tax-Favored Accounts
When the excess is the employer’s fault, IRS guidance allows the employer to recover a mistaken contribution from the HSA custodian if there is clear documentary evidence of an administrative error and the correction happens while the tax year is still open. If the employer does not recover the funds by year-end, the over-contribution is treated as taxable income to you, and you follow the withdrawal process above.
A State Tax Exception to Know About
The federal treatment does not automatically carry over to your state return. California and New Jersey do not recognize HSA tax advantages at the state level. If you live in one of those states, your Code W contributions are still subject to state income tax, and investment earnings inside the account are taxable on your state return as well. Check your state’s rules before assuming the full federal benefit applies.