You are a resident alien for U.S. federal tax purposes on STEM OPT only if you meet the green-card test or the substantial presence test (SPT) for the tax year in question — and the most common reason STEM OPT students do meet it is that the F-1 student "exempt individual" exclusion has expired because they have been exempt individuals for more than five calendar years. STEM OPT is a work authorization and immigration status, not a tax residency category; the answer depends on your arrival date, your prior F-1 presence, whether you have ever held another immigration status, and any treaty benefits you claim.

This is a general explanation of stable rules in the Internal Revenue Code, Treasury regulations, IRS Publication 519, and the instructions to Form 1040 and Form 8843. It is not a substitute for advice about your specific facts; if you have multi-year F-1 history, dependents, treaty claims, or a change of status, a qualified tax professional or the IRS can address your situation.

Why "STEM OPT" Doesn't Answer the Question

People often frame the question as "am I a resident alien on STEM OPT?" That framing confuses two different legal systems.

Immigration status (F-1, STEM OPT, H-1B, green card) is administered by USCIS and the State Department. Tax residency (resident alien vs. nonresident alien) is defined by the Internal Revenue Code, principally sections 7701(b) and the substantial presence test, plus the special student rules.

The IRS does not have a "STEM OPT" category. It looks at whether you are a "lawful permanent resident" (green-card holder) at any time during the year, or whether you satisfy the SPT. If neither applies, you are a nonresident alien for that year, even if you are working full-time on STEM OPT. Conversely, many STEM OPT workers are resident aliens — not because of OPT, but because their five-calendar-year F-1 exclusion has run out.

The Two Paths to Resident Alien Status

Under IRC §7701(b)(1), you are a resident alien for a calendar year if you meet either test:

1: Green-card test. You were a lawful permanent resident at any time during the calendar year (with limited treaty exceptions). 2: Substantial presence test. You were physically present in the United States for at least 31 days during the current year, and the weighted sum of days in the current year plus one-third of days in the prior year plus one-sixth of days in the year before that equals at least 183.

The SPT is where the "exempt individual" rules matter, and they matter enormously for F-1 students.

The F-1 Exempt-Individual Rule

Under IRC §7701(b)(5) and the regulations, an "exempt individual" does not count days of physical presence toward the SPT. F-1 students are exempt individuals for their first five calendar years of presence in the United States as F-1 students (the statute says "five calendar years" — not five years from arrival, not 60 months; the count is by calendar year, so an arrival in, say, August 2021 can produce exemption for 2021, 2022, 2023, 2024, and 2025, after which 2026 is the first non-exempt year). During those years, F-1 days do not count toward the 183-day calculation.

A crucial nuance: the five-year clock applies to F-1 student presence. If you have ever been an exempt individual as a teacher or trainee (J or Q visa) or in another exempt category, separate rules and a different counting method may apply. If you changed status from F-1 to H-1B, the H-1B period is generally not exempt, so H-1B days count toward the SPT immediately. If you changed from H-1B back to F-1, the F-1 exemption rules still apply to the F-1 period, but prior non-exempt days and prior exempt years affect the analysis, and the "five calendar years" is a lifetime aggregate in relevant part — this is one of the most commonly mishandled areas.

There is also an important edge rule: an F-1 student who has been an exempt individual for more than five calendar years may still be treated as a nonresident if the student establishes that they have closer connection to a foreign country and does not intend to reside permanently in the United States, under the regulations for students who have remained beyond the five-year period. That regulatory exception (sometimes discussed in connection with the "closer connection" and intent tests for students) is narrowly drawn and fact-specific; it is not a general opt-out, and it should not be assumed without checking the current regulations and Publication 519.

Practical consequence for STEM OPT: STEM OPT commonly begins after the initial 12 months of post-completion OPT. If you arrived as an F-1 student and have been present in F-1 status for more than five calendar years by the time you are on STEM OPT, your F-1 days in the current year generally count toward the SPT, and you may become a resident alien mid-year or for the full year depending on the arithmetic.

The Mid-Year Change and Dual-Status Years

If your exempt-individual period ends during a year — for example, your sixth calendar year of F-1 presence begins in that year — you can become a resident alien partway through the year. In that case you may be a dual-status alien for that year: nonresident for the portion of the year before the residency starting date, resident for the portion after. Dual-status filing has its own rules (Form 1040 with a statement, limited standard deduction, special treatment of certain income), and the residency starting date under the regulations can be determined by the SPT and the "first day" rules.

A common simplification people use — "I become a resident on January 1 of my sixth year" — is not a universal rule. The actual residency starting date depends on when you first satisfy the SPT after the exemption ends, and the regulations provide ordering rules for counting days and identifying the first day of residency. Check the current Form 1040 instructions and Publication 519 for the mechanics, and consider professional help for a dual-status year.

What "Resident Alien" Changes on Your Return

Once you are a resident alien for the year (or for the resident portion of a dual-status year), several things shift:

Filing status and deductions. You generally file Form 1040 (not 1040-NR) and can use the standard deduction if otherwise eligible, claim certain credits, and use the same rules as U.S. citizens, subject to treaty and dual-status limitations. Worldwide income. Resident aliens report worldwide income, not just U.S.-source income, subject to foreign tax credit and treaty rules. FICA and withholding. Employer withholding and FICA treatment depend on your status and treaty claims. F-1 students are generally exempt from FICA on wages for services performed in their student capacity under the student FICA exception, but that exception is limited and does not automatically extend to all OPT employment; the IRS student FICA exception rules are fact-specific. Do not assume OPT wages are automatically FICA-exempt — this is a frequent, expensive error. Form 8843. Exempt individuals file Form 8843 to explain their exempt days. If you are no longer exempt, you generally stop filing it for the non-exempt period, but you may still need it for any exempt days in a dual-status year. Treaty benefits. Many F-1 students claim treaty benefits (e.g., the U.S.–China treaty's student article, or the India treaty's student article). Treaty benefits and residency status interact; a treaty may reduce tax on certain income even for a resident alien in limited circumstances, but treaty claims are specific to the treaty text and the saving clause. Do not generalize from one treaty to another. Dependents and family. A resident alien can generally claim a qualifying child or relative as a dependent under the same rules as citizens; nonresident aliens face restrictions. This can change refundable credit eligibility (e.g., child tax credit, earned income tax credit). Eligibility for these credits has its own rules and should be verified in the current-year instructions.

Where Confusion Commonly Arises

"OPT is a student status, so I'm still exempt." OPT — including STEM OPT — is still F-1 status for immigration purposes, but the tax exemption is measured by calendar years of exempt-individual presence, not by the label on your work authorization. Being on OPT does not extend the five-year clock.

"I've been here five years, so I'm a resident." The five-year rule is five calendar years of exempt F-1 presence, and the counting interacts with arrival and departure dates, prior statuses, and any J or other exempt periods. A student who arrived in December of year one may have a different count than one who arrived in January.

"My employer withheld FICA, so I must be a resident." Withholding is not determinative. Employers sometimes withhold incorrectly, and the IRS looks at the substantive tests. Conversely, an employer that treats you as a nonresident does not make you one. You may need to file to claim a refund of improperly withheld FICA (Form 843 or the appropriate process) or to correct withholding.

"I have a green card pending, so I'm a resident." A pending adjustment application is not the green-card test; the test is lawful permanent resident status. Pending applicants are generally nonresident aliens unless they meet the SPT independently.

"I left and re-entered, so the clock reset." Brief absences generally don't reset the exempt-individual year count for F-1 students in the way people imagine; the rules track calendar years of exempt presence and the regulations on counting. Extended absences and changes of status require careful analysis.

"The substantial presence test is just 183 days." It's 31 days in the current year and the weighted 183-day total, and exempt days are excluded from all three years' counts for exempt individuals. Days in transit, days in Canada or Mexico commuting, and days on certain visa categories have special rules.

A Worked Illustration (Illustrative Only)

Suppose a student arrived on an F-1 visa in August 2021 and remained in F-1 status continuously, moving to post-completion OPT and then STEM OPT. The five calendar years of exempt presence would generally be 2021, 2022, 2023, 2024, and 2025. In 2026, F-1 days generally count toward the SPT. If the student was physically present in the United States for, say, 300 days in 2026, more than 31, plus one-third of 2025 days (exempt, so zero for SPT purposes if 2025 was still exempt) plus one-sixth of 2024 days (also exempt), the calculation would be based only on 2026 days — and 300 exceeds 183, so the student would be a resident alien, with a residency starting date determined under the regulations. If instead the student had spent substantial time abroad in 2026, the arithmetic could fall short, and the student could remain a nonresident or become dual-status. These numbers are illustrative and not a determination for any individual.

Filing Mechanics and Records

Keep arrival and departure records (I-94, passport stamps, flight records) because the SPT is day-counted. Keep your I-20 history and any change-of-status approvals; the five-year count and status transitions depend on them. File Form 8843 for exempt-individual years as required, even if you have no income. In a dual-status year, follow the Form 1040 instructions for dual-status filers, including the statement and the limitations on standard deduction and credits. If you claim treaty benefits, attach the required form (e.g., Form 8833 where applicable) and keep the treaty article and your facts documented. If you are a resident alien, remember FBAR/Form 8938 and foreign income reporting rules may apply to foreign accounts and assets — these are separate from residency but often become relevant at the same time.

Bottom Line

STEM OPT does not itself make you a resident alien or a nonresident alien. You are a resident alien for a tax year if you hold a green card during that year or meet the substantial presence test, and for most long-term F-1 students on STEM OPT the pivotal fact is whether the five-calendar-year F-1 exempt-individual period has expired so that F-1 days begin counting. Because the count is calendar-year based, status-transition sensitive, and interacts with dual-status rules, treaty claims, and FICA treatment, the reliable path is to reconstruct your day counts and status history, apply the current-year Form 1040 and Publication 519 rules, and get professional help if the result is dual-status or if treaty or FICA issues are in play.