How does the substantial presence test work?
If you are not a US citizen or green card holder, the IRS treats you as a resident for tax purposes for a calendar year if you pass the substantial presence test. You pass if both of these are true:
- You were physically present in the US on at least 31 days during the current year, and
- The following adds up to 183 days or more:
- all the days you were present in the current year, plus
- 1/3 of the days you were present in the year before, plus
- 1/6 of the days you were present in the year before that.
Example: 120 days in each of 2024, 2025 and 2026 gives 120 + 40 + 20 = 180 for 2026. That is under 183, so you do not meet the test. Three more days in 2026 would tip you over.
Worked example
You spent 120 days in the US in 2024, 120 in 2025 and 150 in 2026. The weighted total for 2026 is 150 + 120 ÷ 3 + 120 ÷ 6 = 150 + 40 + 20 = 210, so you meet the test for 2026.
With the same two earlier years but only 100 days in 2026, the total is 160 and you don't meet it. You would meet it on your 123rd day in the US in 2026, so you could spend 22 more days there that year.
What counts as a day of presence?
Any part of a day in the US generally counts as a full day, so arrival and departure days both count. The main exceptions are:
- Days you regularly commute to work in the US from Canada or Mexico.
- Days in transit between two foreign points when you are in the US for less than 24 hours.
- Days as a crew member of a foreign vessel.
- Days you could not leave because of a medical condition that arose while you were in the US.
- Days as an exempt individual. This includes many F, J, M and Q students (usually for their first 5 calendar years), J and Q teachers or trainees (usually 2 of the last 6 years), and certain foreign government-related people.
If some of your days are excluded, type in the adjusted counts by choosing "I will type them in".
Visa holders can download up to 10 years of arrivals and departures from the I-94 website: see how to get your travel history. Visiting on ESTA? See how long you can stay on ESTA. Canadian snowbirds can use the snowbird calculator, which also covers Form 8840 and provincial health limits.
Can you meet the test and still be a non-resident?
Yes, in some cases:
- Closer connection exception: if you were in the US for fewer than 183 days this year, had a tax home in another country, and had a closer connection to that country, you may be able to claim non-resident status on Form 8840.
- Tax treaties: many income tax treaties have "tie-breaker" rules that can make you a resident of the other country for treaty purposes.