Borderbook

Substantial Presence Test Calculator (US 183-Day Test)

Estimate, not legal or tax advice

Enter your days in the United States, or your trips, for the year you are testing and the two years before it. The calculator applies the IRS formula with exact fractions. Tick any Publication 519 categories that apply to you to leave those days out.


How do you want to enter your days?

Days in the United States

Count every day you were in the 50 states or DC at any time of the day, including the days you arrived and left.

Days that are not counted

Tick only the categories that apply to you, then enter those days. Days you do not mark are counted.

Days you are temporarily in the US as a foreign government-related individual under an A or G visa (not A-3 or G-5). A and G visa holders do not file Form 8843 for this. Publication 519.

Days as a teacher or trainee on a J or Q visa who substantially complies with the visa's requirements. Publication 519 says you are not exempt as a teacher or trainee for a year if you were exempt as a teacher, trainee or student for any part of 2 of the 6 preceding calendar years, unless further conditions are met. Form 8843 is needed to exclude these days. Publication 519.

Days as a student on an F, J, M or Q visa (for example F-1) who substantially complies with the visa's requirements. Publication 519 says you are not exempt as a student if you have been exempt as a teacher, trainee or student for any part of more than 5 calendar years, unless you meet two further requirements. Form 8843 is needed to exclude these days. Publication 519.

Days as a professional athlete temporarily in the US to compete in a charitable sports event. Publication 519 says you can exclude only the days on which you actually competed, not practice days. Form 8843 is needed to exclude these days. Publication 519.

Days you commute to work in the US from a residence in Canada or Mexico, if you commute regularly: on more than 75% of the workdays in your working period. Publication 519.

Days you are in the US for less than 24 hours, in transit between two places outside the US. Publication 519 says you are not in transit if you attend a business meeting while in the US. Publication 519.

Days you are temporarily in the US as a regular crew member of a foreign vessel (boat or ship) engaged in transportation between the US and a foreign country or a US territory. Not on days you otherwise engage in any trade or business in the US. Publication 519.

Days you intended to leave but could not, because of a medical condition or problem that arose while you were in the US. Form 8843 is needed. Form 8843 is needed to exclude these days. Publication 519.

Days in the US under a NATO visa as a member of a force or civilian component to NATO. Family members under a NATO visa count every day. Publication 519.

Result

Your numbers stay in this browser and in the part of the link after #, which is never sent to our server. A shared link holds the days, dates and ticked categories you entered (a category can reveal a visa type or a medical condition), nothing else.

Information only, not tax, immigration or legal advice. Check with the IRS, the CRA and your province, or a qualified adviser, before you rely on a count.

How the test is counted

The IRS test has two numbers. You meet it for a calendar year if you were in the United States on at least 31 days in that year, and on at least 183 days in the 3-year period of that year and the 2 years before it, counting all the days of the current year, 1/3 of the days of the first year before and 1/6 of the days of the second year before.

Any part of a day counts: the IRS treats you as present on any day you are physically in the country, at any time during the day. This calculator counts days in the 50 states and the District of Columbia. The IRS definition of the United States also includes the territorial waters and certain adjacent seabed and subsoil, and leaves out US territories and US airspace.

The fractions are not rounded. 100 days in the year before add 33 1/3 days, and a weighted total of 182 5/6 is under 183.

Some days are not counted, but only for people they apply to: exempt individuals (some visa holders, such as F-1 students), regular commuters from Canada or Mexico, transit of less than 24 hours, crew of foreign vessels, a medical condition that kept you in the US, and NATO visa holders. The IRS needs Form 8843 for some of these.

Meeting the formula is not the whole answer. The closer connection exception (Form 8840) and tax treaties can still apply, and green card holders are tested differently. This page shows the count only.

The closer connection exception (Form 8840)

Even if the formula is met, the IRS may treat you as a nonresident under the closer connection exception. Excerpts from its conditions (the full list, and the rules for two foreign countries, are on the IRS page):

Were present in the United States less than 183 days during the year, and

Had a closer connection during the year to one foreign country in which you had a tax home than to the United States

Maintained a tax home in that foreign country during the entire year

Had not taken steps toward, and did not have an application pending for, lawful permanent resident status (green card).

IRS, closer connection exception page.

You must file Form 8840, Closer Connection Exception Statement for Aliens, to claim the Closer Connection Exception.

Read the closer connection exception (IRS) · Form 8840 (IRS). Fewer than 183 days in the year is one of the conditions, never the whole test. Tax treaties can also apply; see Publication 519.

Canadian? The snowbird day counter counts US days and days out of Canada from your trips.

Questions

How many days can I spend in the US before I meet the substantial presence test?

It depends on the two years before. With no days in those years, 183 days in the current year meet it. If you spend the same number of days in the US every year, 121 days a year give a weighted total of 181 1/2 and 122 days give exactly 183.

What is the 31-day rule?

You do not meet the test for a year in which you were in the US on fewer than 31 days, however large the weighted total is.

Do the days I arrive and leave count?

Yes. The IRS counts any day you are physically in the US, at any time during the day.

Do days on an F-1 student visa count?

Days as a student on an F, J, M or Q visa who substantially complies with the visa's requirements are days as an exempt individual and are not counted, within the limits in Publication 519 (generally not after being exempt as a teacher, trainee or student for any part of more than 5 calendar years). The IRS needs Form 8843 for these days. Tick the student box and enter those days.

Do Puerto Rico or other US territories count?

No. The IRS says the United States for this test does not include US territories or US airspace. This calculator counts days in the 50 states and the District of Columbia.

Is this how long I may stay as a visitor?

No. This is a tax day count. How long a visitor may stay is set by US immigration rules when you enter, which is a separate question.

Sources