
The visa ends. The job ends. You list the apartment. You book the flights. And somewhere in the last few weeks before the move, you need to make a decision about the 401(k) and the vested stock. In most cases, the decisions are taken in a rushed manner. It's usually the wrong decision, made under time pressure. And it usually costs more than it needed to.
This is written for the specific stage a lot of Indians on H-1B are hitting right now: leaving the US after years of building up a 401(k), ESPP shares, and sometimes RSUs, and needing to know what actually happens to that money, and to their US filing obligations, once they're back in India.
The 401(k): Your Options Aren't Just "Cash Out or Leave It"
Most people leaving on an H-1B assume there are two choices: withdraw the money or let it sit. There's a third, and it usually matters more than either.
Cashing it out. If you're under 59½, a lump-sum withdrawal triggers a mandatory 20% federal withholding at the time of payout, plus a 10% early withdrawal penalty, on top of the regular income tax the distribution adds to your final US return. Between withholding, penalty, and tax, it's common to lose a third or more of the balance before any of it reaches an Indian bank account.
Leaving it in the US. You can generally keep the 401(k) with your former employer's plan and let it keep growing tax-deferred. This works, but it means staying in touch with a US-based account, a US mailing address requirement some administrators enforce, and eventually dealing with required minimum distributions once you hit the applicable age.
Taking periodic payments under the tax treaty. This is the option almost nobody uses because almost nobody knows about it. Article 20 of the India-US tax treaty says private pensions, which includes structured periodic 401(k) payments, are generally taxable only in your country of residence. Once you're genuinely a non-resident alien for US tax purposes (on H-1B without a green card, having fully cut US tax residency), periodic monthly or annual payments can avoid the standard 30% non-resident withholding that otherwise applies to 401(k) distributions. The catch: this only works for periodic payments. A lump-sum withdrawal is treated as "other income" under a different part of the treaty and doesn't get this protection, so both countries can tax it.
Real scenario: An engineer leaves after eight years on H-1B, no green card, with $180,000 in a 401(k). He cashes it out before flying home, assuming it's the cleanest option. Between the 20% withholding, the 10% penalty, and the additional tax owed at filing, roughly $65,000 of that balance never makes it to India. A structured periodic withdrawal under Article 20, spread over several years once he's a confirmed non-resident, would have avoided both the penalty and most of the withholding.
ESPP and RSUs Don't Just Stop When You Leave
Vested ESPP shares and RSUs are yours. They don't evaporate because you've left the country, but what happens next depends on the type of equity and the timing.
Vested shares already in your account stay yours and can generally be sold or transferred to a brokerage that accepts non-resident clients, though plenty of US brokerages close accounts once they learn the holder has moved abroad, so plan for this before departure, not after.
Unvested RSUs typically continue vesting on schedule if your plan allows it, but many employer plans accelerate, forfeit, or freeze unvested grants on termination of employment, and this is entirely plan-specific. Check your grant agreement, not general assumptions.
The compensation portion tied to US employment stays US-source income. Even after you've left, RSU vesting or ESPP disposition income that relates to work performed in the US while you were still employed here generally remains taxable by the US, sourced to the days you actually worked in the country during the vesting period. The appreciation that happens after that point is treated differently, and for a genuine non-resident, often isn't subject to US tax the same way.
This sourcing distinction is exactly the kind of detail that trips up a return prepared without cross-border experience, because it requires splitting one number, the total gain on sale, into a US-source piece and a non-US-source piece based on where you were actually working when the equity vested.
Your Filing Obligation Doesn't End When Your Visa Does
This is the part that surprises people most. If you were on H-1B only, no green card, and you've genuinely cut US tax residency, your ongoing US filing obligation as a resident does end, though your departure-year return is more complicated than a normal one. It's typically a dual-status return, part of the year filed as a resident and part as a non-resident, and dual-status years lose access to some of the simplifications a full-year return gets, including the standard deduction in most cases.
If you hold a green card, none of this applies the same way. A green card doesn't expire on your tax obligations just because you've physically relocated. US tax residency for a lawful permanent resident continues until the status is formally given up, through Form I-407 or the expatriation process, not simply by moving away or letting the card lapse unused. People carry this obligation for years without realizing it, still owing US returns, FBAR filings, and FATCA disclosures on a green card they assumed became irrelevant the moment they left.
If you've held a green card for at least 8 of the last 15 years and formally give it up, you become what the IRS calls a long-term resident, and you may be treated as a "covered expatriate" subject to exit tax if you meet any one of three tests: worldwide net worth of $2 million or more, average annual US tax liability above $211,000 over the prior five years (the 2026 threshold), or failure to certify five years of tax compliance on Form 8854. A covered expatriate is treated as having sold most worldwide assets the day before expatriating, with gains above a $910,000 exclusion for 2026 taxed immediately, retirement accounts included under their own special rules.
What Gets Missed Most Often in the Final US Return
- Treating the final year like any other year, instead of the dual-status return it often needs to be.
- Cashing out the 401(k) reflexively without checking whether periodic payments under Article 20 would have avoided the withholding and penalty entirely.
- Assuming the green card question is settled by geography. It isn't. It's settled by a form.
- Not tracking the cost basis and vesting history on RSUs and ESPP shares before leaving, which becomes much harder to reconstruct from India a few years later.
- Not checking prior filings for consistency before the final return goes in.
A large final-year distribution combined with equity income can also push you into a higher US tax bracket than expected in that one year, which is worth modeling before, not after, the withdrawal happens.
Conclusion
Leaving the US on an H-1B doesn't automatically settle what happens to a 401(k), vested equity, or your filing status. The 401(k) has a treaty-protected option most people never use. RSUs and ESPP shares carry a sourcing split that depends on where you actually worked, not where you live now. And a green card, if you have one, keeps you inside the US tax system until you formally exit it, not until you've simply moved on.
At GoalSeek, we prepare departure-year and dual-status returns for NRIs coming off H-1B, including 401(k) treaty planning, RSU and ESPP sourcing, and the exit tax analysis that green card holders need before assuming a move back to India settles the question on its own.
FAQs
What's the tax cost of cashing out a 401(k) before age 59½ when leaving the US? A lump-sum cash-out triggers mandatory 20% federal withholding at payout, plus a 10% early withdrawal penalty, on top of ordinary income tax owed at filing. Combined, this commonly consumes a third or more of the balance.
Does a green card holder still need to file US taxes after moving to India? Yes. US tax residency for a green card holder continues until the status is formally relinquished through Form I-407 or the expatriation process.
What triggers the exit tax for a green card holder giving up long-term residency? Anyone who held a green card for at least 8 of the last 15 years and meets one of three 2026 thresholds: worldwide net worth of $2 million or more, average annual US tax liability above $211,000 over the prior five years, or failure to certify five years of tax compliance on Form 8854.



