QUICK ANSWER · VISA-HOLDER FINANCE

What is the substantial presence test?

The substantial presence test is the IRS day count that decides whether someone who is not a US citizen or green-card holder is taxed as a US resident. You meet it with at least 31 days in the US this year and at least 183 days when you add all of this year's days, a third of last year's and a sixth of the year before's.

Updated 2026-10-01 · 4 min read · numbers computed by the calculators' engines
TRY IT WITH YOUR NUMBERSOpen the full calculator →
Loading the US tax residency checker…
Same formula and engine as the full calculator. Your numbers stay in this browser.

Why it matters

For US tax purposes, a non-citizen is either a resident alien or a nonresident alien, and this has nothing to do with your visa or immigration status. A resident alien is taxed like a citizen: on income from anywhere in the world, with the same deductions and filing forms. A nonresident alien is taxed mainly on US-source income, files a different return (Form 1040-NR), and follows different rules for withholding, deductions and filing with a spouse.

You become a resident alien in one of two ways: you hold a green card at any time in the year, or you meet the substantial presence test. For most people on a work or student visa, the test is what decides it.

The test, step by step

You meet the substantial presence test for a year if both of these are true:

  1. You were physically present in the US on at least 31 days during that year.
  2. Your weighted total over three years reaches 183 days, counting all the days of this year, one-third of the days of last year, and one-sixth of the days of the year before.

Any part of a day counts as a day, with a few exceptions such as days in transit between two foreign points and days you could not leave because of a medical condition that arose while you were here.

Here is the arithmetic for someone who arrived and has stayed most of each year. It is computed by the same engine as the substantial presence test calculator.

WORKED EXAMPLE: MOST OF EACH YEAR IN THE US
Days this year
150
Days last year
120
Days the year before
120
Weighted days
210 days
Meets the test
yes
Most days this year and stay under
122 days
Computed by the same engine as the calculators. Change the inputs there to see your own.

With 150 days this year, 120 last year and 120 the year before, the weighted total is 210 days, so the test is met: yes. Notice that this happens with fewer than 183 days in any single year. The weighting carries days forward.

Now a person who spends a steady part of each year in the US:

WORKED EXAMPLE: A STEADY PART OF EACH YEAR
Days this year
120
Days last year
120
Days the year before
120
Weighted days
180 days
Meets the test
no
Most days this year and stay under
122 days
Computed by the same engine as the calculators. Change the inputs there to see your own.

At 120 days in each of three years the weighted total is 180 days, so the test is not met: no. Given the two earlier years, the most days this person can spend in the US this year and stay under the test is 122. Spending roughly four months a year in the US every year, year after year, stays under the line; this is why people who split their time between countries track their days closely.

Days that do not count

Some days are excluded, which is why many people on student visas are nonresidents for years even while living in the US full time:

  • Exempt individuals. Days as a student on an F, J, M or Q visa do not count, usually for up to five calendar years. Teachers and trainees on J or Q visas get a shorter exemption. You file Form 8843 to claim it.
  • Commuters from Canada or Mexico who travel to work in the US regularly.
  • A medical condition that kept you here when you planned to leave.

When the student exemption ends, every day counts again, often making the person a resident alien in the middle of their stay. That one change affects several things at once, covered below.

The closer connection exception

If you meet the test but were present fewer than 183 days in the current year, you can still be treated as a nonresident if your tax home was in another country all year and you had a closer connection to it than to the US. You claim this on Form 8840. It is not available to someone who has applied for a green card.

What changes when you become a resident alien

  • Your worldwide income becomes taxable in the US, including interest, rent and gains in your home country.
  • Foreign accounts must be reported. A resident with foreign accounts that together exceeded the reporting threshold at any time in the year files an FBAR, and above higher thresholds also Form 8938. The FBAR and Form 8938 checker shows which apply to you.
  • Foreign mutual funds can become very expensive to hold. Most non-US funds are PFICs, taxed harshly for US residents; see the PFIC calculator.
  • Students start paying Social Security and Medicare tax. The FICA exemption for F-1 and J-1 students applies only while they are nonresident aliens; the take-home pay calculator shows the difference.
  • Filing with a spouse changes. A resident can file jointly, and can choose to treat a nonresident spouse as a resident; the nonresident spouse calculator compares the options.

The first and last years

Residency usually starts on the first day you are present in the year you meet the test, so an arrival year is often split: nonresident before, resident after. This is called a dual-status year, with its own filing rules. A similar split can happen in the year you leave for good. Tax treaties can also change the result for someone who would be a resident of two countries at once. These cases are worth checking with a tax professional.

YOUR NEXT STEPSDo this now
  1. Count your days in the US for this year and the two years before. Passport stamps and the CBP I-94 travel history help.
  2. Enter them, with any exempt days, in the substantial presence test calculator.
  3. If you will meet the test this year, check your foreign accounts and funds before year end using the two calculators linked above.
  4. Keep the day count. The same numbers decide next year's answer.

This explains the IRS rules as published in Publication 519 and is not personal tax or legal advice. Treaty positions, dual-status years and visa questions should be checked with a qualified professional.

SOURCES
GO DEEPER: READ THE CHAPTER
ARRIVING AND WORKING ON A VISA · FOUNDATIONSYour Tax Status Is Not Your VisaWhy the IRS sorts visa holders into resident and nonresident aliens by its own tests, the green card and substantial presence tests, and what each status changes about the income taxed, the form filed and the deductions allowed.ARRIVING AND WORKING ON A VISA · FOUNDATIONSCounting Days: the Substantial Presence Test and Form 8843How to count days of presence, which days never count, how long F, J, M and Q students and J-1 scholars stay exempt, when Form 8843 is due even with no income, and the closer connection exception.ARRIVING AND WORKING ON A VISA · FOUNDATIONSYour First Year: Dual Status and the First-Year ChoiceWhen residency starts, the restrictions on a dual-status return, the first-year choice for people who arrive late in the year, and the full-year resident choice that lets a married couple file jointly.
WORK IT OUT WITH YOUR NUMBERS
FBAR / Form 8938 threshold checker →Do I have to report my foreign accounts on an FBAR or Form 8938?Take-home pay, visa-holder variant →What will I actually take home per paycheck, including as an H-1B, F-1 OPT or nonresident alien?Nonresident spouse: §6013(g) election vs MFS/HoH →Should my nonresident spouse and I file jointly or separately?
KEY TERMS
Substantial presence testResident and nonresident alien (for tax)FICA exemption for F-1 and J-1 studentsFBAR (FinCEN Form 114)
Browse the Library →