International Taxes

US tax resident or nonresident: the substantial presence test

Your tax status decides which return you file and which income the US taxes. Here is how to count days under the substantial presence test, who can exclude them, and what to do in the year you move.

Updated 10 min readNova Tax · reviewed by an Enrolled Agent

The first question in any tax return for someone who recently moved to the US is whether you are a US tax resident or a nonresident. Tax status is not directly tied to your visa and is not the same as your immigration status. Someone on an H-1B work visa can become a tax resident in their very first year, while a student on an F-1 can stay a nonresident for years. For foreign nationals, the IRS uses two tests: the green card test and the substantial presence test.

Why your status matters

Your status affects almost everything about your taxes:

  • a resident alien pays US tax on worldwide income: wages in the US, rent from an apartment in another country, interest on a foreign bank deposit. A resident files Form 1040, can take the standard deduction, and reports foreign accounts;
  • a nonresident alien pays tax mainly on US-source income and files Form 1040-NR.

Getting your status wrong is a common reason for IRS letters: a nonresident files a 1040 through popular tax software and claims credits they were not entitled to, or a resident leaves out foreign income.

Green card test: a resident from day one

If at any point during the calendar year you were a lawful permanent resident (a green card holder), you are a tax resident for that year. Residency starts on the first day you were in the US with a green card.

That status lasts until the green card is revoked or you formally give it up, for example by filing Form I-407. If you have left the US but your green card is still valid, the IRS still treats you as a resident, and you must report your worldwide income.

The substantial presence test: 31 days and 183 days

If you do not have a green card, you are a US tax resident for a year in which you were physically present in the country:

  1. at least 31 days in the current year, and
  2. at least 183 days over three years using this formula: all days in the current year + 1/3 of the days in the prior year + 1/6 of the days in the year before that.

A day of presence is any day you were in the US for at least part of the day, including the days you arrive and depart.

Example. You work on an O-1 visa and were in the US 180 days in 2024, 150 days in 2025 and 130 days in 2026. For 2026: 130 + 150 ÷ 3 + 180 ÷ 6 = 130 + 50 + 30 = 210 days. That is more than 183, and you were in the US more than 31 days in 2026, so you are a US tax resident for 2026, even though you spent less than half of 2026 in the country.

For comparison, the IRS example: 120 days in each of three years gives 120 + 40 + 20 = 180 days. That is less than 183, so the test is not met.

Days that do not count

The substantial presence test does not count days when you:

  • regularly commuted to work in the US from your home in Canada or Mexico;
  • were in the US for less than 24 hours in transit between two other countries;
  • worked as a crew member of a foreign vessel;
  • could not leave because of a medical condition that arose while you were already in the US;
  • were an exempt individual (more on this below).

Residency under this test usually starts on your first day in the US that year. Up to 10 days of earlier short visits can be disregarded when setting your residency start date by attaching a statement to your return, but they still count toward the 183 days.

Exempt individuals: who can exclude days

An exempt individual is not someone exempt from tax but someone whose days do not count toward the test. The detailed rules are on the IRS page on the substantial presence test. For our clients, three groups matter most.

Students on F-1, J-1, M-1 and Q visas

A student who complies with their visa terms does not count days until they have been an exempt individual for some part of more than 5 calendar years. These are calendar years: if you arrived in December, that December is already your first year. After five years, your days start counting toward the test. You can stay a nonresident beyond that only if you show that you do not intend to live in the US permanently and are complying with your visa terms.

Teachers and trainees on J-1 and Q visas

Researchers, teachers and trainees on a J-1 or Q visa do not count days unless they were an exempt individual for some part of two of the six preceding calendar years. In practice, this usually means the first two calendar years.

Form 8843

To exclude days as an exempt individual, you need to file Form 8843, a short statement explaining why you are not counting your days of presence. It is filed even with no income, and separately for each family member, for example a spouse and children on F-2 or J-2 visas. If you file a return, attach the form to it. If no return is required, mail the form to the address in the instructions by the 1040-NR due date. Filing late usually means losing the right to the exclusion.

The closer connection exception and Form 8840

If you reach 183 days under the formula but spent fewer than 183 days in the US in the current year, you can remain a nonresident under the closer connection exception, meaning a closer connection to another country. To qualify:

  • your tax home (your main place of work or business) must have been in a single foreign country for the whole year;
  • your connection to that country must be closer than your connection to the US: family, home, banks, work;
  • you must not have applied for a green card or have such an application pending.

The exception is claimed on Form 8840. Attach it to your return, or if no return is required, send it to the IRS by the 1040-NR due date. Without a timely filed form you cannot use the exception, unless you show that you made an effort to comply.

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

Dual-status: two parts of one year

In the year you arrive or leave, you are often a resident for only part of the year. This is a dual-status year, a year with two statuses. If you are a resident on December 31, you file Form 1040 marked "Dual-Status Return" with a statement showing your income for the nonresident period. If you are a nonresident at year-end, it is the reverse: Form 1040-NR with a statement.

Limits for that year: you cannot take the standard deduction, you cannot file as head of household, and you cannot file a joint return unless you chose resident status together with a spouse who is a US citizen or resident.

First-year choice: a resident from mid-year

If you arrived late in the year and did not reach 183 days, but will reach them next year, you can choose resident status starting in the year you arrived. The conditions:

  • in the year you arrived, you were in the US for at least 31 days in a row;
  • from the start of that period to the end of the year, you were in the US for at least 75% of the days.

You can file that return only after the test is met the following year, so people usually request an extension on Form 4868.

A nonresident spouse

If at the end of the year one spouse is a US citizen or resident and the other is a nonresident, the couple can choose to treat the nonresident as a resident for the whole year and file a joint Form 1040. The cost of that choice is that the worldwide income of both spouses is taxed in the US.

Form 1040 or 1040-NR: how the returns differ

Resident — Form 1040 Nonresident — Form 1040-NR
Income taxed worldwide income mainly US-source income
Standard deduction yes generally no
Joint return with spouse allowed not allowed (except by choosing resident status)
Filing deadline April 15 April 15 if you had wages with withholding, otherwise June 15
Foreign accounts FBAR and other reporting usually not required

A resident with accounts outside the US may have to file an FBAR. A nonresident generally does not need to worry about that, but it is important for them to get the source of income right. Learn more about how we prepare nonresident returns on the service page.

Tax treaties

US tax treaties with other countries can change the rules for students, teachers and people who are residents of two countries at once. However, since August 16, 2024, most of the US–Russia tax treaty has been suspended, including the articles on types of income. So you generally cannot count on its benefits now. If you are a tax resident of another country, check that country's treaty with the US. ITIN (a tax ID number for people without an SSN) is a separate topic, and we will cover it later.

Checklist: are you a US tax resident?

  1. Check whether you had a green card for even one day of the year. If so, you are a resident from that day.
  2. Write down your entry and exit dates for three years. It helps to check them against your travel history on the CBP website (I-94).
  3. Remove the days that do not count: exempt individual days, transit, medical conditions.
  4. Apply the formula: current year + 1/3 of last year + 1/6 of the year before.
  5. If you are a student or on a J-1, file Form 8843, even with no income.
  6. If you reach 183 days but were in the US fewer than 183 days this year, look into the closer connection exception and Form 8840.
  7. In the year you move, decide what works better: dual-status, the first-year choice, or a joint return with your spouse.

All the rules are covered in detail in Publication 519, the IRS tax guide for aliens. If your status is not clear-cut, book a consultation: we will count your days and tell you which return to file.

Frequently asked questions

I have been studying in the US on an F-1 for six years. Am I still a nonresident?

Not necessarily. A student on an F, J, M or Q visa does not count days under the substantial presence test until they have been an exempt individual for some part of more than 5 calendar years. After that, the days start to count, unless you show that you do not intend to live in the US permanently and are complying with your visa terms. We review each of these cases individually.

I spent fewer than 183 days in the US this year. Does that make me a nonresident?

Not always. The test looks not only at the current year but also at one-third of last year's days and one-sixth of the days from the year before. If the total is 183 days or more and you were in the US at least 31 days this year, you are a US tax resident. You can still remain a nonresident under the closer connection exception by filing Form 8840.

Do I need to file Form 8843 if I had no income?

Yes, if you are excluding days as an exempt individual, for example as a student on an F-1 or a program participant on a J-1. The form is filed separately from the return, even when no return is required. It is also filed for family members on F-2 or J-2 visas.

Can we file a joint return if one spouse is a nonresident?

If at the end of the year one spouse is a US citizen or resident and the other is a nonresident, the couple can choose to treat the nonresident spouse as a resident for the whole year. You then file a joint Form 1040, but the worldwide income of both spouses is taxed in the US. Whether this makes sense depends on your income abroad.

This article is for general information and does not replace advice on your specific situation.

Keep reading