Tax & Residency guide
The US Substantial Presence Test, explained
How the IRS determines US tax residency for non-citizens: a weighted day-count formula across the current and prior two years. Exceptions, exemptions, and the closer-connection escape.
The IRS uses a weighted day-count formula called the Substantial Presence Test (SPT) to determine US tax residency for non-citizens. You are a US tax resident for a given calendar year if both of the following are true:
- You were physically present in the US for at least 31 days during the current year, AND
- Your weighted total across the current and previous two years is 183 days or more, where:
- Each day in the current year counts as 1 day
- Each day in the prior year counts as 1/3 of a day
- Each day in the year before that counts as 1/6 of a day
If you meet both tests, the US can tax your worldwide income for the current year — not just US-source income. (US citizens and green-card holders are already worldwide-taxed regardless; the SPT applies to other non-citizens.)
The weighted formula in plain numbers
To pass the SPT, you would typically need around 122 days in the US per year if you have been there continuously. The math:
Current year (× 1) + Prior year (× 1/3) + Year before that (× 1/6)
122 122 122
= 122 ≈ 40.7 ≈ 20.3 = 183 ✓
So spending 122 days a year, three years in a row, in the US is enough to trigger SPT in year three — even though no single year hit 183.
The “31 days in the current year” floor means very brief visits in the current year alone (e.g. 20 days) cannot trigger residency, regardless of past visits.
What counts as a “day”
For the SPT, you generally count any day on which you were physically present in the US at any time. This includes:
- Arrival day — counts.
- Departure day — counts.
- Days in transit through a US airport — generally counts if you cleared US immigration (which you typically do on connecting flights through the US).
- Days you were sick or injured in the US — counts unless covered by the medical-condition exception below.
The standard exceptions that do not count:
- Days in transit between two foreign locations through the US for less than 24 hours without leaving the airport’s international transit area (US transit is rare without immigration clearance).
- Days you intended to leave but a documented medical condition prevented departure.
- Days as a “regular commuter” from Canada or Mexico (specific rules).
- Days as crew of a foreign vessel.
Exempt individuals: students, teachers, diplomats
Certain visa categories are exempt from counting days under the SPT for a defined period:
- F, J, M, Q students — generally exempt for 5 calendar years (lifetime, not consecutive).
- J and Q teachers / trainees / researchers — generally exempt for 2 of the prior 6 calendar years.
- A and G visa-holders (diplomats, international-org employees) — exempt while in that status.
- Professional athletes in the US to compete in a charitable sports event.
“Exempt” means the days physically present in the US do not count toward the SPT formula at all. After the exemption window ends, all subsequent days count normally.
The Closer Connection exception (Form 8840)
If you meet the SPT day count and are present fewer than 183 days in the current year, you may still avoid US tax residency by claiming the Closer Connection Exception. You must show:
- You were in the US fewer than 183 days in the current year.
- You maintained a tax home in a foreign country during the year.
- You had a closer connection to that foreign country than to the US.
“Closer connection” is evaluated on a broad facts-and-circumstances test: location of permanent home, family, business, personal belongings, banking, social and political affiliations, driver’s license, voting registration, etc.
The exception is claimed by filing Form 8840 with the IRS by the relevant filing deadline. If you don’t file, you don’t get the exception.
Treaty tiebreaker (if you’re SPT-resident and home-country-resident)
If the SPT makes you US-resident and you are simultaneously resident in a treaty country, the US tax treaty with that country may let you elect to be treated as a non-resident for US tax purposes. The treaty residence article runs the standard tiebreaker (permanent home → center of vital interests → habitual abode → nationality).
You typically claim this by filing Form 8833 (“Treaty-Based Return Position Disclosure”). The election does not exempt you from filing — it changes how you’re taxed.
Practical implications
If your SPT total is creeping up:
- Track days exactly. Each year matters. Forgetting a 5-day trip from three years ago can flip your residence position.
- Plan year-end travel. A two-week US holiday spanning New Year’s gets split between two years for SPT purposes — useful for managing the count.
- Document your foreign tax home. If you ever need to claim Closer Connection, you’ll need contemporaneous records of your home, work, family, and financial life abroad.
- File the forms. No-file = no exception. Many people who would qualify for Closer Connection lose it by missing the filing deadline.
- Get advice. US tax law is unforgiving and worldwide-tax exposure can dramatically change your situation.
A worked example
You are a Canadian consultant who spends time in the US for work each year:
| Year | Days in US | Weight | Weighted days |
|---|---|---|---|
| 2026 (current) | 130 | × 1 | 130 |
| 2025 | 120 | × 1/3 | 40 |
| 2024 | 100 | × 1/6 | ≈ 16.7 |
| Total | ≈ 186.7 |
You meet the SPT in 2026 (≥31 current-year days, ≥183 weighted). Because you were under 183 in the current year and have a Canadian tax home, you can likely file Form 8840 to claim Closer Connection — and remain a Canadian tax resident.
Related reading
The SPT requires three years of precise day counts. DaysAbroad keeps them automatically — and exports CSV at tax time.