About the Substantial Presence Test Calculator
This substantial presence test calculator applies the IRS rule that decides whether a non-US citizen without a green card is treated as a US resident for federal income tax purposes. You meet the test if you were physically present in the United States on at least 31 days during the current year and on 183 days or more over three years, counting every day of the current year, one third of the days in the previous year and one sixth of the days in the year before that.
It is for foreign workers, visiting researchers, retirees who winter in the US (“snowbirds”), remote workers and anyone planning how long they can stay without becoming a US tax resident. Besides the yes/no answer it shows your weighted day count, how many days this year would trigger residency and whether the closer connection exception might apply.
Enter only the days that count. The IRS excludes days you commute from Canada or Mexico, transit days of under 24 hours between two foreign points, days as crew of a foreign vessel, days you could not leave because of a medical condition, and days as an exempt individual (for example many F, J, M and Q visa students and teachers, and A or G visa diplomats). Tax treaties can also override the result. The rules shown apply to the 2026 tax year and have been unchanged for many years.
How to use the substantial presence test calculator
- 1Enter the tax year you are testing.
- 2Count the days you were physically in the US in that year, leaving out excluded and exempt-individual days.
- 3Enter the countable days for each of the two previous calendar years.
- 4Read the result and your weighted day count.
- 5Use the days-to-meet and maximum-days figures to plan the rest of the year, and check the closer connection exception if you are close.
Formula and method
The IRS substantial presence test has two parts that must both be satisfied. First, you must be physically present in the United States for at least 31 days in the current year. Second, the sum of all current-year days, one third of the prior year’s days and one sixth of the days from two years ago must be at least 183. Any part of a day in the US normally counts as a full day, apart from the listed exclusions.
The days-to-meet figure solves the formula for the current year: the larger of 31 and 183 minus the weighted prior-year days, rounded up. The maximum safe days is one less than that (never below 30). Meeting the test generally makes you a resident alien starting from your first day of presence that year, unless the closer connection exception or a tax treaty tie-breaker applies.
- D₀
- Countable days present in the current year
- D₁
- Countable days present in the first preceding year
- D₂
- Countable days present in the second preceding year
Worked examples
120 / 150 / 180 days — meets the test
Counting all 120 current-year days, 50 (one third of 150) from last year and 30 (one sixth of 180) from the year before gives 200 weighted days. That is over 183 and the 31-day minimum is met, so the test is met. Because the current-year count is under 183, the closer connection exception may apply.
120 days in each of three years (IRS-style example)
All 120 days this year, plus 40 from last year and 20 from two years ago, total 180 weighted days — three short of 183, so the test is not met. A further three days in the US this year (123 in total) would tip the balance.
Former resident with only 25 days this year
The weighted count is 25 + 121.67 + 60.83 = 207.5, well over 183, but only 25 days were spent in the US this year. The 31-day requirement is not met, so the test fails; staying up to 30 days is safe.
Frequently asked questions
What is the substantial presence test?+
It is the IRS test that treats a non-citizen without a green card as a US resident for tax purposes. You meet it if you were in the US at least 31 days in the current year and at least 183 days over the current and two prior years, counting all current days, one third of last year’s and one sixth of the year before.
Which days do not count toward the substantial presence test?+
The IRS excludes days you commute to work from Canada or Mexico, days in transit for under 24 hours between two foreign places, days as a crew member of a foreign vessel, days you could not leave because of a medical condition that arose while in the US, and days as an exempt individual such as qualifying students, teachers and diplomats.
What is the closer connection exception?+
Even if you meet the test, you can be treated as a nonresident if you were present fewer than 183 days in the current year, kept a tax home in a foreign country all year, had a closer connection to that country than to the US, and had not taken steps toward (or had pending) an application for a green card. You claim it by filing Form 8840 with the IRS.
Do partial days count as full days?+
Yes. Any day you are physically present in the United States at any time counts as a day of presence, unless one of the specific exclusions applies, such as being in transit for less than 24 hours between two foreign locations.
Can a tax treaty override the substantial presence test?+
Yes. If you are a resident of both the US and a treaty country, the treaty’s tie-breaker rules may make you a resident of the other country for tax purposes. You generally disclose this on Form 8833 and file as a nonresident.
Tax results are estimates based on published rules and simplified assumptions. They are not tax advice — check official guidance or a tax professional for your situation.