Ex-Big Four CPA led, AI-enabled tax services for modern businesses & individuals.

Visa holders · Substantial presence test

Resident alien vs. nonresident alien: a green card or the substantial presence test usually makes you a resident alien for US tax.

A nonresident alien (NRA) is anyone who is neither a US citizen nor a US resident for tax purposes. The substantial presence test counts your days in the US over three years. This year’s days count in full, last year’s count as a third and the year before’s as a sixth. A weighted total of at least 183 days, with at least 31 this year, usually makes you a resident alien.

Updated · Sources

The substantial presence test

183
days in the US this year pass the test on their own, if none of them are excluded from the count.
31
days this year is the minimum, however long you stayed in the two years before.
5
calendar years of student days on an F-1 or J-1 visa usually stay out of the count.

These numbers are set in the statute and are not adjusted for inflation.

Are you a nonresident alien or a resident alien?

Each calendar year is tested on its own, so your status can change from year to year.

  1. A green card at any time in the year

    A green card held at any point in the year makes you a resident alien for that year. Living abroad, or holding a card that has expired, does not by itself end that status.

  2. Days that do not count

    Days as an exempt individual are left out of the count, though exempt here does not mean exempt from tax. Exempt individuals include F, J, M and Q students and J and Q teachers and trainees, but not H-1B or DACA holders. Some medical stays, transits under 24 hours and regular commutes from Canada or Mexico are also left out.

  3. At least 31 days in the US this year

    A day counts even if you were in the US for only part of it. Days in US territories such as Puerto Rico, or in the air over the US, do not count.

  4. 183 days on the weighted count

    Fractions are not rounded, so a weighted total of 182.5 days falls short of 183.

  5. Exceptions for people based abroad

    With fewer than 183 days this year, the closer connection exception can still keep you a nonresident. It needs a foreign tax home all year, closer ties to that country, a timely Form 8840 and no green card steps that year. At 183 days or more, only a tax treaty’s tie-breaker can make you a nonresident.

Estate and gift tax use your domicile instead of these tests. Each state decides your state tax residency under its own rules.

How do you calculate the substantial presence test?

A London-based founder was in the US 150 days in 2026, 120 in 2025 and 90 in 2024. None of her days are excluded from the count.

2026 days, in full

150 days

2025 days, at a third

40 days

Her 120 days in 2025 count as 40.

2024 days, at a sixth

15 days

Her 90 days in 2024 count as 15.

Needed to pass

183 days

Weighted total

205 days

That is 22 days over the line, so she meets the test for 2026.

Section 7701(b)(3) sets these multipliers. Her 150 days in 2026 also clear the 31-day minimum. Because she spent fewer than 183 days in the US in 2026, she may still be a nonresident. She would need a UK tax home all year, closer UK ties, no green card steps and a timely Form 8840.

Resident aliens and nonresident aliens are taxed on different income.

Resident alienNonresident alien
Income the US taxesWorldwide income

The same as a US citizen

Only US income

US-source, or effectively connected with a US business

Tax returnForm 1040Form 1040-NR
Joint returnAllowed

With a spouse who is a citizen or resident

Only by election

Made with a citizen or resident spouse, to be taxed as a resident

What catches people out on resident alien status?

  • An employer’s green card petition counts as your own

    Green card steps taken for you rule out the closer connection exception, just as your own do. An employer’s Form I-140 or labor certification counts, and so does a pending application to adjust status.

  • A late Form 8840 can make you a resident

    A late Form 8840 loses the closer connection exception, unless you prove reasonable efforts to learn the rule and comply. The form is due with your Form 1040-NR, and an extension moves both. For 2026, the unextended date is April 15, 2027 if you had wages subject to withholding, or June 15, 2027 if not.

  • A tie-breaker is not a full exit

    A treaty tie-breaker makes you a nonresident only for figuring your US income tax, and you stay a resident for other rules. It applies when the US and a treaty country both treat you as a resident, which makes you a dual resident. You claim it on Form 1040-NR with Form 8833, and failing to disclose it carries a $1,000 penalty.

  • Giving up a green card can bring the exit tax

    The exit tax under Section 877A can reach a long-term resident who gives up a green card. Claiming treaty residence in another country can trigger it too.

Your day count decides which return you file, so we check it first.

Valim’s CPAs work out whether visa holders are resident or nonresident aliens for US tax, and prepare the return that follows.

  • We prepare your Form 1040, Form 1040-NR or dual-status return, with any Form 8843 or 8840 it needs.
  • We compare your options for the first year. You can file as you are, make the first-year choice, or make a joint election with your spouse.
  • We set estimated payments for your first year taxed on worldwide income.
  • We prepare the US side only, alongside any accountant who files for you back home.
  • Your instant quote includes a price for each foreign account and foreign fund you hold.
  • If an IRS or state notice questions a return we prepared, your day count included, our reply is part of your fee.
How we handle visa holders
Individual return
from $195
Business return
from $495
Calculate your quote instantly

We quote a flat fee before work starts. We do not bill hourly.

Resident and nonresident alien questions.

How do I pass the substantial presence test?

You pass the substantial presence test with at least 31 days in the US this year and 183 days on a weighted count. That count takes every day this year, a third of last year’s days and a sixth of the year before’s. Any part of a day counts as a full day. Days as an exempt individual, such as an F-1 student, are left out. So are transits of under 24 hours between two foreign places.

Is an H-1B holder a resident alien for tax?

An H-1B holder is usually a resident alien for tax, because H-1B days count toward the substantial presence test. With no earlier US days, arriving by July 2 and staying puts you at 183 days in your first year. That year is usually dual-status, and resident status starts on your first day in the US. Arrive later and you are a nonresident that year, unless you qualify for the first-year choice or a joint election with your spouse. Earlier days as an exempt F-1 or J-1 student do not count.

When do F-1 students become resident aliens?

F-1 students usually become resident aliens in their sixth calendar year here, unless they show they do not intend to stay permanently. Any part of a year counts as a whole one. So a student who arrived in August 2021 starts counting days on January 1, 2026. Earlier exempt days never count, so the student becomes a resident once present 183 days in that year. OPT is F-1 time and uses up the same 5 years, as do earlier years on a J-1 visa.

What is the green card test?

The green card test makes you a resident alien for any year you were a lawful permanent resident, even briefly. Your days in the US do not matter. In the year you get the card, residency usually starts on your first day in the US as a permanent resident.

Can I be a resident and a nonresident in the same year?

Yes, that is a dual-status year, usually the year you arrive or leave. You are taxed on worldwide income for the resident part and on US income for the nonresident part. In an arrival year, Form 1040 covers the resident part, with a Form 1040-NR statement for the rest. You also cannot take the standard deduction or file a joint return. You can do both if you and a US citizen or resident spouse elect to treat you as a resident all year.

How do I know if I am a nonresident alien or resident alien?

You are a resident alien for a year if you pass the green card test or the substantial presence test. Pass neither and you are a nonresident alien, unless you make the first-year choice or a joint election with a citizen or resident spouse. Passing the day count can still leave you a nonresident, through the closer connection exception or a treaty tie-breaker. Resident aliens file Form 1040, and nonresident aliens file Form 1040-NR.

What is the substantial presence test?

The substantial presence test is the IRS day count that makes a non-citizen without a green card a US resident for tax. It weighs your days over three years, and you pass at 183 weighted days with 31 this year. Passing makes you a resident alien unless an exception applies. It sets your tax status only, not your status under the immigration laws.