Financial Planning for H1B and Work Visa Tech Employees
Hundreds of thousands of tech employees in the US are on H1B, L1, O1, or TN visas. The good news: you have full access to the same powerful retirement and tax tools as US citizens — 401(k), Roth IRA, Mega Backdoor Roth, HSA. The bad news: there are several traps that the standard "software engineer financial planning" guides don't cover, and getting them wrong can cost you hundreds of thousands of dollars in lost benefits or unnecessary taxes.
This guide covers what's different — the decisions that hinge on your immigration status — not the basics that apply to all tech workers (those are covered in our retirement planning guide and Mega Backdoor Roth guide).
Step 1: Know your tax residency status
Before anything else, you need to know whether the IRS treats you as a resident alien or a nonresident alien for federal income tax purposes. These are very different categories:
| Status | How you're taxed | Retirement account access |
|---|---|---|
| Resident alien | Same as US citizens — worldwide income, ordinary tax brackets, all deductions | Full: 401(k), IRA, Roth IRA, HSA, MBR |
| Nonresident alien | Only US-source income; special withholding rules; limited deductions | Restricted: 401(k) yes; traditional IRA may qualify; Roth IRA generally no |
Most H1B, L1, and O1 holders who have been in the US for more than a few months are resident aliens — they pass the Substantial Presence Test. Under the SPT, you're a resident alien for tax purposes if you've been present in the US for at least 183 days during the 3-year lookback period (counting 100% of current-year days, 1/3 of prior-year days, and 1/6 of the year before that).1 Someone on H1B who arrived mid-year or later may be a nonresident alien for their first partial year; by year two they're almost certainly a resident alien.
For the rest of this guide, we'll assume you've been in the US long enough to be a resident alien — the situation for the vast majority of established tech workers on work visas.
Retirement accounts: what you can access
As a resident alien, your access to tax-advantaged retirement accounts is identical to a US citizen's. Here's what's available and the 2026 limits:2
| Account | 2026 limit (under 50) | Catch-up (50+) | Notes |
|---|---|---|---|
| 401(k) employee deferrals | $24,500 | $8,000 ($11,250 at 60–63) | Same as US citizens |
| 401(k) total (415(c) limit) | $72,000 | — | Enables Mega Backdoor Roth |
| Traditional IRA | $7,500 | $1,000 | Deductible if no workplace plan, or below MAGI threshold |
| Roth IRA | $7,500 | $1,000 | Phase-out: $153K–$168K single; $242K–$252K MFJ |
| Backdoor Roth IRA | $7,500 | $1,000 | No income limit; available to resident aliens |
| HSA (self-only HDHP) | $4,400 | $1,000 at 55 | Must be on qualifying HDHP plan |
If your 401(k) plan allows after-tax contributions with in-service withdrawals, you can also do the Mega Backdoor Roth — converting after-tax contributions to Roth inside your 401(k). This is available to you on any visa as long as your employer's plan supports it. Your visa status doesn't affect plan eligibility.
The PFIC trap: your foreign investment accounts
This is the most dangerous and least-discussed financial risk for H1B workers, and it applies the moment you become a US tax resident.
If you hold foreign mutual funds, ETFs, or pooled investment vehicles registered outside the US — including funds in Indian brokerage accounts, Chinese investment platforms, UK ISAs, or any non-US investment vehicle — the IRS classifies these as Passive Foreign Investment Companies (PFICs).3 PFIC taxation is deliberately punitive:
- Default PFIC tax: "Excess distributions" (growth beyond 125% of the prior 3-year average) are taxed at the highest ordinary income rate (37%), plus interest charges retroactively applied as if you earned the income in prior years. Capital gains treatment does not apply.
- Mark-to-market election: You can elect to mark the fund to market value each year and pay ordinary income tax annually on unrealized gains — avoiding the punitive default, but eliminating tax deferral entirely.
- QEF election: Qualified Electing Fund treatment requires annual financial statements from the fund itself — which foreign funds almost never provide to US investors.
Note that foreign individual stocks (buying shares of Infosys, TSMC, Alibaba on a foreign exchange) are generally not PFICs — the PFIC rule targets pooled investment vehicles, not individual equities. But most retail investors in India, China, or other countries hold mutual funds, not individual stocks, so the PFIC issue is real for the majority.
Social Security: who benefits and who doesn't
Every W-2 employee in the US — including H1B, L1, and O1 workers — pays 6.2% of wages into Social Security and 1.45% into Medicare. For a senior tech worker earning $350K, that's roughly $10,800/year into Social Security (SS tax is capped at the wage base, $176,100 in 2026).4
Whether you'll ever collect those benefits depends heavily on your home country:
Countries with US totalization agreements
The US has totalization agreements with 30 countries that allow workers to combine work credits from both countries to qualify for Social Security benefits.5 If you're from one of these countries, your US SS contributions are not lost when you return home — the credits count toward your home country's retirement system (and vice versa):
Countries with US totalization agreements (as of 2026): Australia, Austria, Belgium, Brazil, Canada, Chile, Czech Republic, Denmark, Finland, France, Germany, Greece, Hungary, Iceland, Ireland, Italy, Japan, Luxembourg, Netherlands, Norway, Poland, Portugal, Slovak Republic, Slovenia, South Korea, Spain, Sweden, Switzerland, United Kingdom, Uruguay.
Countries without US totalization agreements — the key risk
India, China, and the Philippines do not have totalization agreements with the US. These three countries account for the majority of H1B visa holders in tech. If you're from one of these countries and you leave the US before accumulating 40 SS credits (10 years of work), your Social Security contributions are effectively lost — you will not qualify for US retirement benefits, and there is no mechanism to transfer the credits to your home country's system.
The math: a senior engineer paying the SS maximum (~$10,800/year) who works 8 years in the US and returns to India has contributed roughly $86,400 to Social Security and will receive nothing in return. The $86,400 is not refundable.
What this means practically:
- If you're from India/China/Philippines and plan to return home within 10 years, treat Social Security as a sunk cost — not an asset. Don't include it in your retirement projections.
- If you're within a year or two of 40 credits and are planning to leave, think carefully about timing. Ten years of US work credits qualifies you for US Social Security retirement benefits payable internationally.
- If you're from a totalization agreement country (Japan, South Korea, Canada, UK, Germany, etc.), your contributions do get credited — the math is different.
RSU and equity vesting on a work visa
RSU vesting while you're a US resident alien on a work visa is taxed exactly like it is for citizens: the fair market value at vest is ordinary income, subject to full federal and state income tax, SS/Medicare, and the 22% supplemental withholding (which is often less than your actual marginal rate — see our RSU tax planning guide).
A few situations that are different for visa holders:
- RSU grants spanning countries: If you were granted RSUs while working for the same employer in another country, only the portion that vested while you worked in the US is US-taxable. The grant-to-vest allocation methodology (based on days worked in each country during the vesting period) reduces your US tax liability on globally sourced grants. This allocation must be correctly calculated — don't assume all of it is US income.
- Company layoff while on H1B: Your H1B status is tied to your employer. If you're laid off, you typically have a 60-day grace period to find a new sponsor, change status, or depart. Your unvested RSUs forfeit on termination. Review our layoff financial planning guide for the full checklist — but note that the grace period adds urgency to every financial decision.
- ISO exercise timing: ISOs can be exercised on a work visa. The AMT risk is the same as for any US taxpayer. But if you plan to leave the US before exercising, be aware that ISOs typically require you to exercise within 90 days of leaving employment (or they convert to NSOs) — and some companies have shorter windows.
When you leave the US: what happens to your accounts
This is where work-visa holders face the sharpest planning decisions. The actions you take before departing matter enormously.
401(k): roll to IRA before you leave
Your 401(k) balance doesn't disappear when your visa expires, but your options narrow significantly once you're a nonresident. Before leaving:
- Roll your 401(k) to an IRA while you still have a US address. Most IRA custodians (Vanguard, Fidelity, Schwab) require a US address to open an account. Once you leave, opening a new IRA becomes nearly impossible. Roll first, then leave.
- Choose the right IRA type. Traditional 401(k) → Traditional IRA rollover is tax-free. Roth 401(k) → Roth IRA is also tax-free. Don't mix them unless you understand the pro-rata rule implications.
- Keep the US IRA after you leave. You can maintain an existing IRA as a nonresident. You just can't make new contributions if you have no US earned income.
Withholding on withdrawals as a nonresident
Once you're a nonresident alien, the US withholds 30% on IRA distributions before sending you the money (or the tax-treaty rate with your country, if lower).6 You must file a W-8BEN with your IRA custodian to claim treaty benefits. Common treaty rates:
| Country | Default withholding | Treaty rate (IRA distributions) |
|---|---|---|
| India | 30% | 15% (Article 20, US-India tax treaty) |
| China | 30% | 10% (Article 17, US-China treaty) |
| UK | 30% | 0% on pensions / 15% on lump sums |
| Canada | 30% | 15% (25% on lump sums) |
| Germany | 30% | 15% |
| No treaty | 30% | 30% |
Withholding is not the same as your final tax liability — you may file a US nonresident return (Form 1040-NR) to claim a refund if the treaty rate is lower than what was withheld. But the 10% early withdrawal penalty applies regardless of treaty status if you're under 59½.
Green card timing: financial moves to make beforehand
Becoming a Lawful Permanent Resident (LPR) generally doesn't create an adverse tax event by itself — you were already taxed as a resident alien on your work visa. But the transition to LPR status does change your long-term planning horizon in meaningful ways:
- US tax exposure becomes more permanent. As an LPR, your worldwide income is subject to US tax. If you had any lingering foreign income sources you thought might stay separate, they now clearly aren't.
- Roth conversions before becoming LPR can be advantageous if your income drops (sabbatical, job change). Once you're an LPR, you'll likely stay in the US long enough that converting to Roth while in a temporarily lower bracket creates decades of tax-free compounding.
- Resolve all PFIC holdings before or at the transition. Being an LPR while holding unresolved PFIC positions creates ongoing filing complexity (Form 8621 each year).
- Estate planning implications change. Non-citizen spouses don't get the unlimited marital deduction — assets passing to a non-citizen spouse above the annual exclusion ($185,000 for non-citizen spouses in 2026) may be subject to estate tax. A Qualified Domestic Trust (QDOT) can defer this, but requires planning in advance.
Practical checklist for H1B tech workers
| Action | When |
|---|---|
| Confirm your tax residency status (SPT calculation) | First year in the US |
| Sell or restructure all foreign mutual fund positions (PFIC cleanup) | Before or at your first US tax filing as resident |
| Max 401(k) deferrals and employer match | Every year |
| Do the Backdoor Roth IRA if your income exceeds Roth limits | Every year |
| Check if your employer plan allows Mega Backdoor Roth | Once, then annually |
| Track Social Security credits — know your 40-credit milestone | Annually (check SSA.gov statement) |
| Roll 401(k) to IRA at a US-address custodian before any departure | Before leaving the US |
| File W-8BEN with IRA custodian to claim treaty withholding rate | Before first withdrawal as nonresident |
| Resolve QDOT planning if married to non-citizen spouse | Before estate documents are finalized |
Related guides
Sources
- IRS: Taxation of alien individuals by immigration status — H-1B — Substantial Presence Test mechanics; resident vs. nonresident alien determination for H-1B holders; withholding rules
- IRS newsroom: 401(k) limit increases to $24,500 for 2026, IRA limit increases to $7,500 — 2026 employee deferral $24,500; 415(c) total limit $72,000; IRA limit $7,500; Roth IRA phase-out $153K–$168K single, $242K–$252K MFJ; super catch-up $11,250 at ages 60–63
- IRS Form 8621 Instructions: Information Return by a Shareholder of a Passive Foreign Investment Company — PFIC definition, excess distribution regime, mark-to-market election, QEF election, and annual filing requirements
- IRS Topic 751: Social Security and Medicare Withholding Rates — 6.2% SS / 1.45% Medicare for all W-2 employees including nonimmigrants on H-1B, L-1, O-1 visas; 2026 SS wage base $176,100
- SSA: US International Social Security Agreements (Totalization Agreements) — list of 30 countries with active agreements; India, China, and the Philippines are not on the list as of 2026
- IRS Publication 519: US Tax Guide for Aliens — 30% default withholding on US-source income for nonresident aliens; W-8BEN treaty claim procedures; Form 1040-NR filing rules
Contribution limits verified against IRS newsroom announcement (November 2025). Social Security totalization agreement status verified against SSA.gov (2026). PFIC rules verified against IRS Form 8621 instructions (current). Values current as of May 2026.
Work visa financial planning has edge cases that generic advisors miss
PFIC cleanup, Social Security credit tracking, pre-departure 401(k) rollovers, treaty withholding rates, and RSU grant sourcing across countries — these are not questions most financial advisors have ever thought about. A fee-only advisor who works with H1B and visa-holder tech employees can help you build a plan that accounts for the realistic scenarios: staying long-term, eventually getting a green card, or potentially returning home with a substantial US retirement nest egg.