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.
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:
- You were physically present in the US on at least 31 days during that year.
- 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.
- 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
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:
- 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
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.
- Count your days in the US for this year and the two years before. Passport stamps and the CBP I-94 travel history help.
- Enter them, with any exempt days, in the substantial presence test calculator.
- If you will meet the test this year, check your foreign accounts and funds before year end using the two calculators linked above.
- 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.
- Publication 519, U.S. Tax Guide for Aliens (2025). Internal Revenue Service.
- Substantial presence test. Internal Revenue Service.
- 26 U.S.C. §7701(b). U.S. Code.