Substantial Presence Test Calculator
You are a U.S. resident for tax purposes if you were in the U.S. at least 31 days this year and 183 days over three years — counting all days this year, 1/3 of last year's and 1/6 of the year before. Enter your days to see whether you meet the test and how many more days you can spend this year.
The calculator needs JavaScript.
How the test is counted
You meet the substantial presence test for a calendar year if you were physically in the United States on:
- at least 31 days during that year, and
- 183 days during the three-year period: all the days in that year, plus 1/3 of the days in the year before, plus 1/6 of the days two years before.
Example: 120 days in 2026, 150 in 2025 and 90 in 2024 give 120 + 50 + 15 = 185 — the test is met for 2026. With 100 days in 2026 instead, the total is 165 and it isn't. Staying 120 days every year falls just short: 120 + 40 + 20 = 180. The IRS uses the same example.
When you pass the test: a dated example
You spent 40 days in the U.S. in 2024 and 90 in 2025, and arrive on 1 March 2026 to stay. Last years add 90 ÷ 3 + 40 ÷ 6 = 36.7 days, so you need 147 days in 2026. Counting 1 March as day 1, you reach them on Saturday 25 July 2026 — from then on you meet the test for 2026.
The 31-day minimum matters too: with 360 days in 2024, 360 in 2025 and 30 in 2026, the weighted total is 30 + 120 + 60 = 210, but 30 days is under 31, so you don't meet the test for 2026.
Days that don't count
- Regular commuting to work in the U.S. from a home in Canada or Mexico — “regular” means on more than 75% of your workdays.
- Transit: less than 24 hours in the U.S. between two places outside it. A business meeting, even at the airport, isn't transit.
- Crew of a foreign vessel.
- Medical condition: days you intended to leave but couldn't, because of a condition that arose while you were in the U.S.
- U.S. territories and airspace aren't the United States for this test.
- Exempt individuals — see the table below.
The calculator doesn't remove these days for you: enter only the days that count.
Who is an exempt individual?
| Category | Visa | Limit |
|---|---|---|
| Foreign government-related individual | A or G (not A-3 or G-5) | — |
| Teacher or trainee | J or Q | Not exempt if you were exempt as a teacher, trainee or student in any part of 2 of the 6 previous years |
| Student | F, J, M or Q | Usually up to 5 calendar years |
| Professional athlete | — | Only for a charitable sports event |
“Exempt” means your days don't count — not that you're exempt from tax.
Form 8843
To exclude days as an exempt individual or because of a medical condition, file Form 8843 with your tax return, or on its own by the return due date if you don't have to file. Without it, the IRS says you cannot exclude those days, unless you can show you took reasonable steps to comply. Foreign government-related individuals (A or G) don't file it.

Meeting the test isn't always the end
Closer connection exception. If you were in the U.S. fewer than 183 days in the year itself, kept a tax home in another country for the whole year and had a closer connection to it, you can be treated as a nonresident by filing Form 8840 — this is the usual route for Canadian snowbirds. It isn't available if you took steps toward a green card that year.
Tax treaty tie-breaker. If you are resident in the U.S. and in a treaty country, the treaty can make you a nonresident for figuring your tax. You claim it on Form 1040-NR with Form 8833 attached — and for other purposes you are still treated as a U.S. resident.
When your U.S. residency starts and ends
If you meet the test, your residency usually starts on the first day you were in the U.S. that year. You can leave out up to 10 days of presence if on those days your tax home and closer connection were in another country — but those days still count for the test. Residency normally ends on 31 December, or on your last day in the U.S. if after that your tax home and closer connection were abroad. A year that is part nonresident and part resident is a dual-status year.
First-year choice. If you don't meet the test this year but will next year, you may choose to be a resident for part of this year: at least 31 days in a row in the U.S., and presence on at least 75% of the days from the start of those 31 days to 31 December (up to 5 days away count as present).
Substantial presence test vs green card test
A green card holder is a U.S. tax resident under the green card test, whatever the number of days. The substantial presence test is for everyone else who isn't a U.S. citizen. A green card holder who claims to be a resident of a treaty country under a tie-breaker is treated as a nonresident for figuring tax.
Canadian snowbird? See how long a Canadian can stay in the US — visits, registration, Form 8840 and provincial health rules.
Questions
Does any part of a day count?
Yes. Being in the U.S. at any time during a day counts as a full day, apart from the exceptions above. For this test, U.S. territories are not part of the United States, so days there are not counted.
Does the substantial presence test apply to F-1 students?
Usually not at first: as an F-1 student you are an exempt individual for days in any part of 5 calendar years, so those days don't count. After that, the days count like anyone else's.
Does it apply to U.S. citizens or green card holders?
No. U.S. citizens are taxed as citizens, and green card holders are residents under the green card test regardless of days.
Is this the same as a state's 183-day rule?
No. The substantial presence test is federal. States have their own residency rules — some count 183 days, some look at where your home is: see 183 days in U.S. states. A state can also make you a resident while the federal test doesn't, and two states can both claim you: see can you be a resident of two states. New York, for one, counts any part of a day and asks you to prove the count in an audit: see New York residency audit. U.S. citizens living abroad have a different day test — the FEIE 330-day test, explained with the rest of their taxes in digital nomad taxes.
What if I meet the test for only part of the year?
Then the year is usually dual-status: nonresident before your residency starting date and resident after it (see above). The filing rules differ, so this is a question for a tax professional.
Where do I find my days?
The I-94 travel history on the CBP website lists your recent entries and exits. Daysafe records the days automatically on your iPhone.
Let your iPhone count the days
Daysafe records which country and U.S. state you're in each day and keeps the substantial presence count up to date — this year, last year and the year before. No account; your days stay on your phone.
Get Daysafe on the App Store · How it works · Schengen calculator
Sources
IRS, Substantial Presence Test; Publication 519 (2025): commuters, transit, exempt individuals, residency dates, first-year choice, Form 8833; Form 8840 and Form 8843. Checked on 13 October 2026. Daysafe is a day counter, not tax advice. Made by Denis Chudinov.