Substantial presence test calculator for the IRS 183-day rule

This substantial presence test calculator checks your US trips against the IRS test. You meet the test with at least 31 days in the US this year and 183 days over three years, counting each day this year in full, each day last year as a third and each day the year before as a sixth. Official sources: the IRS page on the substantial presence test and IRS Publication 519.

Trips to the US

Both the entry date and the exit date count. Leave out days the IRS does not count, listed below. Your dates are not saved or sent anywhere.

Result

Current year
Not set
Not set
First year before
Not set
Not set
Second year before
Not set
Not set
Weighted total
Not set
31-day part
Not set
183-day part
Not set
Substantial presence test
Not set
Days left
Not set

Days left is how many more days you can spend in the US in the selected year without meeting the test. The weighted total keeps the thirds and sixths exact rather than rounding them. The result is a day count under the IRS formula.

How the substantial presence test counts days

To meet this test, you must be physically present in the United States (U.S.) on at least: 31 days during the current year, and 183 days during the 3-year period that includes the current year and the 2 years immediately before that, counting: all the days you were present in the current year, and 1/3 of the days you were present in the first year before the current year, and 1/6 of the days you were present in the second year before the current year.

You are treated as present in the U.S. on any day you are physically present in the country, at any time during the day.

The IRS's own example is 120 days in the US in each of 2023, 2024 and 2025. To see it here, set the year to 2025 and enter a trip from 1 May to 28 August in each of those years. Each trip is 120 days, because the entry date and the exit date both count. The calculator counts all 120 days of 2025, 40 for 2024 (a third of 120) and 20 for 2023 (a sixth of 120), a weighted total of 180. The 31-day part is met and the 183-day part is not, so the test is not met for 2025. Move the end of the 2023 trip to 29 August and the total becomes 180 1/6, because the calculator keeps the sixths and does not round them.

In that example, days left is 2: a 123rd day in 2025 would bring the total to exactly 183 and meet the test. It does not matter when in the year those days fall, so you can stay on after a trip or come back later. To check a trip you are planning, enter it with the others and the result counts it like any other trip. A day that two trips share counts once. Even when your two earlier years reach 183 on their own, you can spend 30 days in the current year without meeting the test, because it also needs 31 days in that year.

Days the IRS does not count

The IRS does not count these as days of presence in the US:

This calculator counts every day of the trips you enter, so leave those days out. Time in US territories such as Puerto Rico and Guam does not count either, because for this test the United States covers the 50 states and the District of Columbia.

If you meet the test with fewer than 183 days in the US in the year itself, the IRS can still treat you as a nonresident under the closer connection exception, which is claimed on Form 8840.

Questions about the substantial presence test

How is the substantial presence test calculated?

Add all of your days in the US this year, one third of your days there last year and one sixth of your days the year before: you meet the test when that total reaches 183 and at least 31 of the days fall this year. The IRS example is 120 days in each of 2023, 2024 and 2025, which gives 120 + 40 + 20 = 180 for 2025, so the test is not met. The calculator keeps the thirds and sixths exact instead of rounding them.

Do the entry day and the exit day both count?

Yes. The IRS counts any day you are in the US at any time during the day, so the day you arrive and the day you leave both count in full. A trip from 1 May to 28 August is 120 days, and a day covered by two trips counts once.

How many days can I spend in the US without meeting the test?

Up to 182 days this year if you spent no days in the US in the two years before, and fewer the more days you spent there, since a day last year counts as a third and a day the year before as a sixth. With 120 days in each of 2023 and 2024, you can spend 122 days in 2025 without meeting the test. Even when your earlier years reach 183 on their own, you can spend 30 days this year, because the test needs 31 days in the current year. The calculator shows this as days left.

Which years does the calculator count?

The year you select and the two calendar years before it. Choose 2026 and it counts your days in 2024, 2025 and 2026, from 1 January to 31 December of each, and days outside those years do not count.

Do days on a student visa count?

Not while you are an exempt individual: a student on an F, J, M or Q visa who complies with its terms does not count those days, usually for up to five calendar years. Teachers and trainees on a J or Q visa are generally exempt for two calendar years. Leave the days you are exempt out of the trips you enter.

Geostay records the days and counts each rule the way that rule counts them.

The app records which country your iPhone is in each day, even when it is closed, so there are no trips to type in. Its US Substantial Presence Test counter adds this year's days, a third of last year's and a sixth of the days of the year before.

Download on the App Store