For federal income tax, a noncitizen is a resident alien for a year if they had a green card at any time that year or pass the substantial presence test: at least 31 days in the US this year and at least 183 days over 3 years using a weighted formula. Resident aliens are taxed on their worldwide income, like citizens, and file Form 1040. Everyone else is a nonresident alien, taxed only on US-source income and certain US business income, and files Form 1040-NR.

Why your tax status matters

Your tax status is decided by these tests, not by your visa type, so someone on a temporary visa can be a resident for tax purposes. Your status affects:

  • What is taxed. Residents report income from everywhere in the world. Nonresidents report only income from US sources and certain income connected with a US trade or business.
  • Which form you file. Residents file Form 1040. Nonresidents file Form 1040-NR.
  • Deductions and credits. Nonresidents generally can't take the standard deduction or claim the earned income tax credit or education credits.
  • Other reports. Residents are US persons for the foreign account reports explained in our guide to foreign bank accounts, FBAR and FATCA.

Each year is tested separately, and some people are a resident for part of a year and a nonresident for the rest, called a dual-status year. State tax residency follows different rules; see our guide to state income taxes.

The green card test

You are a resident for tax purposes if you were a lawful permanent resident at any time during the calendar year. You keep that status for tax purposes, even while living abroad, until it is taken away by a final order or is officially determined to have been abandoned, for example after you file Form I-407 with US Citizenship and Immigration Services or a US consular officer. Until you have proof your abandonment letter was received, you remain a resident alien for tax purposes.

The IRS warns that under immigration law, a green card holder who is required to file a tax return as a resident and doesn't may be regarded as having abandoned that status. Claiming to be a resident of another country under a tax treaty tiebreaker rule can also have serious consequences for a long-term green card holder, including the expatriation tax. Get qualified advice before doing either.

The substantial presence test

You meet the test for a year if you were physically in the US on at least 31 days that year and the total of these three numbers is at least 183 days:

  • all the days you were present in the current year,
  • one-third of the days you were present in the year before, and
  • one-sixth of the days you were present in the year before that.

Any part of a day in the US counts as a day. The 50 states and the District of Columbia count, but US territories do not. Days that don't count include days you regularly commute to work from Canada or Mexico, days in transit for less than 24 hours between two foreign places, days you couldn't leave because of a medical condition that arose while you were here, and days you were an exempt individual (explained below).

Hypothetical example: Mei was in the US for 60 days in 2024, 90 days in 2025 and 150 days in 2026. For 2026 she counts 150 + 30 (one-third of 90) + 10 (one-sixth of 60) = 190 days. That is at least 183, and she was here at least 31 days in 2026, so she meets the test for 2026. Because she was present fewer than 183 days in 2026 itself, she could still be treated as a nonresident if she kept her tax home in another country, had a closer connection to that country than to the US, and filed Form 8840 on time. That exception isn't available if she applied for a green card or had an application to adjust status pending during the year.

A tax treaty can also change the result for someone who is a resident of both countries under each country's rules. A person who claims treaty residence in the other country generally files Form 1040-NR with Form 8833 and is taxed as a nonresident.

Exempt individuals: students, scholars and diplomats

"Exempt individual" doesn't mean exempt from tax. It means some of your days don't count toward the substantial presence test:

  • Students on F, J, M or Q visas who substantially comply with their visa. You stop being exempt after any part of more than 5 calendar years as a student, teacher or trainee, unless you show you don't intend to live permanently in the US and have complied with your visa.
  • Teachers and trainees on J or Q visas, other than students. You generally aren't exempt if you were exempt as a teacher, trainee or student for any part of 2 of the 6 prior calendar years, with a narrow exception when a foreign employer paid you.
  • Foreign government-related individuals on A or G visas, except A-3 and G-5 household staff.

Immediate family members whose visa status depends on yours are generally treated the same way. To exclude these days, you must file Form 8843, attached to your Form 1040-NR or on its own if you don't have to file a return. Our guide to taxes for international students covers the details for F-1 and J-1 students.

Your first and last year: dual status

In your first year as a resident, if you weren't a resident in the year before, your residency generally starts on the first day you were present in the US that year under the substantial presence test, or the first day you were here as a green card holder. You can ignore up to 10 days of earlier short visits if you had a closer connection to a foreign country and your tax home was there, by attaching a statement to your return. In the year you leave, your residency generally lasts through December 31 unless you qualify for an earlier date by keeping a foreign tax home and closer connection for the rest of the year and filing the required statement.

A dual-status return comes with restrictions. You can't take the standard deduction (you can itemize), you can't use head of household rates, and you can't file a joint return unless you make one of the choices described next. If you are a resident on December 31, you file Form 1040 marked "Dual Status Return" with a Form 1040-NR statement for the nonresident part of the year. If you are a nonresident on December 31, it's the reverse. Dual-status taxpayers couldn't e-file their 2025 returns, so plan to file on paper unless the 2026 Publication 519 says otherwise.

If you are arriving from Canada, our Canadian edition has the money checklist for moving from Canada to the US, including what happens to Canadian accounts and benefits when you leave.

Choices that can change your status

  • First-year choice. If you weren't a resident in the prior year and don't meet either test this year, but you will meet the substantial presence test next year, you may be able to choose to be a resident for part of this year. You need at least 31 days in a row in the US this year, and you must be present on at least 75% of the days from the start of that 31-day period through December 31, counting up to 5 days of absence as present. You can't file until you meet the test the next year, so you may need an extension.
  • Resident for the whole year. If you start the year as a nonresident, end it as a resident and are married at year end to a US citizen or resident, you and your spouse can choose to be treated as residents for the entire year. You both must file a joint return, are taxed on worldwide income, and can't make this choice again in a later year.
  • Nonresident spouse treated as a resident. If one spouse is a citizen or resident on December 31 and the other is a nonresident, you can choose to treat the nonresident spouse as a resident and file jointly. You are both taxed on worldwide income, and neither of you can claim treaty nonresidence. The choice continues in later years until it is revoked or ends, and once ended it can't be made again.

The two spousal choices are made by checking a box on Form 1040 and attaching a statement signed by both spouses. A spouse who has no SSN will need an ITIN to file jointly.

When to get help

Treaty claims, dual-status returns, leaving the US after holding a green card for many years and the first-year choice are areas where mistakes are costly. IRS Publication 519, U.S. Tax Guide for Aliens, is the official reference. IRS-sponsored VITA volunteers with foreign student and scholar certification prepare some nonresident returns, but the IRS treats dual-status returns as outside their scope, so you may need a paid tax professional for those.

Spotted something wrong or out of date? Report a correction and include this page’s address.