Tax residency
whether the IRS taxes you as a resident
For U.S. income tax, every noncitizen is either a resident alien, taxed like a citizen on income from everywhere, or a nonresident alien, taxed mainly on U.S. income. Two tests decide which, and your visa doesn't decide it by itself.
| Defined in | 26 U.S.C. 7701(b), explained in IRS Publication 51912 |
| Who decides | The law sets the tests. You apply them each year when you file.2 |
| Who it affects | Every noncitizen with U.S. income or a U.S. tax filing duty, including green card holders who live abroad2 |
- Mentioned on
- Green card through the Gold Card programfrom abroad to permanent resident
- Permanent resident
- ITIN
- N-470
- Abandonment
- Continuous residence
- IRS
In plain words
Tax residency isn't immigration status. An H-1B worker's days in the U.S. count from the first day, so a worker who spends most of a year here usually becomes a resident for tax. An F-1 student's days usually don't count for the first 5 calendar years. A green card holder is a resident even while living abroad.2
The difference is large. Residents are taxed on their income from all countries, the same as citizens, and file Form 1040. Nonresidents are taxed only on U.S. income and on income connected with a U.S. business or job, and file Form 1040-NR.2
You're a resident for a calendar year if you meet either test below. Otherwise, you're a nonresident.2
The green card test
You're a resident for any year in which you're a lawful permanent resident, even for one day. You stay a resident until your status is taken away by a final order, or is officially found abandoned. You can give it up yourself by filing Form I-407 with your green card, but until you have proof that USCIS or a consular officer received it, the IRS still treats you as a resident.2
The substantial presence test
You're a resident if you were in the U.S. on at least 31 days this year, and on at least 183 days over 3 years, counting:2
- every day in the U.S. this year,
- 1/3 of the days last year, and
- 1/6 of the days the year before that.
For example, 120 days in each of the 3 years counts as 120 + 40 + 20 = 180 days, so you're not a resident.2 Any part of a day in the U.S. counts as a day, except days in transit between 2 places outside the U.S. for less than 24 hours, days as a crew member of a foreign ship, days when a medical condition that arose in the U.S. kept you from leaving, regular commutes from Canada or Mexico, days as a member of a NATO force (but not for family members), and days as an exempt individual.2 The U.S. here means the 50 states and Washington, D.C., not U.S. territories.2
Exempt individuals and Form 8843
Some people don't count their days, because of their visa:2
- Students on F, J, M, or Q visas, for 5 calendar years. Any part of a year counts as a whole year. After 5 years, your days count unless you show that you don't intend to live in the U.S. permanently and that you've followed your visa's rules.
- Teachers and trainees on J or Q visas who aren't students, such as J-1 researchers and professors. You're not exempt this year if you were exempt as a teacher, trainee, or student in any part of 2 of the last 6 calendar years. A narrow exception applies if a foreign employer paid you.
- Their immediate family: a spouse, and unmarried children under 21, whose visas come from the exempt person's visa, such as F-2 and J-2.
- Diplomats and employees of international organizations on A or G visas, and their families, except household staff on A-3 or G-5 visas.
You must still prove that your days don't count. Each exempt student, teacher, or trainee files Form 8843 for each year, and so does each family member, including children, even with no income.23 You attach it to your Form 1040-NR. If you don't have to file a return, you mail it alone to the IRS in Austin, Texas, by the date a Form 1040-NR would be due: June 15 if you had no U.S. wages subject to withholding.42 Form 8843 doesn't require a Social Security number or ITIN.4
The closer connection exception (Form 8840)
If you meet the substantial presence test but were in the U.S. for fewer than 183 days this year, you can still be a nonresident if your tax home (your main place of work) was in another country all year and you had a closer connection to that country than to the U.S. You claim it on Form 8840, filed by the 1040-NR due date.2 You can't use it if you applied for a green card, took other steps toward one, or had an application to adjust status pending during the year.2
Years you arrive or leave
In the year you arrive or leave, you're often a resident for part of the year and a nonresident for the rest. This is a dual-status year.2 If you meet the substantial presence test, your residency usually starts on your first day in the U.S. that year.2
- Limits: in a dual-status year, you can't take the standard deduction, file a joint return, or file as head of household.2
- Forms: if you're a resident on December 31, you file Form 1040 marked "Dual Status Return" and attach Form 1040-NR as a statement for the nonresident part. If you're a nonresident on December 31, it's the other way around. Dual-status returns for 2025 can't be filed electronically.2
- First-year choice: if you meet neither test this year or last year, but will meet the substantial presence test next year, you can choose to be a resident for part of this year. You must have been in the U.S. for 31 days in a row this year, and on at least 75% of the days from the first of those 31 days to December 31, counting up to 5 days away as days here. Your residency then starts on the first of those 31 days. You make the choice on a statement filed with Form 1040 after you meet the test next year, so you may need an extension to file.2
- Married couples: if one spouse is a citizen or resident at the end of the year, the couple can choose to treat the nonresident spouse as a resident for the whole year. You then must file a joint return for that year, both spouses are taxed on income from all countries, and neither can use a tax treaty to claim to be a nonresident. The choice continues in later years until it's suspended or ended.2
What residents report
As a resident, you report your income from every country on Form 1040.2 You may also have to report foreign accounts and assets, even if they earn nothing:
- FBAR (FinCEN Form 114): if your foreign financial accounts together held more than $10,000 at any time in the year. You file it online with FinCEN, a Treasury bureau, not with your tax return, by April 15, with an automatic extension to October 15.5
- Form 8938: if your foreign financial assets are worth more than a threshold, attached to your tax return. For a single person living in the U.S., the threshold is more than $50,000 on the last day of the year or more than $75,000 at any time. For a married couple filing jointly in the U.S., it's $100,000 or $150,000. The amounts are higher if you live abroad.6 Residents file it, and nonresidents generally don't unless they choose to file jointly as residents.2
The penalty for not filing Form 8938 is up to $10,000, plus $10,000 for each 30 days you still don't file after the IRS tells you, up to $60,000 in total. FBAR penalties are set by law and adjusted for inflation each year. Criminal penalties can apply to both.6
Social Security and Medicare taxes
Nonresident students and exchange visitors in F-1, J-1, M-1, or Q status don't pay Social Security and Medicare taxes on pay for work that serves the purpose of their visa: on-campus work, practical training such as CPT and OPT, and work allowed for economic hardship. J-1s need the sponsor's written permission to work. The exemption ends once you become a resident for tax, even if your visa stays the same. F-2, J-2, M-2, and Q-3 family members aren't exempt.2 If an employer withheld these taxes by mistake, you ask the employer for a refund first, then the IRS on Form 843.2
The U.S. has Social Security agreements with some countries. Under most of them, a worker whom an employer sends from one of those countries to work in the U.S. for a limited time keeps paying only into the home country's system, with a certificate of coverage from that country's agency.27
Tax treaties
A tax treaty between the U.S. and the country where you live can reduce or remove U.S. tax on some income, for example a student's, trainee's, or teacher's pay.89 Most treaties have a "saving clause" that stops U.S. residents from using them, but many make exceptions that let some residents keep certain benefits.2 If you claim that a treaty reduces your tax, you generally must disclose it on your return.9 The usual form is Form 8833, but common claims, such as treaty benefits for students', trainees', and teachers' income and scholarships, don't need it.2 Some states don't follow tax treaties.8
Green card holders who file as nonresidents
A green card holder can claim to be a resident of another country under a treaty's tie-breaker rule and then figure the tax as a nonresident. That can trigger the expatriation tax for long-term residents.2 It can also cost you your green card. Claiming to be a nonresident to get a tax break, or not filing because you consider yourself a nonresident, is evidence that you gave up your permanent residence. When you apply for citizenship, it creates a presumption that you did, which you then have to disprove, and USCIS can find that you lost your green card this way.1011 The IRS warns that a permanent resident who must file as a resident and doesn't may be found to have abandoned that status.2 Before you file as a nonresident, talk to an immigration lawyer or accredited representative, and a tax professional. See Continuous residence.
Free help
The IRS's Volunteer Income Tax Assistance (VITA) program prepares basic returns for free, mainly for people who generally make about $70,244 or less, people with disabilities, and people with limited English.12 Some VITA sites are trained to prepare nonresident returns for students and scholars.3
Common mistakes
- Filing the wrong form, such as a Form 1040 when you're a nonresident. You fix it with Form 1040-X, attaching the correct return.2
- Not filing Form 8843 for each family member, including children.3
- Forgetting foreign accounts once you become a resident. Accounts back home count for the FBAR and Form 8938.56
- Having Social Security and Medicare taxes withheld from OPT or on-campus pay while you're a nonresident, or claiming the exemption after you've become a resident.2
- Filing as a nonresident, or not filing, as a green card holder.210
- Still claiming a tax treaty benefit after you've become a resident, when the treaty doesn't make an exception for it.2
Official sources
- 26 U.S.C. 7701(b): definition of resident alien and nonresident alien
- IRS Publication 519 (2025): U.S. tax guide for aliens
- IRS Publication 5876: VITA/TCE foreign student and scholar training guide, revised October 2026 (PDF)
- IRS: Form 8843 and instructions, 2026 (PDF)
- IRS: Report of Foreign Bank and Financial Accounts (FBAR)
- IRS: Comparison of Form 8938 and FBAR requirements
- SSA: U.S. international Social Security agreements
- IRS: United States income tax treaties, A to Z
- IRS Publication 901 (September 2024): U.S. tax treaties
- 8 CFR 316.5(c)(2): claiming nonresident status for income tax after becoming a permanent resident
- USCIS Policy Manual, Volume 12, Part D, Chapter 3: continuous residence (nonresident tax filing and abandonment)
- IRS: Free tax return preparation for qualifying taxpayers (VITA)