Skip to content

Private tax preparation service. Not the IRS.

USTAX
GuideTax residency · 10 min read

Substantial presence test: are you a resident or a nonresident alien for US tax?

Last reviewed

The short answer

If you are not a US citizen, the IRS treats you as a nonresident alien for tax unless you meet the green card test or the substantial presence test for the year. You meet the substantial presence test with at least 31 days in the United States in the current year and 183 days over three years, counting all current-year days, 1/3 of the days in the year before and 1/6 of the days in the year before that. Some days do not count, such as days as an exempt student. Residents file Form 1040 and are taxed on worldwide income; nonresidents file Form 1040-NR.

Key facts

Two tests
Green card test or substantial presence test
Day count
31 days this year, and 183 days over 3 years (all, 1/3, 1/6)
Excluded days
Explained on Form 8843
Form 8843 due
Due date of Form 1040-NR, including extensions
Return
Resident: Form 1040. Nonresident: Form 1040-NR

Resident or nonresident alien for tax purposes: the two tests

In US tax law, an alien is a person who is not a US citizen. The IRS page on determining tax residency status says such a person is a nonresident for US tax unless they meet one of two tests for the calendar year:

  • The green card test. You are a resident if you were a lawful permanent resident of the United States at any time during the year, which generally means you were issued a green card (Form I-551). The IRS green card test page says the status continues until you give it up in writing to USCIS, or USCIS or a federal court ends it.
  • The substantial presence test. You are a resident if you were physically in the United States for enough days, counted as shown below.

So a person on a visa that is not a green card can still be a resident for tax because of the day count.

The substantial presence test: how many days?

The IRS substantial presence test page says you meet the test if you were physically present in the United States on at least:

  1. 31 days during the current year, and
  2. 183 days during the 3-year period of the current year and the 2 years before it, counting all days in the current year, 1/3 of the days in the first year before, and 1/6 of the days in the second year before.

Any part of a day counts as a day. "United States" here means the 50 states, the District of Columbia and US territorial waters; it does not include US territories or US airspace.

An example of the count

Example, with invented numbers: a person who is not an exempt individual spent 150 days in the United States in 2026, 90 days in 2025 and 60 days in 2024.

Example of the substantial presence test count
YearDays presentShare countedDays counted
2026 (current year)150All150
2025901/330
2024601/610
Total190

The person had at least 31 days in 2026 and a total of 183 or more, so the test is met for 2026 unless an exception applies. With 140 days in 2026, the total would be 180 and the test would not be met.

Days that do not count, and exempt individuals

The IRS says you do not count days you regularly commute to work from Canada or Mexico, days in transit for less than 24 hours between two places outside the United States, days as a crew member of a foreign vessel, days you cannot leave because of a medical condition that arose in the United States, and days you are an exempt individual.

"Exempt individual" does not mean exempt from tax. It means your days are not counted. Publication 519, chapter 1 names four groups, each with limits:

Does the substantial presence test apply to F-1 students?

A student temporarily in the United States on an F, J, M or Q visa who substantially complies with it is exempt, so those days do not count. The IRS page on exempt students gives the limit: you are not exempt as a student if you have been exempt as a teacher, trainee or student for any part of more than 5 calendar years, unless you show you do not intend to live permanently in the United States and you have substantially complied with your visa.

Teachers and trainees on J or Q visas

A teacher or trainee (not a student) on a J or Q visa is exempt, but generally not if they were exempt as a teacher, trainee or student for any part of 2 of the 6 preceding calendar years. Publication 519 lists a narrow exception for people whose compensation was all paid by a foreign employer.

Foreign government staff and athletes

The IRS page on foreign government-related individuals says a person on an A or G visa is generally exempt, except household staff on A-3 or G-5 visas, who count all their days. A professional athlete competing in a charitable sports event excludes only the days of competition.

Is an H-1B worker a nonresident alien?

The exempt groups cover F, J, M, Q, A and G visas only. Days on other visas, such as H-1B, count under the normal rule, so the answer depends on the count and the exceptions in this guide.

Form 8843: who needs to file it, and the deadline

Form 8843 is a statement that explains why you exclude days. The Form 8843 instructions (2026) say you must file it if you are an alien individual who excludes days because you were an exempt individual or could not leave because of a medical condition. A person on an A or G visa (other than A-3 or G-5) does not have to file it.

  1. If you file Form 1040-NR, attach Form 8843 to it.
  2. If you do not have to file a return, mail Form 8843 alone to the IRS address in the instructions (Austin, TX 73301-0215).
  3. The deadline is the due date, including extensions, for filing Form 1040-NR. For tax year 2026, the Form 1040-NR instructions give April 15, 2027 with US wages subject to withholding, and June 15, 2027 without.

The IRS substantial presence test page says that if you do not file Form 8843 on time, you cannot exclude those days, unless you show by clear and convincing evidence that you took reasonable steps to learn about and comply with the requirement. All dates are on the US tax deadline calendar for non-residents.

Closer connection exception, treaty tie-breaker and dual status

Closer connection exception (Form 8840)

The IRS closer connection page says that even if you meet the substantial presence test, you can be treated as a nonresident if you were present on less than 183 days in the year, kept a tax home (your main place of work) in one foreign country all year, had a closer connection to that country than to the United States, and had not applied or taken steps to apply for a green card. You claim it on Form 8840, attached to your return or sent alone, by the due date for filing Form 1040-NR. If it is late, you cannot claim the exception, unless you meet the same "clear and convincing evidence" standard.

Treaty tie-breaker (Form 8833)

If you are a resident of both countries under each country's law, a tax treaty may have a tie-breaker rule. Publication 519 says that if the treaty treats you as a resident of the other country, you figure your US income tax as a nonresident and file Form 1040-NR with Form 8833 attached. A preparer reviews whether the rule applies to your facts.

Dual-status years

The IRS dual-status page says you can be a resident and a nonresident in the same year, most often the year you arrive or leave, with different rules for each part. This guide does not cover dual-status returns.

Resident vs nonresident alien: the tax difference

Resident alien vs nonresident alien
TopicResident alienNonresident alien
Income taxedWorldwide income, as for a US citizenUS-source income, and in limited cases foreign income connected with a US business
How it is taxedGraduated rates for US citizensIncome effectively connected with a US business: graduated rates after allowable deductions. Other US income such as dividends: a flat 30% of the gross amount, or a lower treaty rate
ReturnForm 1040 (or 1040-SR)Form 1040-NR
Usual due dateApril 15April 15 with US wages subject to withholding, otherwise June 15
Joint returnSame filing statuses as citizensA Form 1040-NR filer cannot file a joint return

Sources: IRS: taxation of US residents, IRS: taxation of nonresident aliens, Publication 519, chapter 4, Form 1040-NR instructions.

For the split between business and investment income, see effectively connected income and US tax on dividends and capital gains for non-residents.

Does owning a US LLC make you a US tax resident?

Not by itself. One test looks at lawful permanent resident status, the other at days of physical presence. Neither asks whether you own a US company or hold a US bank account. Two points still matter:

We prepare Form 1040-NR for non-residents, with Form 8843 where it is required. A preparer checks your day count and exceptions first.

Common mistakes

  • Counting only the current year. The 183-day part also counts 1/3 and 1/6 of the two earlier years.
  • Thinking "exempt individual" means no tax. It only means the days are not counted.
  • Not filing Form 8843. A student who excludes days files it even with no income, alone if no return is due.
  • Forgetting the time limits for students, teachers and trainees.
  • Filing the wrong return. Nonresidents file Form 1040-NR, residents Form 1040.
  • Claiming closer connection after 183 days in the current year. It needs less than 183 days and Form 8840 on time.

Have it prepared and filed for you

  • Form 1040-NR Non-Resident Tax Return

    Your US non-resident return prepared and e-filed by a credentialed preparer.

    Not included: state income tax return ($99 each); applying for a US taxpayer number, if you do not have one; tax due to the IRS.

    from $249per person, per tax year

    View service

Questions and answers

What is the substantial presence test for tax purposes?

One of the two tests the IRS uses to decide if a non-citizen is a US resident for tax. It needs at least 31 days this year and 183 days over three years, with the two earlier years weighted at 1/3 and 1/6. Source: IRS substantial presence test page.

Am I a nonresident alien on an F-1 visa?

Often yes, at first. Days as an exempt student on an F, J, M or Q visa do not count. That ends once you have been exempt for any part of more than 5 calendar years, unless you meet the conditions the IRS sets out on its exempt student page.

Who needs to file Form 8843?

An alien individual who excludes days because they were an exempt individual (student, teacher, trainee, or athlete in a charitable sports event) or could not leave because of a medical condition. People on A or G visas, other than A-3 and G-5, do not have to file it.

What is the Form 8843 deadline?

The due date, including extensions, for filing Form 1040-NR. For tax year 2026: April 15, 2027 if you had US wages subject to withholding, otherwise June 15, 2027. Attach it to Form 1040-NR, or mail it alone if you do not file a return.

I own a US LLC and have a US bank account. Am I a US tax resident?

Not because of the LLC or the account. Residence turns on the green card test and the substantial presence test. Your days in the United States count, and the LLC has its own filings, such as Form 5472.

Can you prepare my return?

If you are a nonresident alien, yes: we prepare Form 1040-NR with Form 8843 where it is required. We do not prepare resident returns on Form 1040.

Official sources used in this guide

This guide explains general rules. It is not advice for your situation. Tax results depend on your facts, and a preparer reviews them before anything is filed. Check the linked official sources for the current rules.

Sign here

Find out what you need to file. It takes two minutes.

Answer four questions about your company. You see which filings you need, the deadlines and the fixed price for each.