Skip to content
US Federal · IRS

How the Substantial Presence Test works: the rule, the exemptions, and the math

The IRS Substantial Presence Test is a 3-year weighted day count deciding whether non-citizens are US tax residents. The rule, the exemptions, and the result.

10 min read

If you're a non-citizen physically present in the United States, the IRS uses the Substantial Presence Test (SPT) to decide whether you're a tax resident. Pass the test, and the US taxes your worldwide income. The formula is a 3-year weighted average, and it catches more people than they realize.

This page explains the rule. If you would rather put numbers in and get an answer, the Substantial Presence Test calculator runs the same weighted formula in your browser, checks both statutory conditions, and shows how many weighted days you have left.

The SPT formula

The test is a statute, not an IRS practice note: it lives in Internal Revenue Code section 7701(b)(3), the provision that decides whether someone who is not a US citizen is a resident alien or a nonresident alien for federal income tax purposes. The IRS restates it in Publication 519.

You meet the Substantial Presence Test for the current calendar year if both are true:

  • You were physically present in the US at least 31 days during the current year, AND
  • Your weighted total is 183 days or more: (current-year days) + (1/3 × prior-year days) + (1/6 × two-years-prior days).

A worked example

Suppose you spent 120 days in the US in 2026, 120 days in 2025, and 120 days in 2024. Your weighted total:

  • 2026: 120 days × 1 = 120
  • 2025: 120 days × 1/3 = 40
  • 2024: 120 days × 1/6 = 20
  • Total: 180 days, under 183, so you do not meet the SPT.

Now suppose you stay 150 days in 2026 instead. Total: 150 + 40 + 20 = 210. You meet the SPT and the IRS treats you as a US tax resident, taxable on worldwide income.

Exempt individuals: who's outside the SPT

Some categories of people get to exclude their US days entirely. These include:

  • Foreign government-related individuals (A or G visa).
  • Teachers or trainees on a J or Q visa (limited).
  • Students on F, J, M, or Q visas (limited to 5 calendar years).
  • Professional athletes temporarily in the US for charitable sports events.
  • Individuals who couldn't leave the US due to a medical condition that arose while in the US.

The closer-connection exception

Even if you meet the SPT, you can claim the closer connection exception by filing Form 8840 if you:

  • Were present in the US for fewer than 183 days in the current year (actual days, not the weighted total), AND
  • Maintain a tax home in a foreign country, AND
  • Have a closer connection to that foreign country than to the US.
Tip:

Closer-connection requires day-count records. The IRS routinely asks for proof of physical presence outside the US, and the burden is on you. Tax Days exports an SPT-ready PDF for exactly this.

Treaty tie-breakers

If you're a tax resident of both the US (under the SPT) and another country, most US tax treaties contain a tie-breaker provision. They look at: permanent home, center of vital interests, habitual abode, citizenship, in that order. Each step requires evidence; day counts are foundational.

How to track for the SPT

For a one-off answer, run your three years through the Substantial Presence Test calculator. For an answer that stays current, Tax Days runs the full 3-year weighted SPT calculation in real time: add a US trip and the app updates your current-year, prior-year, and two-years-prior weights instantly. Notifications fire 30, 14, 7, 3, and 1 days before you'd cross 183 weighted days.

FAQ

Frequently asked questions

Is the Substantial Presence Test the same as a 183-day rule?

No, although it borrows the number. A conventional 183-day rule asks how many days you spent in one country during one year. The Substantial Presence Test asks for a weighted total across three years, so a steady pattern of about 122 days a year reaches 183 weighted days without any single year coming close to it.

Does the Substantial Presence Test apply to US citizens or green card holders?

No. US citizens are taxed on worldwide income wherever they live, and lawful permanent residents are US tax residents under the separate green card test regardless of how many days they spend in the country. The Substantial Presence Test is the test for everyone else, mainly nonimmigrant visa holders and frequent visitors.

What is Form 8843 and who has to file it?

Form 8843 is the statement used to claim days that do not count toward the test, principally days as an exempt individual (certain students, teachers, trainees, and foreign government related individuals) and days you could not leave the US because of a medical condition that arose while you were there. It is often required even when no US tax return would otherwise be due, and excluding days is generally an active claim rather than something that happens automatically.

Does meeting the Substantial Presence Test change my immigration status?

No. Tax residency and immigration status are separate systems that use different words for similar ideas. You can be a nonimmigrant visa holder and a US tax resident in the same year, and being taxed as a resident does not grant any immigration right or obligation.

What happens the year I first meet the test?

Residency generally starts on your first day of physical presence in the US during the year you meet the test rather than on 1 January, which makes the first year a dual-status year: nonresident up to that date, resident afterwards. A limited number of days can generally be disregarded in fixing that date where you kept a closer connection to a foreign country during them, and a separate first-year choice can be available in some situations.

What if I'm a tax resident of both the US and another country?

Most US tax treaties contain a tie-breaker provision for dual residents. It generally looks at your permanent home, center of vital interests, habitual abode, and citizenship, in that order, and each step requires evidence. Day count records are foundational to that analysis.

Sources & further reading

Every rule on this page is drawn from primary sources. Verify the current law before making a residency decision.

  1. [1]26 U.S.C. § 7701(b), definition of resident alien and the substantial presence test (opens in a new tab)Office of the Law Revision Counsel
  2. [2]Substantial Presence Test (opens in a new tab)IRS
  3. [3]Publication 519, U.S. Tax Guide for Aliens (opens in a new tab)IRS
  4. [4]Exempt Individual, Who Is a Student or Teacher/Trainee (opens in a new tab)IRS
  5. [5]Form 8843, Statement for Exempt Individuals (opens in a new tab)IRS
  6. [6]Closer Connection Exception to the Substantial Presence Test (opens in a new tab)IRS
  7. [7]Form 8840, Closer Connection Exception Statement (opens in a new tab)IRS