The US substantial presence test, worked through with real dates
The U.S. counts three years at once: all of this year, a third of last year, a sixth of the year before. Here it is with real dates — why 122 days a year is the line, how 128 days can be enough, and why residency can start months before you cross it.
:quality(80))
If you are not a U.S. citizen or green card holder, the United States decides whether you are a tax resident mostly by counting your days. Not the way most people count them, though: the substantial presence test looks at three years at once, and gives each year a different weight.
It is short enough to fit in one sentence and easy enough to get wrong, so here it is worked through with real dates.
The test in one sentence
You meet the substantial presence test for a year if you were in the U.S. on at least 31 days that year, and on at least 183 days over three years, counting:
all the days you were present this year,
a third of the days you were present last year, and
a sixth of the days you were present the year before that.
The IRS's own example: 120 days in each of three years counts as 120 + 40 + 20 = 180. Not resident under the test. One more week a year would have been.
The 122-day rule of thumb
If your pattern is the same every year, the three weights add up to one and a half: a steady 100 days a year counts as 150. That gives a useful number to remember. 121 days a year, every year, stays under (181.5). 122 days a year, every year, lands exactly on 183 — and 183 is enough.
The rule of thumb only works while the years look alike. A long year two years ago still counts for a sixth of itself; a long year last year counts for a third. That is where people get caught.
A worked example
Say you were in the U.S. for 150 days in 2024 and 90 days in 2025, and you arrive on 1 March 2026 planning a long stay. Before you even land, the earlier years already count for something:
2024: 150 days × 1/6 = 25
2025: 90 days × 1/3 = 30
Already counted before your first day in 2026: 55
So 2026 needs only 128 days of its own to reach 183. Arriving on 1 March and staying, your 128th day is 6 July 2026. If your last day in the U.S. that year is 5 July, you finish 2026 at 127 + 55 = 182 and do not meet the test. Stay one more day and you do — and any days you come back for later in 2026 add to the count too.
Notice that nothing in 2026 alone looks alarming. 128 days is barely four months. It is the two earlier years doing the work.
When it reaches backwards
Meeting the test doesn't make you resident from 6 July. Under IRS Publication 519, your residency starting date is generally the first day you were present in the U.S. during that calendar year — 1 March in the example. If you had popped over for a long weekend in January, residency could start in January.
There is a small relief valve: you can leave out up to 10 days of presence when working out that starting date, if on those days you had a closer connection to a foreign country than to the U.S. and your tax home was there. Those days still count towards the 183.
What counts as a day
Any part of a day counts. A flight that lands at 11:50 pm is a day in the U.S. Some days don't count at all, though, and they are worth knowing:
Days you commute to work in the U.S. from a home in Canada or Mexico, if you do it on more than 75% of your workdays.
Days you are in the U.S. for less than 24 hours, in transit between two places outside the U.S.
Days as a crew member of a foreign vessel.
Days you can't leave because of a medical condition that arose while you were in the U.S.
Days as an exempt individual — for example a student on an F, J, M or Q visa (generally for up to 5 calendar years), a teacher or trainee on a J or Q visa (generally 2 of any 6 years), or someone in a foreign-government role.
And "the United States" here means the 50 states and DC, with their territorial waters. It does not include U.S. territories such as Puerto Rico, or U.S. airspace.
Staying legally is not the same as staying non-resident
The visa question and the tax question are separate. Under the Visa Waiver Program each admission can last up to 90 days. Two 75-day visits a year are within that every time — and after two years of it, the tax count is 150 + 50 = 200. Every visit legal; resident under the test in year two.
Over 183 isn't always the end
Meeting the test usually makes you a resident, but not always. The closer connection exception can keep you a nonresident if, for that year, you:
were in the U.S. on fewer than 183 days that year itself,
kept a tax home in one foreign country for the whole year,
had a closer connection to that country than to the U.S., and
had not taken steps towards a green card, or had an application pending.
You claim it on Form 8840, by your tax filing deadline. Note the first condition: it covers the zone where the three-year total crosses 183 but the current year doesn't — the worked example above, for instance. Spend 183 days in a single year and this exception is off the table, though a tax treaty may still decide which country you are resident in.
And the states count separately
The substantial presence test is federal. States have their own residency rules, and they are not the same rule. New York treats you as a resident if you keep a permanent place of abode there for substantially all of the year and spend 184 days or more in the state. California presumes you are a resident if you spend more than nine months of the year there. Different numbers, different conditions, and the federal count doesn't settle either one.
How the app handles it
Track Country Days has the substantial presence test as a ready-made rule. It weights the three years the way the IRS does — this year in full, last year by a third, the year before by a sixth — counts any part of a day, and shows how many days you have left before the weighted total reaches 183.
Two honest limits. The app can't know which of your days are exempt — student or teacher years, regular commuting, short transits — so its count can only run high, never low. And it can only weight days it knows about: if you started using it this year, add your last two years. You can enter trips by hand, or rebuild them from your photo library.
If the 183 number itself is what you're unsure about, the 183-day rule isn't one rule walks through how differently other countries count it.
As always: this is day tracking, not tax or legal advice. We count the days. Whether you are a U.S. resident for tax — and what follows if you are — is a question for a tax professional.
More from this category
:quality(80))
New York statutory residency: 184 days and a place to live
New York can tax you as a full resident even if you live in another state: keep a home there for most of the year and spend 184 days in the state. What counts as a day, what counts as a home, and why the burden of proof is on you.
:quality(80))
The 183-day rule isn't one rule
"Stay under 183 days" is the most repeated line in tax residency, and it hides at least five different rules: which year, what counts as a day, whether 183 is enough, and why staying under it is no safe harbour.