Resident vs Nonresident Alien for Tax Purposes: The Substantial Presence Test Explained
By Muntasir Minhaz • Published Aug 19, 2026 • Reviewed Oct 08, 2026 by Muntasir Minhaz
Your US tax status is not the same as your immigration status. The IRS uses a day-counting formula called the substantial presence test to decide if you are a resident or nonresident alien for taxes. F-1 and J-1 students are excluded from this count for their first 5 calendar years, so most students file as nonresident aliens the whole time they study.
The test counts current-year days, plus 1/3 of the prior year, plus 1/6 of the year before that.
🎓 F-1, F-2, J-1, J-2, M-1, M-2, and Q visa students are exempt individuals for their first 5 calendar years.
Teachers and trainees on J or Q status are exempt for 2 of the last 6 calendar years.
Once you meet the test, you file as a resident alien and report worldwide income.
Two ways the IRS classifies you
The IRS decides whether you file taxes as a resident alien or a nonresident alien using 2 separate tests: the green card test, which applies if you hold lawful permanent resident status, and the substantial presence test , a day-counting formula. Most international students without a green card fall under the substantial presence test.
The substantial presence test formula
You meet the test, and become a resident alien for tax purposes, if you are physically present in the US for at least 31 days during the current year, and the total below reaches 183 or more:
All the days you were present in the current year.
Plus 1/3 of the days you were present in the prior year.
Plus 1/6 of the days you were present in the year before that.
The IRS gives this example on its substantial presence test page : 120 days present in 2025 count as 120, 40 days present in 2024 (1/3 of 120) count as 40, and 20 days present in 2023 (1/6 of 120) count as 20, for a 3-year total of 180 days. That total falls under 183, so the person in this example does not meet the test that year.
Why F-1 and J-1 students are exempt individuals
Days you spend in the US as a student on an F, J, M, or Q visa do not count toward the substantial presence test at all, for your first 5 calendar years in that status. The IRS calls this being an exempt individual.
It does not mean you are exempt from all tax, it means those days get left out of the day-counting formula, which keeps you classified as a nonresident alien.
IRS Publication 519 sets the exact limits. You stop being an exempt individual as a student once you have held exempt status, as a teacher, trainee, or student, for any part of more than 5 calendar years. Teachers and trainees on J or Q status get a shorter window: they lose exempt status once they have held it for any part of 2 of the preceding 6 calendar years.
Even one day in a calendar year counts as a full year toward these limits, so your first partial year in the US and your last partial year both count.
What happens once your exempt years run out
Once you pass your exempt window, your days in the US start counting toward the substantial presence test like anyone else's. If your 3-year weighted total reaches 183 or more, you become a resident alien for tax purposes starting that calendar year. The year you cross that line can turn into a dual-status tax year, part nonresident and part resident, which has its own filing rules.
Why the distinction matters
| Nonresident alien | Resident alien | |
|---|---|---|
| Tax return form | Form 1040-NR | Form 1040 |
| Income reported | US-source income, with limited exceptions | Worldwide income |
| Standard deduction | Generally not allowed | Allowed |
| FICA on eligible student jobs | Exempt in qualifying years | Not exempt |
A worked example for a longer-term student
Say you started F-1 status in August 2021 and you are still enrolled in 2026. Your exempt years as a student ran from 2021 through 2025, which is 5 calendar years.
Starting January 1, 2026, your days in the US begin counting toward the substantial presence test. If you stay past 31 days in 2026 and your 3-year weighted total reaches 183, you become a resident alien starting in 2026, even though your visa status has not changed.
Your visa status and your tax status are separate
Immigration status and tax status follow different rules and different agencies. You can remain in valid F-1 status with USCIS and the Department of Homeland Security while becoming a resident alien for IRS purposes once your exempt years run out.
Neither status controls the other, so check both separately each year.
Dual-status years
The calendar year you cross the substantial presence threshold can become a dual-status year, with part of the year taxed under nonresident rules and part under resident rules. Dual-status returns follow their own set of forms and restrictions, including limits on the standard deduction and on certain credits, so get guidance specific to a dual-status filing rather than using a standard Form 1040-NR or Form 1040 template for that year.
Marrying a US citizen or resident does not change this test
The substantial presence test looks at your own days in the US, not your spouse's immigration or tax status. Marrying a US citizen or resident does not by itself make you a resident alien. A separate election exists for a nonresident spouse married to a US citizen or resident who wants to file jointly, which is a choice you make rather than an automatic result of marriage.
Check your status every year
Your resident or nonresident status can change year to year as your exempt window runs out, so recalculate it each tax season rather than assuming last year's answer still applies. Tax software built for nonresidents, and your university's international student tax resources, can walk you through the current year's count.
Sources
- Substantial Presence Test (accessed 2026-10-08)
- Publication 519, U.S. Tax Guide for Aliens (accessed 2026-10-08)
- Foreign Student Liability for Social Security and Medicare Taxes (accessed 2026-10-08)