The test in one sentence
If you do not have a green card, you are a U.S. tax resident for a calendar year if you were physically present in the U.S. on at least 31 days that year and on 183 days or more over three years, counted with a weighted formula. This guide shows exactly how to count. For the bigger picture of residency, see Am I a U.S. tax resident?
The formula
The IRS's own example: someone present 120 days in each of 2023, 2024, and 2025 counts 120 + 40 + 20 = 180 days — short of 183, so they are not a resident under this test for 2025.
What counts as a day
You are present on any day you are physically in the U.S. at any time during the day. Arrival and departure days count. "United States" here means the 50 states and the District of Columbia (plus U.S. territorial waters) — not U.S. territories or U.S. airspace.
Days you do not count
- Days you commute to work in the U.S. from a residence in Canada or Mexico, if you regularly commute
- Days you are in the U.S. for less than 24 hours while in transit between two places outside the U.S.
- Days you are in the U.S. as a crew member of a foreign vessel
- Days you are unable to leave because of a medical condition that developed while you were in the U.S.
- Days you are an exempt individual (next section)
Exempt individuals
"Exempt individual" does not mean exempt from tax. It means your days in that status are not counted for this test.
| Category | Visa | Limit on being exempt |
|---|---|---|
| Students | F, J, M, or Q (substantially complying with the visa) | Not exempt if you were exempt as a teacher, trainee, or student for any part of more than 5 calendar years — unless you show you do not intend to reside permanently and have complied with your visa |
| Teachers and trainees | J or Q | Not exempt if you were exempt as a teacher, trainee, or student for any part of 2 of the 6 preceding calendar years (a narrower exception applies if a foreign employer paid all your compensation) |
| Foreign government-related individuals | A or G (not A-3 or G-5) | While in that status |
| Professional athletes | Competing in a charitable sports event | Only the days you actually competed |
Immediate family members of exempt students, teachers, and trainees are also included.
To exclude days as an exempt student, teacher, trainee, or athlete — or because of a medical condition — you must file Form 8843. Attach it to your income tax return, or if you do not have to file a return, mail it by the due date for filing Form 1040-NR. If you do not file it on time, you generally cannot exclude those days.
Worked examples
| Person | Days 2025 / 2024 / 2023 | Calculation | Result for 2025 |
|---|---|---|---|
| H-1B worker who arrived in March 2024 | 300 / 250 / 0 | 300 + 83.3 + 0 = 383.3 | Resident |
| Parent visiting from Taiwan each year | 120 / 120 / 120 | 120 + 40 + 20 = 180 | Not resident under this test |
| Parent visiting longer each year | 150 / 150 / 150 | 150 + 50 + 25 = 225 | Meets the test — but may claim the closer connection exception |
| F-1 student in their 4th calendar year | Days excluded (exempt) | Exempt days are not counted | Not resident under this test (Form 8843 required) |
The closer connection exception
Even if you meet the test, you can be treated as a nonresident if all of these are true:
- You were present in the U.S. fewer than 183 days during the current year
- You kept a tax home in a foreign country for the entire year
- You had a closer connection to that country than to the U.S. — the IRS looks at where your permanent home, family, belongings, bank accounts, business activities, driver's license, and voting are
You claim it by filing Form 8840 on time. You cannot claim it if, during the year, you applied for or took other steps toward becoming a permanent resident, or had an application for adjustment of status pending.
This is the exception that matters most for parents who spend long periods each year with their children in the U.S. but whose life is in Taiwan or China.
When your residency starts — and the first-year choice
If you meet the test for the first time, your residency generally starts on the first day you were present in the U.S. that year, which makes the year a dual-status year. You may disregard up to 10 days of earlier presence if you can show a closer connection to a foreign country on those days.
If you arrive late in the year and only meet the test the following year, the first-year choice may let you be treated as a resident for part of your arrival year. You must be present for at least 31 consecutive days in that year and present for at least 75% of the days from the start of that 31-day period through December 31 (up to 5 days of absence can count as presence). The choice is made with a statement attached to Form 1040, and it cannot be revoked without IRS approval.
If you are a resident of both the U.S. and another country under each country's laws, a tax treaty's tie-breaker rule may treat you as a resident of the other country. Claiming this requires filing Form 1040-NR with Form 8833. Treaty positions need professional advice.