Reading Your W-2 as an H-1B Worker: Every Box Explained
Your W-2 is the foundation of your tax return. For H-1B workers with RSUs, ESPPs, 401(k) contributions, and HSA benefits, the W-2 contains critical information that directly affects your tax liability. Here is what every box means and what to watch for.
W-2 Overview: What Each Box Means for H-1B Filers
The W-2 form has multiple boxes, each reporting a different aspect of your compensation and withholding:
- Box 1 (Wages, tips, other compensation): Your total taxable compensation. This includes base salary, bonuses, RSU vesting income, ESPP disqualifying disposition income, relocation reimbursements, and imputed income. This number is almost always higher than your base salary.
- Box 2 (Federal income tax withheld): The total federal income tax your employer withheld during the year. This appears on Form 1040 as a tax payment.
- Box 3 (Social Security wages): Wages subject to Social Security tax, capped at $184,500 for TY2026. If you changed jobs mid-year, verify the combined Box 3 from all W-2s does not exceed this cap.
- Box 5 (Medicare wages): Wages subject to Medicare tax. Unlike Social Security, there is no wage cap. Box 5 is often close to Box 1 but may differ slightly.
- Boxes 15-20 (State and local): State wages, state tax withheld, and local tax information. Verify your state of residence is correctly listed, especially if you moved during the year.
Box 12 Decoded: RSU, ESPP, 401(k), and HSA Codes
Box 12 uses letter codes to report various types of compensation and benefits. The most relevant codes for H-1B tech workers:
Code D — 401(k) Elective Deferrals
Your pre-tax 401(k) contributions. This amount is excluded from Box 1 but included in Boxes 3 and 5. The 2026 limit is $24,500 ($32,500 if age 50+).
Code W — HSA Employer Contributions
Total HSA contributions (both employer and employee via payroll). This amount is excluded from Box 1. Report on Form 8889.
Code V — Nonstatutory Stock Option Exercise
Income from exercising nonqualified stock options (NSOs). The spread between exercise price and FMV is included in Box 1 as ordinary income and reported separately here.
Code DD — Health Insurance Cost
Total cost of employer-sponsored health coverage (employer + employee portions). This is informational only — it is not taxable and does not need to be reported on your return.
Code AA — Roth 401(k) Contributions
After-tax Roth 401(k) contributions. Unlike Code D, these are included in Box 1 (already taxed). They grow tax-free and qualified withdrawals are tax-free.
Box 14: State-Specific and Employer Custom Entries
Box 14 is a catch-all for employer-specific items. Common entries for H-1B workers include:
- State disability insurance (SDI/CASDI): California and a few other states require employee contributions.
- NY/NJ family leave insurance: Mandatory payroll deductions in these states.
- RSU vesting detail: Some employers break out RSU income separately in Box 14 for reference.
- Union dues, charitable contributions: If your employer facilitates these through payroll.
Box 14 entries are generally informational. They do not directly appear on Form 1040 but may be needed for state returns.
Common W-2 Errors H-1B Workers Should Watch For
- RSU income allocation errors: If you transferred between offices or changed visa status mid-year, verify that RSU vesting income is properly allocated to the correct state.
- Missing state W-2: If you worked in multiple states, you should receive state-level W-2 information for each state. A missing state can cause underpayment on your state return.
- Incorrect SSN: Verify your Social Security number is correct. An error delays IRS processing and can affect Social Security benefit calculations.
- Name mismatch: Your W-2 name must match your SSA records. If your legal name changed (e.g., after marriage), update it with SSA before filing.
Multiple W-2s: Job Changes and Mid-Year H-1B Transfers
If you changed employers during the year, you will receive a W-2 from each employer. Key considerations:
- Social Security wage cap: Each employer withholds Social Security tax independently. If your combined Box 3 wages exceed $184,500, you overpaid Social Security tax. Claim the excess on Form 1040 Line 24d (excess Social Security tax withheld).
- 401(k) contribution limit: The combined Code D from all W-2s must not exceed $24,500. If you over-contributed, contact the plan administrator to withdraw the excess before April 15 to avoid double taxation.
- RSU vestings during transition: RSUs that vested between your departure and your new job start date should appear on your former employer's W-2. Verify the cost basis matches the vesting date FMV.
IRS source: About Form W-2, Wage and Tax Statement
Frequently Asked Questions
Skip the complexity. We handle all of this for you.
H1B TaxFile supports every form in this guide — FATCA, PFIC, FTC, RSU basis correction, and 22 more H-1B-specific features. Flat price, no surprises.
H1B TaxFile Team
Written by the H1B TaxFile editorial team — tax professionals and software engineers who specialize in U.S. federal tax filing for H-1B visa holders, F-1 students, and nonresident aliens.
Reviewed by a licensed CPA with international tax experience.
Disclaimer: This guide is for educational purposes only and does not constitute tax or legal advice. Tax laws are complex and change frequently. Consult a qualified tax professional for advice specific to your situation.