How the test works
If you’re not a US citizen or green card holder, you’re a US resident for tax purposes for a calendar year if you meet the Substantial Presence Test. You meet it if you were in the US on at least 31 days during the year, and on at least 183 days during that year and the two years before it, counting:
- every day you were there this year,
- a third of the days you were there last year, and
- a sixth of the days you were there the year before that.
Any part of a day counts as a day, so the days you arrive and leave both count. The US means the 50 states and the District of Columbia. US territories don’t count.
An example
The IRS gives this one: 120 days in the US in each of 2023, 2024 and 2025. For 2025 that counts as 120 + 40 + 20 = 180 days, short of 183, so the test isn’t met for 2025.
The law doesn’t say how to round the thirds and sixths. The calculator keeps them, which is the cautious reading, so ask a tax adviser if you’re within a day of 183.
Days that don’t count
Leave these days out of your trips:
- days you commuted to work in the US from a home in Canada or Mexico, if you do so regularly,
- days in the US for less than 24 hours while travelling between two places outside the US,
- days in the US as a crew member of a foreign ship,
- days you couldn’t leave because of a medical condition that began while you were there, and
- days as an exempt individual: for example a student on an F, J, M or Q visa, a teacher or trainee on a J or Q visa, or a foreign government official on an A or G visa.
To leave out days as an exempt individual or for a medical condition, you file Form 8843 with your return.
If you meet the test
You’re treated as a US resident for tax purposes for that year, unless an exception applies. One is the closer connection exception, for people who were in the US fewer than 183 days during the year and kept a tax home and closer ties in another country. It’s claimed on Form 8840. A tax treaty can also make you a resident of the other country. The IRS explains the test and its exceptions on its Substantial Presence Test page.