Should You Put Money in a 401(k) on OPT or H-1B If You Might Leave? Match, Roth vs Pre-Tax, Exit Math

Leaving before you vest, or cashing out at 30% plus 10%, can make a 401(k) cost you money. Here is the math that decides it on OPT or H-1B.

By F1Jobs Team · 2026-11-01 · 12 min read
A sunlit tech office break room at noon with a coffee machine, a bowl of fruit on the counter and a benefits enrollment folder on a round table

Part of our guide to US taxes on F-1, OPT and H-1B.

Should you contribute to a 401(k) on H-1B or OPT if you might leave the US? For most people the strongest case is the employer match, but only if you stay long enough for that match to vest. As of November 1, 2026, the 2026 deferral limit is $24,500 (in effect), the 2027 limit is not published, and a nonresident who cashes out before age 59½ generally faces 30% withholding (or a treaty rate) plus a 10% additional tax. That exit cost is what makes your math different from a US citizen's.

Status line, as of 2026-11-01: the 2026 limits are in effect. The IRS has not published 2027 limits; last year it announced them on November 13, so treat any 2027 figure you see before then as a projection.

Should I contribute to a 401(k) on H-1B or OPT? The short answer

For most OPT and H-1B workers, contributing enough to get the employer match pays off, but only if the match vests before you leave. By our arithmetic at a 24% bracket, a vested match worth more than about 27 cents per dollar you put in beats taking the money as salary, even if you later cash out at 30% plus the 10% additional tax. Above the match, your exit plan decides.

So the decision comes down to three questions, in this order:

  1. Will the match vest before you are likely to leave this employer? If not, the match is a number on a statement, not your money.
  2. What is your tax rate today versus at exit? Pre-tax saves tax now and charges it later. Roth does the reverse.
  3. What will you do with the account if you leave the US? Cashing out, rolling over and staying invested produce very different results.

Cash comes before all three. A 401(k) is a poor emergency fund, so work out how large a cash cushion your visa situation calls for before you push contributions above the match.

401(k) rules and numbers for visa holders, as of 2026-11

401(k) limits and exit rules for OPT, STEM OPT and H-1B workers, as of 2026-11-01. Check the live IRS pages in Sources before you act.

ItemValueStatus
2026 elective deferral limit (pre-tax and Roth combined)$24,500In effect
Catch-up, age 50+ / ages 60 to 63$8,000 / $11,250In effect
2027 deferral limitNot published by the IRSNot published
Early distribution before 59½10% additional tax on the taxable part, unless an exception appliesIn effect
Rollover to another plan or an IRANot subject to the 10% additional taxIn effect
Withholding on a distribution paid to a nonresident alienGenerally 30%, or a treaty rate (not the 20% US-person rule)In effect
Your own deferralsAlways 100% vestedIn effect
Roth treatment of the employer matchOnly if your plan offers it (SECURE 2.0 section 604) and the match is fully vested when madePlan option
Where the 24% bracket starts in 2026 (single)Taxable income over $105,700In effect
Social Security totalization agreement with India or ChinaNo agreement with either (31 agreements in total)Current SSA list

Sources: IRS IR-2025-111, IRS Topic no. 558, IRS Publication 519 ("Withholding on Pensions"), IRS Notice 2024-2, Rev. Proc. 2025-32 and SSA's totalization agreement list.

Can OPT workers join a 401(k)?

Yes, if the plan's eligibility rules cover you. We found no F-1, OPT, STEM OPT or H-1B rule that limits 401(k) participation; the plan document, not your visa, sets who is eligible and when. Some plans enroll you on day one and others make you wait, so read the eligibility section of your Summary Plan Description.

Two OPT details matter. If you are a nonresident student, your OPT and STEM OPT wages are exempt from Social Security and Medicare tax (IRC 3121(b)(19)); the IRS page on foreign student FICA liability lists "Practical Training student employment on or off campus" as exempt work. That exemption ends when you change to H-1B or become a resident alien, which shrinks take-home pay but does not touch the 401(k).

Your tax residency also moves the "tax now" side of the math. Most F-1 students are nonresidents for their first five calendar years, and many H-1B workers become residents under the substantial presence test. Residency decides which return you file and which deductions you get, and so your marginal rate.

How vesting decides whether the match is really yours

Your own contributions are never at risk. On its vesting page, the IRS says elective deferrals "are always 100% vested, or owned, by the employee." Employer money vests on a schedule the plan chooses. The IRS gives these two examples, and some plans vest the match immediately.

Years of service3-year cliff6-year graded
10%0%
20%20%
3100%40%
4100%60%
5100%80%
6100%100%

A year of service is defined by the plan, "generally 1,000 hours worked over 12 months," according to the same IRS page.

What do I lose if I leave before vesting?

You lose the unvested share of employer money. The IRS puts it plainly: "Amounts that are not vested may be forfeited by employees when they are paid their account balance." Vesting counts service with the employer, not visa type, so moving from STEM OPT to H-1B at the same company does not restart the clock (our reading; your plan's service rules govern). An H-1B transfer to a new employer does: the new plan has its own schedule, and the old plan's unvested match is generally forfeited under that plan's rules.

If you also hold equity, check both calendars, because RSU and 401(k) cliffs rarely line up. Our guide to RSUs and stock options for visa holders covers the equity side.

Worked timeline: an OPT hire in July 2026

A hypothetical with real dates: you start a job on post-completion OPT on 2026-07-01 and join the plan on day one. The same employer supports your 24-month STEM OPT extension, which starts 2026-09-01, so your STEM OPT EAD ends 2028-08-31.

DateEventVested match, 3-year cliffVested match, 6-year graded
2026-07-01Start work on OPT, enroll in plan0%0%
March 2027 (expected only)FY2028 H-1B registration; USCIS has not announced dates and must give 30 days' notice0%0%
2027-10-01Earliest H-1B start if selected and approved0%0%
2028-07-012 years of service0%20%
2028-08-31STEM OPT EAD ends if no H-1B0%20%
2029-07-013 years of service100%40%

If the H-1B never comes through and you leave at the end of STEM OPT, a 3-year cliff hands you none of the match, and your contribution choice becomes purely a tax decision. If you are selected and stay, the same match fully vests ten months after your STEM OPT would have ended.

The exit math: what $10,000 of pay becomes

This is our arithmetic, not an IRS example. Assumptions: a 24% federal bracket today (2026 single taxable income above $105,700), no state tax, no investment growth, no treaty benefit, and 2026 rates standing in for the year the money comes out.

What a cash-out costs depends on how it is finally taxed. The plan generally withholds 30%, but IRS Publication 519 says distributions attributable to US work, received as a nonresident, "are effectively connected income to the extent attributable to contributions." Effectively connected income is taxed at graduated rates on Form 1040-NR, and the 30% withheld counts toward that bill (our reading). So the table shows a high-cost case and a low-cost case.

What you do with $10,000 of gross payFederal tax nowCost when it comes outWhat you keep
Take it as salary$2,400$0$7,600
Pre-tax, cash out before 59½ as a nonresident, 30% as the final tax (high-cost case)$0$3,000 + $1,000 (10% additional tax)$6,000
Pre-tax, cash out before 59½ as a nonresident, graduated rates, no other US income that year (low-cost case)$0$1,000 (10% bracket) + $1,000 (10% additional tax)$8,000
Pre-tax, roll over, withdraw after 59½ as a nonresident, 30% as the final tax$0$3,000$7,000
Roth 401(k) ($7,600 after tax), withdraw contributions after leaving$2,400$0 on contributions$7,600

In the high-cost case an early cash-out leaves you $1,600 worse off than salary. In the low-cost case you end up $400 ahead, because the 2026 10% bracket runs to $12,400 of taxable income. A cash-out in a year when you also earned US pay taxed at 24% costs $2,400 plus $1,000, leaving $6,600. The Roth row matches salary because you paid the 24% up front.

The break-even match (our arithmetic). Vested match dollars are pre-tax money, so in the high-cost case each one keeps 60 cents. You need about $2,667 of vested match on that $10,000 (roughly 27 cents per dollar you contribute) to get back to $7,600. In the roll-over-and-wait row, about $857 (roughly 9 cents per dollar) closes the gap. Unvested match counts as $0.

Take a hypothetical plan that matches 50 cents per dollar on that $10,000. If the $5,000 match vests, even the high-cost cash-out leaves $9,000 (60% of $15,000), which is $1,400 more than salary. If it never vests, you are back to $6,000.

The table leaves out tax-deferred growth, state tax, treaty rates and home-country tax; growth is why staying invested often beats a cash-out by more than it shows. Which treatment applies to your distribution is a question for a tax professional who prepares Form 1040-NR.

Common misconception: "If I cash out as a nonresident, the plan only takes 20%." Correction: 20% is the withholding rule for US persons. For nonresident aliens, distributions are generally subject to 30% withholding or a lower treaty rate, and the 10% additional tax before 59½ can still apply. IRS Topic no. 558 describes that tax as "equal to 10% of the portion of the distribution that's includible in gross income" (checked 2026-11-01).

Roth vs traditional 401(k) on H-1B or OPT

The choice is a bet on your tax rate now versus your total cost when the money comes out. If today's rate is higher, pre-tax tends to win; if the exit cost is higher, Roth tends to win. For visa holders that exit cost can include the 10% additional tax, so advice written for citizens does not transfer cleanly.

The IRS designated Roth account page sets the mechanics. A distribution is fully tax-free only if it is "made at least five years after the year of the participant's first designated Roth contribution" and on or after age 59½, disability or death. An earlier withdrawal "will be treated as coming pro-rata from earnings and contributions (basis)," so the earnings share can be taxed and hit with the 10%. Roth 401(k) deferrals are not subject to the income limits that restrict Roth IRAs, and pre-tax and Roth deferrals share one $24,500 limit.

One detail people miss: choosing Roth for your own deferrals does not make the match Roth. The IRS's designated Roth page still says matching contributions "may not be made directly to the designated Roth account," but SECURE 2.0 section 604 lets a plan offer Roth matching as an option, limited to match money that is fully vested when it goes in, per IRS Notice 2024-2. A Roth match is taxable income in the year it lands in your account. Unless your plan offers it and you elect it, the match sits in a pre-tax account and follows pre-tax exit math, so ask HR how your plan books it.

When pre-tax tends to come out ahead

When Roth tends to come out ahead

Many plans let you split each paycheck between pre-tax and Roth, which hedges the bet within the same limit. If you are also weighing an IRA, see our guide to Roth IRA eligibility on F-1, OPT or H-1B.

The home-country question

Whether your home country taxes a 401(k) withdrawal, recognizes a Roth's tax-free status, or taxes growth while you live there is not a US question. Advisors disagree about how some countries, India among them, treat these accounts, and we found no primary source that settles it. Get a written view from a tax professional who handles both countries before you rely on a Roth being tax-free at home.

How is a 401(k) taxed when you withdraw from abroad?

If you are a nonresident alien when the money is paid, Publication 519 says the payment "is generally subject to the 30% (or lower treaty) rate of withholding." To claim a lower rate you give the plan Form W-8BEN, the IRS certificate of foreign status, before the payment is made. The same section says you may instead have tax withheld at graduated rates on the part that comes from work performed in the US. Either way, withholding is a prepayment, and the final bill on contributions is worked out on Form 1040-NR (our reading, as in the exit math above). Before 59½ the 10% additional tax applies unless an exception fits, and a direct rollover avoids it.

The exit choices themselves (cash out, roll over to an IRA, or leave the money in the plan) and the forms involved are in our guide to what happens to your 401(k) when you leave the US. That post covers the exit; this one covers whether and how to contribute.

If a layoff is what pushes you out, keep the account separate from the status clock. As of 2026-11-01 the H-1B grace period of up to 60 days is in effect; a proposal to eliminate it is only proposed, with comments closing 2026-11-10 (check the Federal Register for any later action). The grace period governs your status, not your 401(k), so it is no reason to cash out in a rush. Our layoff money checklist for H-1B workers puts the 401(k), RSUs and HSA in order. Talk to an immigration attorney about status options, and to your DSO if you are on OPT or STEM OPT and counting unemployment days (still 90 on post-completion OPT, or 150 in total with STEM OPT).

Social Security is a separate pot

Your 401(k) is an account in your name. Social Security is a government program funded by a payroll tax that, for most F-1 students, starts when you move from OPT to H-1B. Cashing out a 401(k) does not change your Social Security record, and the reverse is also true. The US has no totalization agreement with India or China, per SSA's agreement list; our explainer on Social Security credits and totalization covers what those taxes may turn into.

A decision checklist before you change your deferral

  1. Download the Summary Plan Description from your employer's benefits portal and find the match formula, the vesting schedule and how the plan counts a year of service.
  2. Write your vesting dates next to the end date on your EAD (Form I-766), your I-797 approval notice and your most recent I-94.
  3. Estimate your tax residency with the substantial presence test in IRS Publication 519, then look up your 2026 bracket in Rev. Proc. 2025-32.
  4. Choose pre-tax, Roth or a split in your plan's online portal, and set a deferral percentage you have checked against the match formula.
  5. Name a beneficiary in the same portal.
  6. Ask about a direct rollover on the plan's distribution form when you leave a job, before you choose a cash payment, and check that the receiving plan or IRA provider will keep an account for someone living abroad.
  7. Submit Form W-8BEN to the plan if you are a nonresident claiming a treaty rate on a distribution.
  8. Ask a tax professional who prepares Form 1040-NR, and who knows your home country, before you take any money out.

Common mistakes

Frequently asked questions

Is it worth contributing to a 401(k) if I will leave the US?

Often yes, up to the employer match, but only the vested part of the match is yours when you leave, so check the vesting schedule first. Above the match it depends on your exit plan. A nonresident who cashes out before age 59½ generally faces 30% withholding (or a treaty rate) plus a 10% additional tax, which can cost more than the tax saved, while a rollover avoids the 10% (rules as of November 1, 2026).

Roth or traditional 401(k) on H-1B?

Pre-tax tends to win when your tax rate today is higher than the rate you expect to pay when the money comes out. Roth tends to win when you expect to cash out early as a nonresident and face close to 30% plus the 10% additional tax on pre-tax money. Your match goes into a pre-tax account unless your plan offers Roth matching under SECURE 2.0 and you elect it, and both options share the 2026 deferral limit of $24,500.

Can OPT workers join a 401(k)?

Yes, if the plan's eligibility rules cover you. No F-1 or OPT rule bars participation, and the plan document, not your visa, sets waiting periods and eligibility. Your own deferrals are always 100% vested, and the 2026 limit is $24,500. Nonresident OPT workers are exempt from Social Security and Medicare tax on OPT pay, which is a separate matter from the 401(k).

What do I lose if I leave before vesting?

You can forfeit employer contributions that have not vested, while your own deferrals always stay yours. The IRS describes two common schedules for this money, a 3-year cliff (0% until 3 years of service, then 100%) and a 6-year graded schedule (20% after 2 years, rising 20 points a year). Your Summary Plan Description gives your plan's exact schedule and how it counts a year of service.

How is a 401(k) taxed when I withdraw from abroad?

If you are a nonresident alien when the money is paid, the plan generally withholds 30%, or a lower treaty rate if your country's treaty provides one and you give the plan Form W-8BEN. That withholding may not be your final tax, because IRS Publication 519 treats distributions from US work, to the extent of contributions, as effectively connected income reported on Form 1040-NR. Before age 59½ a 10% additional tax also applies unless an exception fits, though a rollover avoids it. Your home country may tax the withdrawal too, so ask a cross-border tax professional before you take money out.

Sources

How we checked this: we read the IRS pages on 2026 limits, vesting, designated Roth accounts, early distributions and Form W-8BEN, IRS Publication 519, Notice 2024-2, Rev. Proc. 2025-32, SSA's totalization list and the SEVIS Help Hub as of November 1, 2026, and rechecked the IRS news list for 2027 limits on November 2; the dollar comparisons are our own arithmetic.

This is general information, not legal or tax advice; your plan documents, your own immigration papers, and a qualified tax professional, DSO or immigration attorney govern your situation.

A match you will actually vest is worth more than one you will forfeit, and that depends on staying with a sponsoring employer long enough. If you want help finding employers that sponsor visas, F1Jobs is here to talk it through.

Frequently asked questions

Is it worth contributing to a 401(k) if I will leave the US?

Often yes, up to the employer match, but only the vested part of the match is yours when you leave, so check the vesting schedule first. Above the match it depends on your exit plan. A nonresident who cashes out before age 59½ generally faces 30% withholding (or a treaty rate) plus a 10% additional tax, which can cost more than the tax saved, while a rollover avoids the 10% (rules as of November 1, 2026).

Roth or traditional 401(k) on H-1B?

Pre-tax tends to win when your tax rate today is higher than the rate you expect to pay when the money comes out. Roth tends to win when you expect to cash out early as a nonresident and face close to 30% plus the 10% additional tax on pre-tax money. Your match goes into a pre-tax account unless your plan offers Roth matching under SECURE 2.0 and you elect it, and both options share the 2026 deferral limit of $24,500.

Can OPT workers join a 401(k)?

Yes, if the plan's eligibility rules cover you. No F-1 or OPT rule bars participation, and the plan document, not your visa, sets waiting periods and eligibility. Your own deferrals are always 100% vested, and the 2026 limit is $24,500. Nonresident OPT workers are exempt from Social Security and Medicare tax on OPT pay, which is a separate matter from the 401(k).

What do I lose if I leave before vesting?

You can forfeit employer contributions that have not vested, while your own deferrals always stay yours. The IRS describes two common schedules for this money, a 3-year cliff (0% until 3 years of service, then 100%) and a 6-year graded schedule (20% after 2 years, rising 20 points a year). Your Summary Plan Description gives your plan's exact schedule and how it counts a year of service.

How is a 401(k) taxed when I withdraw from abroad?

If you are a nonresident alien when the money is paid, the plan generally withholds 30%, or a lower treaty rate if your country's treaty provides one and you give the plan Form W-8BEN. That withholding may not be your final tax, because IRS Publication 519 treats distributions from US work, to the extent of contributions, as effectively connected income reported on Form 1040-NR. Before age 59½ a 10% additional tax also applies unless an exception fits, though a rollover avoids it. Your home country may tax the withdrawal too, so ask a cross-border tax professional before you take money out.