Skip to main content
International Tax

Substantial Presence Test: Are You a US Tax Resident?

The substantial presence test decides whether you are a US tax resident. See the weighted-day math, the days that do not count, and the exceptions.

Clark Shi, CPA, founder of TS CPA

Founder, TS CPA

If you are not a US citizen and you spend meaningful time in the United States, one determination controls almost everything else on your return: whether you are a resident alien or a nonresident alien. The substantial presence test is the day-counting rule that makes that call, and it routinely catches people certain they "were not here that much." The count is weighted across three years, which is why four months a year can make someone a full US tax resident.

Why Does US Tax Residency Status Matter More Than Anything Else on Your Return?

Because residency decides the size of the tax base, not just the rate. A resident alien is taxed on worldwide income, the same as a US citizen, and files Form 1040. A nonresident alien is taxed only on US-source income and income effectively connected with a US trade or business, and files Form 1040-NR.

That gap is enormous for anyone with foreign salary, a foreign business, foreign rental property, or a foreign portfolio. Residency also switches on the entire information-reporting regime: FBAR (FinCEN Form 114), Form 8938, Form 5471, and Form 3520. Someone who assumed nonresident status and later finds they met the test usually has both unreported income and years of missed information returns. Nothing in the test asks whether you intended to immigrate, so someone fully lawful on a visitor or work visa can still be a US tax resident.

What Are the Two Tests for US Tax Residency?

There are two residency tests, and meeting either one makes you a resident alien for the year. IRC §7701(b) sets both. Tests are not the only route to resident status: the first-year choice under §7701(b)(4) and the spousal elections under §6013(g) or §6013(h) can each produce resident status for someone who fails both tests.

  1. The green card test. You are a resident if you are a lawful permanent resident at any time during the calendar year. This is about the status, not time spent here: a green card holder who lives abroad full time and sets foot in the US zero days is still a US tax resident until the card is formally surrendered or revoked.

  2. The substantial presence test. A day-count test applied to everyone else, including people on B, E, H, L, O, and TN visas.

If neither test is met, you are a nonresident alien and file Form 1040-NR.

How Is the Substantial Presence Test Actually Calculated?

You meet the substantial presence test if you satisfy both of these conditions:

  1. You were physically present in the United States on at least 31 days during the current calendar year, and
  2. You were present on at least 183 days over the three-year period ending with the current year, counting:
    • all days of presence in the current year, plus
    • 1/3 of the days in the first preceding year, plus
    • 1/6 of the days in the second preceding year.

Fewer than 31 current-year days means you cannot meet the test no matter how much time you spent here in the prior two years. Any part of a day physically present generally counts as a full day.

The 183 is a weighted total, not actual presence, so a level travel pattern crosses the line well below 183 real days per year. At an identical 122 days per year you reach exactly 183 weighted days; at a steady 121 you stay under, at 181.5. That is four months a year, not six. Our free substantial presence test calculator runs the weighted count on your own days.

Worked Example: Does Four Months a Year in the US Make You a Resident?

Take a non-citizen executive splitting time between a foreign home and US operations:

  • 2024: 180 days
  • 2025: 150 days
  • 2026: 130 days

She was never here for half of any single year, and her presence is declining. Run the 2026 test:

  • Current year (2026): 130 x 1 = 130.00
  • First preceding year (2025): 150 x 1/3 = 50.00
  • Second preceding year (2024): 180 x 1/6 = 30.00
  • Weighted total: 210.00 days

She has more than 31 days in 2026 and more than 183 weighted days, so she meets the substantial presence test for 2026 and is taxable on worldwide income unless an exception applies. Her foreign salary, foreign brokerage gains, and foreign rental income all become reportable, and her foreign accounts become FBAR and Form 8938 items.

Notice what drives the result: the two prior years supply 80 of her 210 weighted days. A single heavy year casts a shadow forward, which is why this is a planning matter handled before December 31, not one a preparer can solve in April.

Which Days Do Not Count as Days of Presence?

Several categories of physical presence are disregarded entirely, and removing them can drop a person below the threshold.

Days Excluded From the Substantial Presence Test

Reference
  • Days as an exempt individual. This is a term of art and does not mean tax-exempt. It covers foreign-government-related individuals (including certain A and G visa holders), teachers and trainees on J or Q visas, students on F, J, M, or Q visas, and professional athletes competing in a charitable sporting event.
  • Days commuting from Canada or Mexico. Publication 519 treats commuting to US work from a residence in Canada or Mexico as regular only if you commute on more than 75% of the workdays during your working period.
  • Days in transit under 24 hours, while traveling between two points outside the United States.
  • Days as a crew member. You must be a regular crew member of a foreign vessel engaged in transportation between the United States and a foreign country, and the exception does not apply on any day you otherwise engage in a US trade or business.
  • Days you were unable to leave because of a medical condition that arose while you were present in the United States. This presupposes you intended to leave, and it does not apply if you were able to leave and stayed beyond a reasonable period, if you returned for treatment of a condition that arose during a prior stay, or if the condition existed before you arrived and you knew about it.

The exempt-individual categories are time-limited, which is where most errors happen. A student on an F, J, M, or Q visa generally stops being exempt after being exempt in any part of more than 5 calendar years. A teacher or trainee on a J or Q visa is generally not exempt if they were exempt as a teacher, trainee, or student for any part of 2 of the 6 preceding calendar years. Once the period runs out every subsequent day counts, so a long-term student often becomes a resident alien mid-degree with no change in visa or behavior.

Both limits have a continuation exception that is routinely missed. A student can stay exempt beyond 5 years by establishing no intent to reside permanently in the United States plus substantial compliance with their visa requirements. A teacher or trainee who fails the 2-of-6 test is still exempt if they were exempt as a teacher, trainee, or student in no more than 3 of the 6 prior years, and a foreign employer paid all of their compensation in the current year and in every prior year within those 6 years that they were here as a teacher or trainee. The Form 8843 must include proof of that foreign pay. A J-1 researcher paid entirely by an overseas institution can therefore stay exempt for at most about two more years.

Students, teachers, trainees, professional athletes, and anyone excluding days for a medical condition must file Form 8843, attached to Form 1040-NR or, if no return is due, mailed on its own by the Form 1040-NR due date. Diplomats and international organization staff on A or G visas (other than A-3 and G-5) do not file it. Skipping it is a common and avoidable defect in a nonresident filing position.

What Is the Closer Connection Exception, and Who Actually Qualifies?

The closer connection exception lets someone who meets the substantial presence test still be treated as a nonresident alien for the year. It is claimed on Form 8840, Closer Connection Exception Statement for Aliens. You must:

  1. Have been present in the United States less than 183 days during the current year,
  2. Have maintained a foreign tax home during the entire year,
  3. Have a closer connection to that foreign country than to the United States, and
  4. Have not taken steps toward, and not have had an application pending for, lawful permanent resident status.

Condition 1 is the one people misread. That 183 counts actual current-year days, not the weighted figure. The executive above had 130 actual days in 2026, so she is eligible to try for the exception even though her weighted total was 210. Someone with 200 actual days is out, however strong their foreign ties.

Condition 2 does not force you into a single country. The IRS permits a closer connection to two foreign countries if your tax home was in one foreign country from January 1, moved to a second foreign country, and stayed there for the rest of the year; you had a closer connection to each country while your tax home was there; and you were taxed as a resident by either country for the whole year, or by each country for its part of the year. A mid-year relocator is not automatically disqualified.

Condition 4 catches people mid-immigration: filing or having pending an adjustment of status such as Form I-485, or having an employer file on your behalf, disqualifies you for the year.

The "closer connection" itself is a facts-and-circumstances comparison: where your permanent home is, where your family lives, where you bank, where you are licensed to drive, where you vote, and which country you list as your residence on official forms. Form 8840 asks these directly and must be filed on time.

Can a Tax Treaty Override the Substantial Presence Test?

Yes, through a mechanism separate from the closer connection exception. Most US income tax treaties contain a residency tie-breaker article for cases where both countries would otherwise treat you as a resident, running an ordered sequence of factors: permanent home available to you, then center of vital interests, then habitual abode, then citizenship, and finally agreement between the two competent authorities.

If the tie-breaker assigns you to the treaty partner, you are treated as a nonresident alien for US income tax purposes even though you met the substantial presence test. You claim it on a nonresident return disclosing the treaty-based position on Form 8833. That disclosure is not optional paperwork: the IRC §6712 penalty for failing to disclose a treaty-based position is $1,000 per failure for an individual and $10,000 for a C corporation.

Three limits matter. First, relief exists only where the United States has an income tax treaty in force with that country.

Second, the tie-breaker does not switch information reporting off wholesale, and the pieces sit on different footing. Form 8938 does come off. Its instructions carve out dual resident taxpayers directly: someone who determines their income tax liability as a nonresident under Regulations §301.7701(b)-7 is not required to report specified foreign financial assets on Form 8938 for the part of the year covered by Form 1040-NR, provided they comply with §301.7701(b)-7(b) and (c), including timely filing that Form 1040-NR with Form 8833 attached. The filings that establish the treaty position are the same ones that waive the form. The foreign entity returns do not. Forms 5471, 3520, and 8865 are generally still due, with penalties per form per year regardless of whether tax was owed. FBAR is contested. The IRS position is that FBAR survives the tie-breaker because FinCEN defines a US person independently of the treaty, but at least one district court disagreed in Aroeste v. United States (S.D. Cal.). Since FBAR penalties dwarf the cost of a filing, the conservative course is a protective FBAR.

Third, and most dangerous, a long-term resident who claims treaty nonresident status triggers the exit tax. Under IRC §7701(b)(6), a green card holder who held the card in 8 of the last 15 tax years and then takes a tie-breaker position is treated as having ceased to be a lawful permanent resident, pulling them into the §877A expatriation regime with its mark-to-market deemed sale and a Form 8854 filing. Never take a tie-breaker for a long-term resident without pricing the exit tax first.

Closer Connection Exception (Form 8840)
Treaty Tie-Breaker (Form 8833)
Legal source
Closer Connection Exception (Form 8840): IRC §7701(b), domestic law
Treaty Tie-Breaker (Form 8833): Bilateral income tax treaty
Current-year day limit
Closer Connection Exception (Form 8840): Must be under 183 actual days
Treaty Tie-Breaker (Form 8833): No day-count ceiling
Requires a treaty
Closer Connection Exception (Form 8840): No
Treaty Tie-Breaker (Form 8833): Yes, treaty must be in force
Green card applicant
Closer Connection Exception (Form 8840): Disqualified
Treaty Tie-Breaker (Form 8833): Not automatically disqualified, but a long-term resident (green card in 8 of the last 15 years) is treated under IRC §7701(b)(6) as having ceased permanent residence, triggering the §877A exit tax and Form 8854
Tax home requirement
Closer Connection Exception (Form 8840): Foreign tax home all year, two countries allowed if it moved mid-year
Treaty Tie-Breaker (Form 8833): Determined by treaty factors
Effect on info reporting
Closer Connection Exception (Form 8840): Treated as nonresident
Treaty Tie-Breaker (Form 8833): Form 8938 not required if Form 1040-NR is timely filed with Form 8833; Forms 5471, 3520, and 8865 still due; FBAR contested, file protectively

What Happens in the Year You Arrive in or Leave the United States?

Residency usually starts and ends mid-year. Under IRC §7701(b), if you meet the substantial presence test, your residency starting date is generally the first day you were present in the United States that calendar year. A de minimis rule lets you disregard up to 10 days in setting either the starting or the ending date, if during those days you had a tax home in, and a closer connection to, a foreign country. To use it for the starting date you must file a signed statement, made under penalties of perjury, listing the excluded dates and the facts showing your foreign tax home and closer connection, with your return or by the Form 1040-NR due date. Without the statement, residency starts on your first day here. The excluded days still count toward the 183-day test itself.

If you arrive too late in the year to meet the test, the first-year choice under IRC §7701(b)(4) can start residency early by election. It requires at least 31 consecutive days of presence in the current year, presence on at least 75% of the days from the first day of that period through December 31 (up to 5 days of absence can be counted as days of presence), that you were not a US resident in the immediately preceding calendar year, and that you meet the substantial presence test the following year. The starting date under the choice is the first day of the 31-day period.

Your residency ending date is generally December 31 of the year you leave. It can be your actual last day of presence instead, but only if for the rest of that year you maintain a foreign tax home and a closer connection to it than to the United States, and you file a signed statement, made under penalties of perjury, that gives your last day here and the facts showing that foreign tax home and connection. The framework is also gated on a condition people skip: under Reg. §301.7701(b)-4(b) you must not be a US resident at any time during the following calendar year. Someone who leaves in March and is a US resident again at any point next year gets no termination date at all. Green card holders are on a different track: residency continues until the status is formally abandoned or revoked.

A split period creates a dual-status year, with different rules for each part. Dual-status filers generally cannot claim the standard deduction and generally cannot file jointly, so married taxpayers in an arrival year compare the dual-status result against a full-year resident election with a nonresident spouse under IRC §6013(g) or §6013(h), which often wins. Mechanics are in our guide to the dual-status alien tax return.

Bottom Line

Run the weighted calculation before December 31, while the day count is still something you control. If it comes out over the line the exits are narrow: closer connection requires under 183 actual current-year days and no green card application, and a treaty tie-breaker requires a treaty in force plus a Form 8833 disclosure, which waives Form 8938 but leaves the foreign entity returns due, the FBAR contested, and a long-term resident exposed to the exit tax.

Have questions about the substantial presence test or your US tax residency status? Contact TS CPA for a free consultation. We respond within the same day.

Official IRS and Government Sources

Frequently Asked Questions

How is the substantial presence test calculated?

You meet the substantial presence test if you were physically present in the United States at least 31 days during the current calendar year and at least 183 weighted days over a three-year period. The weighted count is all days in the current year, plus one-third of the days in the prior year, plus one-sixth of the days in the second prior year. Both conditions must be met, so someone with fewer than 31 current-year days is never a resident under this test.

How many days can I spend in the US each year without becoming a tax resident?

If your presence is roughly the same each year, about 121 days per year keeps you under the 183 weighted-day threshold, because 121 plus one-third of 121 plus one-sixth of 121 equals 181.5 weighted days. At 122 identical days per year you reach exactly 183 and meet the test. This rule of thumb only works when your day counts are level, so uneven travel years require an actual calculation.

Which days do not count toward the substantial presence test?

Days as an exempt individual do not count, which includes foreign-government-related individuals, teachers and trainees on J or Q visas, and students on F, J, M, or Q visas. Also excluded are days you commute to work from a residence in Canada or Mexico, days you are in the United States for less than 24 hours while in transit between two foreign points, days as a crew member of a foreign vessel, and days you could not leave because of a medical condition that arose while you were here.

What is the closer connection exception?

The closer connection exception lets someone who meets the substantial presence test still be treated as a nonresident. It requires that you were present less than 183 days in the current year, maintained a foreign tax home for the entire year, had a closer connection to that country than to the United States, and had not taken steps toward or filed an application for lawful permanent resident status. The IRS permits a closer connection to two foreign countries if your tax home moved from one to the other mid-year and you were taxed as a resident there, either by one country for the whole year or by each for its part. It is claimed on Form 8840.

Can a tax treaty make me a nonresident even if I pass the substantial presence test?

Yes. Most US income tax treaties contain a residency tie-breaker that assigns residency to one country when both would otherwise treat you as a resident, using factors such as permanent home, center of vital interests, habitual abode, and citizenship. If the tie-breaker assigns you to the treaty partner, you are taxed as a nonresident for income tax purposes and disclose the position on Form 8833. A dual resident taxpayer who timely files Form 1040-NR with Form 8833 is not required to file Form 8938 for the part of the year covered by that return, but the foreign entity information returns such as Forms 5471, 3520, and 8865 generally remain due, and the IRS position is that the FBAR still applies.