The Substantial Presence Test, explained with examples
If you are not a US citizen and don't hold a green card, the US decides whether you are a tax resident for a year mainly by counting your days. That count is the Substantial Presence Test (SPT). It looks simple, and then the fractions catch people out. This page walks through how it works, with the numbers worked out.
This page summarises the published rule and links the official texts. It is not tax or legal advice. Your situation may have facts a day count can't see, so ask a cross-border tax adviser about your own case.
The rule in two lines
You meet the Substantial Presence Test for a calendar year if both are true:
- You were in the US on at least 31 days that year, and
- Days this year + 1/3 of the days last year + 1/6 of the days the year before add up to 183 or more.
The source is the Internal Revenue Code, 26 U.S.C. §7701(b)(3), explained in IRS Publication 519, chapter 1.
Three details matter:
- It is 183 or more. Exactly 183 meets the test.
- The fractions are not rounded. 98 days last year is 32 2/3, not 33. The regulation says so plainly (Treas. Reg. §301.7701(b)-1(c)).
- The window is the calendar year, 1 January to 31 December, looking back over three years.
What counts as a day
Any part of a day counts. Arrive at 11 pm and that day counts. Drive down in the morning and back at night, and that day counts too. Arrival and departure days are both US days.
Some days don't count (Treas. Reg. §301.7701(b)-3, Pub 519):
- Commuting from Canada or Mexico: days you commute to work in the US from your home in Canada or Mexico, if you do it regularly.
- Transit: less than 24 hours in the US while travelling between two places outside the US. A business meeting during the layover spoils it.
- Medical: days you meant to leave but couldn't because of a medical condition that started while you were in the US. You claim these on Form 8843.
- Exempt individuals: some students, teachers, trainees and diplomats, within the limits Pub 519 sets.
- Crew of foreign vessels travelling between the US and abroad.
Puerto Rico, Guam and the other US possessions are not "the United States" for this test, and neither is US airspace. A flight over the US without landing is not a US day.
Worked examples
1. The IRS example: 120 days a year
From Publication 519: you were in the US 120 days in each of the three years.
| Year | Days | Weight | Counted |
|---|---|---|---|
| This year | 120 | 1 | 120 |
| Last year | 120 | 1/3 | 40 |
| Year before | 120 | 1/6 | 20 |
| Total | 180 |
180 is under 183, so the test is not met.
2. One more day a year: 122
122 + 40 2/3 + 20 1/3 = 183. The test is met, exactly at the line. This is the first example in the regulation.
3. The steady snowbird ceiling: 121 days
If you spend the same number of days in the US every year, the three weights add up to 1.5. So:
- 121 days a year gives 181.5. Not met.
- 122 days a year gives 183. Met.
That is where the common "about four months a year" advice comes from. It only holds if every year is the same. One long winter raises the count for the next two years.
4. Why rounding gets it wrong
This year 150 days, last year 98, the year before 0.
150 + 98/3 = 150 + 32 2/3 = 182 2/3. Not met. A calculator that rounds 32.67 up to 33 says 183 and gets it wrong.
5. How many days can I still spend this year?
Say you spent 150 days in the US in each of the last two years. Before this year starts you already carry:
150/3 + 150/6 = 50 + 25 = 75.
You meet the test once this year's days reach 183 − 75 = 108. So you can spend 107 days this year and stay under it. Day 108 meets it.
6. A Florida winter, Canadian style
You spend 1 January to 15 April and 1 November to 31 December in Florida, every year.
- 2026: 105 days (January to 15 April) + 61 days (November and December) = 166.
- Same pattern in 2025: 166. In 2024, a leap year: 167.
- 166 + 166/3 + 167/6 = 166 + 55 1/3 + 27 5/6 = 249 1/6.
The test is met. But this year's days (166) are under 183, so the closer connection exception below may be open to you.
The closer connection exception and Form 8840
Meeting the test doesn't always make you a US tax resident. You can be treated as a non-resident under the closer connection exception if all of these are true (IRS page):
- you were in the US fewer than 183 days this year,
- you kept a tax home in one foreign country for the whole year,
- you had a closer connection to that country than to the US, and
- you had not applied for, or taken steps toward, a green card.
You claim it on Form 8840. If you file a US return, you attach it. If you don't, you mail it on its own by the due date for Form 1040-NR. For 2025 returns, Publication 519 gives 15 April 2026 if you had US wages with withholding, and 15 June 2026 if you didn't. The same dates apply in later years unless they fall on a weekend or holiday. File late without clear and convincing evidence that you tried to comply, and you generally lose the exception.
If you were in the US 183 days or more this year, the closer connection exception is closed. A tax treaty tie-breaker may still apply. That is a question for a cross-border adviser.
Not the same as other day counts
- US immigration limits are separate. Staying within the tax test says nothing about how long border officers allow you to stay.
- Registration after 30 days. Since April 2025, many visitors aged 14 or over who stay 30 days or more and aren't already registered, including Canadians who entered by land without an I-94, must register with USCIS. See the USCIS alien registration page.
- Your home side still counts too. A Canadian snowbird also watches Canada's own rules, such as the provincial health plan minimum. See our page on Ontario's 153 days.
- US states have their own tests. New York, for example, counts more than 183 days plus a permanent place of abode. See the 183-day rule.
Keeping the count
The test needs three calendar years of days, and gaps hurt. A day you can't account for is a day an auditor may count against you. Write the days down as they happen: a paper diary works, so does a spreadsheet.
If you want an app for it, I built Sojournal for exactly this count. It's free for unlimited days, with one rule at a time, and the Substantial Presence Test can be that rule. It keeps the 1/3 and 1/6 exact, lets you flag transit, medical and commuter days, shows the days you have left this year and the last safe day, and reminds you about Form 8840. It has no location permission and no account, and your days stay on your phone. Pro (one payment, no subscription) counts every rule at once, so the SPT and Ontario's 153 days side by side.
Official sources
- 26 U.S.C. §7701(b), definition of resident alien
- Treas. Reg. §301.7701(b)-1, the test, fractions, territory, examples
- Treas. Reg. §301.7701(b)-3, days not counted
- IRS Publication 519 (2025), U.S. Tax Guide for Aliens
- IRS: closer connection exception (page reviewed 16 July 2026)
- About Form 8840 · About Form 8843
- USCIS: alien registration requirement
Sources checked 22 October 2026. Rules change and Publication 519 is reissued every year. This page is not tax or legal advice.