ESPP on H-1B or OPT: Is It Allowed, How the Discount Is Taxed and What Happens When You Leave
Your ESPP discount is real money, but two holding periods, your tax residency and a layoff decide how much of it you keep.

Part of our guide to US taxes on F-1, OPT and H-1B.
Yes, you can generally join an ESPP on H-1B, OPT or STEM OPT. As of 2026-11-01, we know of no immigration rule that bars it: buying your employer's stock through payroll deductions is a benefit of the job you are already authorized to hold, not separate work (our reading), and H-1B employers must offer stock-option benefits "on the same basis" as to US workers. Under a Section 423 plan you owe no tax when shares are bought. Tax comes when you sell: the discount is ordinary income and the rest is capital gain or loss, with two holding periods deciding the split. Leaving the job usually ends enrollment; shares you own stay yours.
Status as of 2026-11-01. The ESPP tax rules in Internal Revenue Code section 423 and IRS Publication 525 are in effect. The H-1B grace period of up to 60 days is in effect; DHS has proposed eliminating it (RIN 1615-AD22), with comments closing 2026-11-10. Closing comments does not make it final; the Federal Register page will show any final rule. The OPT unemployment limit of 90 days, 150 with STEM OPT, is in effect and unchanged.
Can you join an ESPP on H-1B or OPT?
An employee stock purchase plan lets you buy your employer's shares through after-tax payroll deductions, at a discount of up to 15% under a Section 423 plan. Visa holders on H-1B, OPT and STEM OPT can generally enroll like any other employee. Your visa does not change the plan rules; your tax residency changes how each purchase and sale is reported.
This page covers ESPPs only. If your offer also includes RSUs or options, our guide to RSUs and stock options for visa holders covers how those differ.
On F-1 OPT or STEM OPT
Your EAD authorizes the job, and the ESPP is a benefit of that job. Holding the shares is passive investing, which our guide to whether F-1 students can invest in stocks on OPT or H-1B covers. One caution: an ESPP purchase is not employment, so it does nothing for your unemployment count under SEVP's Broadcast Message 2101-01. SEVIS questions belong with your DSO.
On H-1B
Under the Labor Condition Application rule at 20 CFR 655.731(c)(3), "Benefits and eligibility for benefits provided as compensation for services (e.g., cash bonuses; stock options; ...) shall be offered to the H-1B nonimmigrant(s) on the same basis, and in accordance with the same criteria, as the employer offers to U.S. workers." The same rule says H-1B workers "are not to be denied benefits on the basis that they are 'temporary employees'"; its narrow exceptions cover workers kept on a multinational's home-country payroll. A 423 plan must also give participants "the same rights and privileges" (26 U.S.C. 423(b)(5)). Plans may still exclude, for everyone, employees with less than 2 years of service, part-time or seasonal staff, and highly compensated employees (423(b)(4)).
How a Section 423 ESPP works: offering period, lookback and discount
A qualified ESPP runs on two dates. The offering date (the IRS calls it the grant date) opens a period of payroll deductions. The purchase date (the exercise date) is when the plan buys shares with that money. The statute caps an offering at 27 months, or 5 years if the price can never fall below 85% of the purchase-date value (423(b)(7)).
- Discount. The price must be at least 85% of the stock's value at the offering date or the purchase date, whichever is less (423(b)(6)). A plan that uses the lower of the two is a lookback plan.
- Annual limit. You cannot accrue the right to buy more than $25,000 of stock per calendar year, measured at the offering-date value (423(b)(8)). At 85% of that value, the most cash you can spend is about $21,250 (our arithmetic). Many plans set a lower cap as a share of pay.
- After-tax money. Deductions come out of take-home pay; nothing is deferred, unlike a traditional 401(k).
A plan that does not qualify under 423 follows the nonstatutory-option rules in IRS Publication 525: the discount is generally taxed as wages when you buy, with Social Security and Medicare unless the student FICA exemption covers you. Your plan document says which kind you have. Everything below assumes a 423 plan.
How is the ESPP discount taxed?
Nothing is taxed when you enroll or when shares are bought. When you sell, Publication 525 splits the result into ordinary income, taxed like wages, and capital gain or loss. The split depends on whether the sale is a qualifying or disqualifying disposition, and the forms depend on your tax residency.
ESPP tax at each stage, Section 423 plan (as of 2026-11)
| Stage | Rule | Resident alien (typically H-1B here most of the year) | Nonresident alien (typically F-1 OPT in first five calendar years) |
|---|---|---|---|
| Purchase date | No income (Pub 525); employer sends Form 3922 | Nothing to report yet | Nothing to report yet |
| Disqualifying sale | Ordinary income = purchase-date value minus price paid; rest is capital gain or loss | W-2 box 1 (Schedule 1 if the W-2 omits it), plus Form 8949 | Pay piece with wages on Form 1040-NR |
| Qualifying sale | Ordinary income = lesser of offering-date discount or actual gain; rest is long-term gain or loss | Same forms | Pay piece on 1040-NR; gain under Pub 519's 183-day rule |
| Social Security, Medicare | Not owed on 423 ESPP income (26 U.S.C. 3121(a)(22)) | Same | Same |
| Income tax withholding | Not required on a disqualifying disposition (26 U.S.C. 421(b)) or the 423(c) amount | May owe at filing | May owe at filing |
IRS Topic 427 says Form 3922 "will report important dates and values needed to determine the correct amount of capital and ordinary income." Keep every one (About Form 3922).
Qualifying vs disqualifying disposition: the two holding periods
A sale is a qualifying disposition only if it comes after the later of 2 years from the offering date and 1 year from the purchase date (423(a)(1); Pub 525). Any earlier sale is a disqualifying disposition. The difference is how much of your profit is taxed as ordinary income.
- Disqualifying: ordinary income is the purchase-date value minus what you paid. Pub 525 is blunt: "This ordinary income isn't limited to your gain from the sale of the stock." It is added to your basis, so a falling price shows up as a capital loss.
- Qualifying: ordinary income is the lesser of the offering-date discount or your actual gain. Sell at a loss and there is no ordinary income at all.
Worked example 1: a resident H-1B worker
Take a hypothetical plan with a 15% discount and a lookback. The offering date is 2026-01-02, stock at $40; the purchase date is 2026-06-30, stock at $50. Your price is $34 (85% of $40), so $3,400 of deductions buys 100 shares. The holding periods end on 2028-01-02, the later of the two dates.
One purchase, five ways to sell (illustrative prices, rules as of 2026-11)
| Sale | Date | Price | Type | Ordinary income | Capital gain or loss |
|---|---|---|---|---|---|
| A | 2026-07-15 | $51 | Disqualifying | $1,600 | $100 short-term |
| B | 2027-03-15 | $60 | Disqualifying | $1,600 | $1,000 short-term |
| C | 2028-01-10 | $60 | Qualifying | $600 | $2,000 long-term |
| D | 2027-03-15 | $30 | Disqualifying | $1,600 | ($2,000) short-term loss |
| E | 2028-01-10 | $30 | Qualifying | $0 | ($400) long-term loss |
Sale C is the reward for waiting: the ordinary piece drops from $1,600 to $600 because it is measured against the $40 offering-date price. Sale D is the trap: $1,600 of ordinary income on shares that lost money, offset only by a capital loss. Pub 525 says your employer or former employer should report the ordinary income in W-2 box 1; if it does not, you report it on Schedule 1. Most H-1B workers here most of the year are residents; our guide to the substantial presence test explains the count.
Worked example 2: a nonresident on OPT
Same purchase, but you arrived on F-1 in August 2023. Under the five-calendar-year rule in IRS Publication 519, 2023 through 2027 are exempt years, so you are a nonresident alien for 2026 (our reading; check your own dates). You make sale A.
- The $1,600 of ordinary income is pay for US work. It goes on Form 1040-NR with your wages, taxed at graduated rates, with no Social Security or Medicare.
- The $100 gain falls under Pub 519's 183-day rule: "If you were in the United States for 183 days or more during the tax year, your net gain from sales or exchanges of capital assets is taxed at a 30% (or lower treaty) rate." Such gains go on Schedule NEC of Form 1040-NR. That passage does not say whether days you exclude as an F-1 student count toward the 183, so if you were here most of the year, ask a nonresident tax professional before treating the gain as tax-free.
- RSUs work differently. They are taxed as pay when they vest, with withholding, as our guide to RSU vesting tax withholding for nonresident aliens explains; an ESPP has no tax event at purchase.
- Your broker asks for Form W-8BEN while you are a nonresident (IRS W-8BEN page) and a Form W-9 once you become a resident alien under the substantial presence test.
What happens to your ESPP if you're laid off on H-1B or OPT?
Shares you already bought stay yours, and their holding periods keep running after you leave. The cash in the current offering period depends on your plan document.
Section 423(a)(2) requires you to be an employee from the offering date until 3 months before the purchase date, so the statute allows a purchase within 3 months after your last day. Your plan decides, and many plans end participation at termination and refund the deductions. For shares you already own, a qualifying disposition takes only time (the two holding periods), not continued employment (our reading of 423(a)).
What a layoff or a move changes (as of 2026-11)
| Event | Deductions in the current period | Shares you own | Status or filing clock |
|---|---|---|---|
| Laid off on H-1B | Plan decides; many refund | Yours; holding periods keep running | Grace period up to 60 days (in effect; elimination proposed, comments close 2026-11-10) |
| Laid off on OPT or STEM OPT | Plan decides; many refund | Yours | 90 days of unemployment, 150 with STEM OPT (in effect) |
| New employer | Old plan ends; new plan enrolls separately | Yours | Former employer should still report the ordinary income on a W-2 (Pub 525) |
| Move abroad | Ends with employment | Yours; broker may limit non-US accounts | Exit year may be dual-status; later sales may need a Form 1040-NR |
A refund or a share sale is money, not employment: it neither extends an H-1B grace period nor stops the OPT count. Our money checklist for an H-1B layoff lines up the ESPP with 401(k), RSU and HSA deadlines. For status options, talk to an immigration attorney (H-1B) or your DSO (OPT).
Do you owe US tax on ESPP shares after you move abroad?
Possibly on part of the sale. The US can still tax the ordinary-income piece, because it is pay for US work. The capital gain is generally US-tax-free if you are a nonresident here fewer than 183 days that year, though your new country may tax it.
The exit year. A resident who leaves mid-year can have a dual-status year: resident until the residency termination date, nonresident after. Pub 519 puts that date at December 31 unless you qualify for an earlier one: your last day of presence, if for the rest of the year your tax home was abroad and you had a closer connection to that country, and you are not a US resident in any part of the next year. Later sales. Pub 519 sources pay by where the work was done and says multiyear compensation "is generally determined on a time basis over the period to which the compensation is attributable," so sale C's $600 can still belong on a Form 1040-NR (our reading). Below 183 days, Pub 519 says, capital gains "are tax exempt unless they are effectively connected" with a US trade or business. Your new country, any treaty and any foreign tax credit decide the rest, so a cross-border tax professional should look at the year of sale. Our checklist for leaving the US after H-1B or OPT covers the accounts to settle first.
Step-by-step: handling ESPP shares around a job change or a move
- Download the plan document from your stock-plan administrator's portal and read the eligibility and termination-of-employment sections.
- Save every Form 3922, noting each lot's offering date, purchase date, prices and share count.
- Determine your tax residency for each year with the substantial presence test in IRS Publication 519.
- Give your broker Form W-8BEN as a nonresident alien, or Form W-9 once you are a resident.
- Map each lot's two holding-period end dates in your brokerage account before placing a sell order.
- Reconcile each sale on Form 8949, adjusting the Form 1099-B basis by the ordinary income.
- Confirm with HR, before your last day, how unused payroll deductions come back.
- Ask the right professional: your DSO for OPT and SEVIS, an immigration attorney for H-1B status after a layoff, a nonresident or cross-border tax professional for sourcing and dual-status years.
Common mistakes
Common misconception: "My Form 1099-B shows a big gain, so that is what I owe tax on."
Correction: Pub 525 explains that for options granted on or after 2014-01-01, the Form 1099-B basis does not include amounts you report as income from the option, and adds: "It's your responsibility to make any appropriate adjustments to the basis information reported on Form 1099-B by completing Form 8949." In sale B, an unadjusted $3,400 basis would tax the $1,600 twice.
- Assuming a qualifying sale has no ordinary income. It has less, not none, unless you sell at a loss.
- Assuming "nonresident" means "no tax." The pay piece is taxable on Form 1040-NR, and the 183-day rule can reach the gain.
- Counting on withholding. No income tax withholding is required on 423 ESPP income, so a large sale can leave you owing at filing.
- Forgetting the exit-year return when you leave the US mid-year.
- Stacking risk. Your sponsor, paycheck and ESPP shares can ride on one company, so one bad quarter can hit all three.
Frequently asked questions
Can OPT or H-1B employees join an ESPP?
Generally yes. As of 2026-11-01 we know of no immigration rule that bars it, because buying your employer's stock through payroll deductions is a benefit of the job you are already authorized to hold, not separate work (our reading). For H-1B workers, 20 CFR 655.731(c)(3) requires employers to offer benefits such as stock options on the same basis as to US workers. Ask your DSO about any OPT reporting question.
How is the ESPP discount taxed?
Under a Section 423 plan you owe nothing when shares are bought. When you sell, part of the gain is ordinary income (the discount) and the rest is capital gain or loss, per IRS Publication 525. Social Security and Medicare do not apply to that income, and employers are not required to withhold income tax on it, so you may owe at filing time.
What is a qualifying vs disqualifying disposition?
A qualifying disposition is a sale after both holding periods end, 2 years after the offering date and 1 year after the purchase date. Ordinary income is then the smaller of the offering-date discount or your actual gain. An earlier sale is disqualifying, and the whole gap between the purchase-date value and your price is ordinary income even if the shares later fell.
What happens to ESPP shares if I'm laid off?
Shares you already bought stay yours, and their holding periods keep running after you leave. Your plan document decides what happens to deductions in the current offering period, and many plans refund them. Your visa clock runs separately, and as of 2026-11-01 the H-1B grace period of up to 60 days and the OPT limit of 90 days (150 with STEM OPT) are both in effect.
Do I owe US tax on ESPP shares after I move abroad?
Possibly on part of the sale. The ordinary-income piece is pay for US work, and IRS Publication 519 sources pay by where the work was done, so it can still belong on a Form 1040-NR. Pub 519 says a nonresident's capital gains are tax exempt if they were in the US fewer than 183 days that year and the gains are not effectively connected, but your new country may tax the sale.
Sources
- IRS, Topic no. 427, Stock options
- IRS, Publication 525 (2025), Taxable and Nontaxable Income, "Employee stock purchase plan"
- IRS, Publication 519 (2025), U.S. Tax Guide for Aliens
- IRS, About Form 3922 and About Form W-8BEN
- IRS, Foreign student liability for Social Security and Medicare taxes
- 26 U.S.C. 423, 26 U.S.C. 421 and 26 U.S.C. 3121
- 20 CFR 655.731, H-1B wage and benefits requirements
- SEVP, Broadcast Message 2101-01, OPT unemployment
- Federal Register, Eliminating the Discretionary 60-Day Grace Period (proposed)
How we checked this: we read IRS Topic 427, Publications 525 and 519 (2025 editions), the code sections and DOL regulation above, and the SEVP and Federal Register pages (last checked 2026-11-02). The worked examples use made-up prices to show the rules, not a forecast for any stock.
This is general information, not legal or tax advice; your plan document, your Forms 3922 and W-2, and your DSO, immigration attorney or tax professional govern your situation.
If you are on OPT or STEM OPT and want a focused search for employers that sponsor H-1B, F1Jobs can help you plan it.
Frequently asked questions
Can OPT or H-1B employees join an ESPP?
Generally yes. As of 2026-11-01 we know of no immigration rule that bars it, because buying your employer's stock through payroll deductions is a benefit of the job you are already authorized to hold, not separate work (our reading). For H-1B workers, DOL's rule at 20 CFR 655.731(c)(3) requires employers to offer benefits such as stock options on the same basis as to US workers. Ask your DSO about any OPT reporting question.
How is the ESPP discount taxed?
Under a Section 423 plan you owe nothing when shares are bought. When you sell, part of the gain is ordinary income (the discount) and the rest is capital gain or loss, per IRS Publication 525. Social Security and Medicare do not apply to that income, and employers are not required to withhold income tax on it, so you may owe at filing time.
What is a qualifying vs disqualifying disposition?
A qualifying disposition is a sale after both holding periods end, 2 years after the offering date and 1 year after the purchase date. Ordinary income is then the smaller of the offering-date discount or your actual gain. An earlier sale is disqualifying, and the whole gap between the purchase-date value and your price is ordinary income even if the shares later fell.
What happens to ESPP shares if I'm laid off?
Shares you already bought stay yours, and their holding periods keep running after you leave. Your plan document decides what happens to deductions in the current offering period, and many plans refund them. Your visa clock runs separately, and as of 2026-11-01 the H-1B grace period of up to 60 days and the OPT limit of 90 days (150 with STEM OPT) are both in effect.
Do I owe US tax on ESPP shares after I move abroad?
Possibly on part of the sale. The ordinary-income piece is pay for US work, and IRS Publication 519 sources pay by where the work was done, so it can still belong on a Form 1040-NR. Pub 519 says a nonresident's capital gains are tax exempt if they were in the US fewer than 183 days that year and the gains are not effectively connected, but your new country may tax the sale.