Menu

Substantial presence test: are you a US tax resident or a nonresident?

The substantial presence test decides whether you are a resident for US tax purposes if you do not have a green card. You are a resident if you were in the US at least 31 days during the current year and at least 183 days during the 3-year period, counting all the days of the current year, a third of the days of the year before and a sixth of the days of the year before that. Some days do not count, and with a closer connection to another country you can stay a nonresident even if you meet the test. In the year you arrive there can be dual status: a nonresident for part of the year and a resident for the rest.

  1. Green card test
  2. Substantial presence test: the formula and examples
  3. Days that do not count
  4. The closer connection exception: Form 8840
  5. The year you arrive: dual status and the first-year choice

Green card test

You are a resident for tax purposes if you were a lawful permanent resident of the US at any time during the year, that is, if you held a green card (Permanent Resident Card, Form I-551). The status continues until you renounce it in writing to USCIS or it is administratively or judicially terminated. If you do not meet the substantial presence test for that year, your residency starts on the first day you are in the US as a lawful permanent resident (if you received the card abroad, on your first day in the US after that). The IRS treats someone as a nonresident if they are not a US citizen and meet neither the green card test nor the substantial presence test.

Substantial presence test: the formula and examples

To meet the substantial presence test, you must be in the US at least 31 days during the current year and at least 183 days during the 3-year period, counting all the days of the current year, 1/3 of the days of the first year before it and 1/6 of the days of the second year before it. Both conditions must be met. You are treated as present on any day you are in the country at any time during the day.

The IRS example: you were in the US on 120 days in each of 2023, 2024 and 2025. For 2025 you count 120 days in 2025, 40 days in 2024 (1/3 of 120) and 20 days in 2023 (1/6 of 120). The total is 180, which is less than 183, so you are not a resident under the test for 2025.

A second example: you arrived on August 1 on an H-1B visa and stayed. In the year of arrival you have 153 days (31 in August, 30 in September, 31 in October, 30 in November and 31 in December), which is less than 183, so the test is not met for that year. The next year, if you spend all 365 days in the US, you get 365 + 51 (1/3 of 153) + 0 (no days in the year before that) = 416: you are a resident, and residency starts on January 1.

Days that do not count

Not counted are days when you regularly commute to work in the US from a residence in Canada or Mexico, days when you are in the US for less than 24 hours in transit between two places outside the US, days as a crew member of a foreign vessel, days when you are unable to leave because of a medical condition that develops while you are in the US, and days as an exempt individual. The term does not mean someone exempt from US tax but someone whose days do not count: a foreign government-related individual under an “A” or “G” visa (other than “A-3” and “G-5”), a teacher or trainee under a “J” or “Q” visa, a student under an “F,” “J,” “M” or “Q” visa, and a professional athlete in the US to compete in a charitable sports event. Work visas such as H-1B are not on this list.

A student’s days do not count while the student does not breach the visa and has been exempt for no more than 5 calendar years: any part of a year counts as a year, and years as a teacher or trainee are included. After that the days do not count only if the student establishes that they do not intend to reside permanently in the US. For teachers and trainees, under Pub. 519, the days count again if they were exempt for any part of two of the six preceding calendar years, unless a foreign employer paid all of their compensation and certain other conditions are met.

To exclude the days of a student, teacher, trainee or athlete, and days of a medical condition, you file Form 8843: it is attached to Form 1040-NR, or, if no return is due, mailed to the IRS by the Form 1040-NR due date, which is April 15 if you were an employee with wages subject to withholding and June 15 if not. Days of a medical condition cannot be excluded without a form filed on time.

The closer connection exception: Form 8840

Even if you meet the test, you can stay a nonresident under the closer connection exception. For that you must be in the US fewer than 183 days during the year, maintain a tax home, the general area of your main place of business, employment or post of duty, in a foreign country throughout the year, and have a closer connection to that country than to the US. The exception is not available to green card holders, to those who applied for a green card or took other steps toward one (the IRS names, for example, Forms I-485, I-130 and I-140), or to those whose tax home was in the US at any time during the year, so it generally does not fit someone who moved to the US to work.

You claim it on Form 8840: it is attached to Form 1040-NR, or, if no return is due, mailed by the Form 1040-NR due date. If the form is not filed on time, the exception is lost and you may be treated as a resident, unless you show by clear and convincing evidence that you took reasonable actions to become aware of the requirement and significant steps to comply with it.

The year you arrive: dual status and the first-year choice

If you meet the test in the year you arrive, you are generally a resident from your first day in the US that year, and before it a nonresident. For example, you arrived on March 1 on an H-1B visa and stayed: the year gives 306 days (31 in March, 30 in April, 31 in May, 30 in June, 31 in July, 31 in August, 30 in September, 31 in October, 30 in November and 31 in December), the test is met, you are a resident from March 1 and a nonresident until the end of February. That is dual status, most common in the years of arrival and departure. For the year of arrival you file Form 1040 marked “Dual Status Return”, with a statement of the income of the nonresident part of the year, which can be Form 1040-NR. You cannot take the standard deduction on it, and a joint return is possible only by election, if your spouse is a US citizen or resident.

If you arrived late, as in the August 1 example, and did not reach 183 days in the year of arrival but will meet the test the next year, you can choose to be treated as a resident for part of the year of arrival. You must be in the US at least 31 days in a row and at least 75% of the days from the first day of that period to the end of the year; for the 75%, up to 5 days of absence count as days of presence. You make the choice by a statement attached to Form 1040, and you can file it only after you have met the test for the next year: until then you can extend the filing deadline with Form 4868. The choice cannot be revoked without the IRS’s approval.

If you are a resident under the test, you file a Form 1040 return: we prepare it together with one state return from $280, and other prices are on the pricing page. What nonresidents file, Form 1040-NR and Form 8843, is described on the page about the nonresident return.

Questions and answers

What is the substantial presence test and how do you count the days?

You are a resident for tax purposes if you were in the US at least 31 days during the current year and at least 183 days during the 3-year period, counting all the days of the current year, 1/3 of the days of the year before and 1/6 of the days of the year before that. The IRS example: 120 days in each of 2023, 2024 and 2025 give, for 2025, 120 + 40 + 20 = 180, which is less than 183, so the test is not met.

Do an F-1 student's days count for the substantial presence test?

No, as long as the student does not breach the visa and has been exempt for no more than 5 calendar years: any part of a year counts as a year, and years as a teacher or trainee are included. After that the days do not count only if the student establishes that they do not intend to reside permanently in the US. To exclude the days, you file Form 8843.

Is a green card holder a tax resident?

Yes: you are a resident for tax purposes if you were a lawful permanent resident of the US at any time during the year, and no day count is needed. The status continues until the holder renounces it in writing to USCIS or it is administratively or judicially terminated.

What is Form 8840 and who can use it?

Form 8840 is how you claim the closer connection exception, to stay a nonresident even if you meet the substantial presence test. The exception needs fewer than 183 days in the US during the year, a tax home in a foreign country throughout the year and a closer connection to it; it is not available to green card holders, to those who applied for a green card or to those whose tax home was in the US.

What is dual status?

It is a tax year in which someone is both a nonresident and a resident: most often the year of arrival or departure. In the year of arrival, residency generally starts on the first day in the US that year, and before it the person is a nonresident. For the year of arrival the return is filed on Form 1040 marked "Dual Status Return", with a statement of the income of the nonresident part of the year; the standard deduction cannot be used, and a joint return is possible only by election, if the spouse is a US citizen or resident.

Sources

This article explains general rules and does not replace advice on your own situation, which may differ.

Read next

Leave a request

Tell us what you need, and we will call you back.

Request sent

We will call or write back.

Close

We will call or write back

Do not include an SSN or ITIN. Documents go through the client portal

Privacy policy

A free 15-minute call

We briefly go over your situation, which of our services fit and how to start. The call is free for new clients; it is an introduction, not a tax consultation.