Substantial presence test: how US tax residency days are counted
You meet the substantial presence test — and are treated as a US resident for tax purposes — if you’re in the US for at least 31 days this year and 183 days over three years, counting all of this year’s days, a third of last year’s and a sixth of the year before’s.
Substantial presence test calculator
Count every day you were in the US for any part of it, leaving out the days that don’t count (below). Exempt individuals, such as students on an F or J visa, leave out those years’ days.
How the test works
You meet the substantial presence test for a calendar year if you were physically present in the US on at least:
- 31 days during the current year, and
- 183 days during the 3-year period made of the current year and the two years before, counting:
- all the days you were present in the current year,
- a third of the days in the first year before, and
- a sixth of the days in the second year before.
Example: 120 days in the US in each of three years.
| Year | Days that count | In the example |
|---|---|---|
| Current year | all of them — and at least 31 | 120 |
| First year before | a third | 40 |
| Second year before | a sixth | 20 |
| Total | 183 or more meets the test | 180 — under 183, so the test isn’t met |
How many days a year keep you under the test
Spend the same number of days in the US every year, and 121 days a year keeps you under: 121 + a third of 121 + a sixth of 121 is 181.5. At 122 days a year the total reaches 183 and you meet the test. When the years differ, the calculator above weighs each one for you — and fewer than 31 days in the current year never meets the test, whatever the years before.
Which days count
You’re treated as present on any day you’re in the US at any time during the day. These days don’t count:
- days you commute to work in the US from a home in Canada or Mexico;
- days you’re in the US in transit for less than 24 hours between two foreign places;
- days as a crew member of a foreign vessel;
- days you couldn’t leave because of a medical condition that arose while you were in the US;
- days you’re an exempt individual.
Exempt individuals
Days in these statuses don’t count toward the test:
- foreign government-related individuals (A or G visas, other than A-3 and G-5);
- teachers or trainees on a J or Q visa;
- students on an F, J, M or Q visa;
- professional athletes competing in a charitable sports event.
To exclude these days — or days kept by a medical condition — you file Form 8843 with your tax return.
The exemption runs out:
- Students stop being exempt once they’ve been exempt as a teacher, trainee or student for any part of more than 5 calendar years — unless they show they don’t intend to live in the US permanently and have kept to their visa’s requirements.
- Teachers and trainees aren’t exempt if they were exempt as a teacher, trainee or student for any part of 2 of the 6 preceding calendar years — with an exception when a foreign employer paid them.
The closer connection exception
Even if you meet the test, you can be treated as a nonresident for the year if all of these hold:
- you were in the US for fewer than 183 days during the year;
- you kept a tax home in a foreign country for the entire year;
- you had a closer connection to that country than to the US;
- you haven’t taken steps toward a green card or had an application pending.
You claim it on Form 8840. If you don’t file it on time, you can’t claim the exception unless you can show you took reasonable steps to learn about the filing requirement.
When to file Forms 8840 and 8843
If you file Form 1040-NR, attach them to it. If you don’t have to file a return, mail them to the IRS in Austin by the due date for Form 1040-NR: April 15 if you had US wages subject to withholding, June 15 if you didn’t — April 15 or June 15, 2026, for 2025. Miss it, and you can’t claim the closer connection exception or exclude the days, unless you can show you took reasonable steps to learn about the requirement and meet it.
Meet the test: from when are you a US resident?
Not from January 1. Your residency starting date is the first day you were in the US in the year you meet the test, and you’re a nonresident for the part of the year before it — a dual-status year. Up to 10 days of an earlier visit can be left out of the starting date, with a signed statement to the IRS, if on those days your tax home was abroad and you had a closer connection there; they still count toward the 183.
Leaving works the same way. If you won’t be a US resident at any time next year, your residency ends on December 31 — or on the last day you were in the US, if for the rest of the year your tax home was abroad and you had a closer connection to that country.
Resident in the US and another country? The treaty tie-breaker
The test doesn’t override a tax treaty. If you’re resident in both the US and a treaty country under each country’s own rules, the treaty’s tie-breaker rule settles it. Treated as a resident of the other country, you figure your US tax as a nonresident — on Form 1040-NR with Form 8833 attached — though for other purposes you’re still a US resident.
How FlySee counts it
FlySee doesn’t have a tracker for the substantial presence test. Its Log records the days you’re in the US the same way the test counts them — any part of a day is a day — and its export lists your days by country, so you can weigh each year yourself. The calculator above is the IRS formula: it weighs the days you type in, nothing more.