Code W on your W-2 is the entry in Box 12 that reports the total amount contributed to your Health Savings Account through your employer’s payroll during the year. It combines two things: the money your employer deposited on your behalf, and the pre-tax dollars you elected to have withheld from your paycheck through a cafeteria plan.1Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026) You will need that number to complete Form 8889 when you file your return.
Where to Find Code W on Your W-2
Box 12 holds up to four letter-coded entries, each paired with a dollar amount. Look for the row labeled “W.” That figure is your employer’s official report to the IRS of the HSA money that flowed through payroll for the year.1Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026)
If you contributed through payroll but don’t see a Code W entry, something went wrong on your employer’s side. Contact HR or payroll before you file.
What the Code W Amount Represents
The Code W dollar figure is the sum of your employer’s direct HSA contributions and your own pre-tax payroll contributions made through a cafeteria plan.1Internal Revenue Service. General Instructions for Forms W-2 and W-3 (2026) Both flavors bypass federal income tax, Social Security tax, and Medicare tax. That triple exclusion is why payroll contributions are the most tax-efficient way to fund an HSA.
Because these amounts were never included in your taxable wages, they don’t show up in Box 1. The Code W figure is informational, but it drives the calculations on Form 8889 and determines how much room you have left under the annual limit.2Internal Revenue Service. Instructions for Form 8889 (2025)
What Code W Does Not Include
Code W captures only what ran through your employer’s payroll system. Several other kinds of HSA activity stay off the W-2, and confusing them with Code W is one of the most common filing mistakes.
Direct After-Tax Contributions
Money you moved from a personal bank account to your HSA custodian is not on your W-2. Those deposits were made with after-tax dollars, and you claim the deduction yourself on Form 8889, Line 2.2Internal Revenue Service. Instructions for Form 8889 (2025) The deduction is available whether or not you itemize.3Internal Revenue Service. Publication 969 (2025), Health Savings Accounts and Other Tax-Favored Health Plans Keep records so you can add these amounts to Code W and confirm you haven’t blown through the annual cap.
Rollovers and Transfers Between HSAs
Moving money from one HSA to another, either through a 60-day rollover or a direct trustee-to-trustee transfer, doesn’t count as a contribution. It won’t appear in Code W, and you don’t report it as a contribution on Form 8889.3Internal Revenue Service. Publication 969 (2025), Health Savings Accounts and Other Tax-Favored Health Plans
Checking Code W Against the Annual Limit
For 2026, the HSA contribution limits are $4,400 for self-only HDHP coverage and $8,750 for family coverage. If you are 55 or older, you can add a $1,000 catch-up contribution.4Internal Revenue Service. Revenue Procedure 2025-195Office of the Law Revision Counsel. 26 USC 223 – Health Savings Accounts These caps apply to all contributions combined. Your Code W amount plus any direct after-tax deposits you made must fit under that ceiling.
If you were only HSA-eligible for part of the year (because you changed plans, enrolled in Medicare, or picked up coverage mid-year), your limit is prorated based on the months you were eligible on the first day of each month.5Office of the Law Revision Counsel. 26 USC 223 – Health Savings Accounts Form 8889 walks you through that calculation.
How to Use Code W on Form 8889
You must file Form 8889 in any year you had HSA contributions or distributions, even if every dollar came through payroll and is already sitting in Code W.6Internal Revenue Service. Instructions for Form 8889 (2025) Skipping the form is a common trigger for IRS notices.
The Code W amount from your W-2 goes on Line 9. Direct after-tax contributions go on Line 2. The form then compares your total contributions against your allowable limit based on coverage type, months of eligibility, and catch-up status.2Internal Revenue Service. Instructions for Form 8889 (2025) Any deductible amount for your direct contributions flows from Line 13 to Schedule 1 of Form 1040 as an above-the-line deduction. If your combined contributions overshot the cap, the form routes you to the excess-contribution calculation.
If both you and your spouse have HSAs, each of you files a separate Form 8889. The resulting deductions are combined on your joint return.2Internal Revenue Service. Instructions for Form 8889 (2025)
Confirming the Number With Form 5498-SA
Your HSA custodian files Form 5498-SA with the IRS and sends you a copy showing total contributions to your account. It usually arrives by late May, after most people have already filed. Box 2 reports total contributions made during the calendar year, and Box 3 reports contributions made in the following year that were designated for the prior tax year.7Internal Revenue Service. Instructions for Forms 1099-SA and 5498-SA Check it against your Code W plus your direct contributions when it shows up. If the totals don’t reconcile, you may need to amend your return.
If Code W Looks Wrong
Employers sometimes report the wrong Code W amount because a contribution posted in the wrong pay period, a mid-year plan change didn’t carry through payroll, or someone typed the wrong number. Compare the figure against your final pay stub of the year and your own records of any employer match. If it doesn’t add up, contact HR or payroll.
Your employer corrects the error by issuing Form W-2c, the corrected wage statement, filing it with the Social Security Administration and giving you a copy.8Internal Revenue Service. About Form W-2c, Corrected Wage and Tax Statements If you already filed using the wrong number, amend your return with Form 1040-X after the W-2c arrives. An incorrect Code W can cascade into phantom excess contributions, a missed deduction, or a misstated contribution limit, so it is worth fixing promptly.
If Code W Plus Your Contributions Exceeded the Limit
Contributions over the annual limit trigger a 6% excise tax on the excess, and the tax repeats every year the excess remains in the account.9Office of the Law Revision Counsel. 26 USC 4973 – Tax on Excess Contributions The cleanest fix is to withdraw the excess plus any earnings on it before your tax filing deadline, including extensions. Do that and the IRS treats the contribution as though it never happened; you avoid the 6% tax. The earnings that come out with the excess are reported as “Other income” on the return for the year you take the withdrawal.3Internal Revenue Service. Publication 969 (2025), Health Savings Accounts and Other Tax-Favored Health Plans
If you miss the regular deadline but catch the problem within six months after the unextended due date, you can still remove the excess and file an amended return.6Internal Revenue Service. Instructions for Form 8889 (2025) Leaving the excess in the account lets you apply it toward next year’s limit, but the 6% tax keeps hitting until it is absorbed or withdrawn.