You are a nonresident alien for U.S. federal tax purposes if you are neither a U.S. citizen nor a lawful permanent resident (green card holder) and you do not meet the substantial presence test for the tax year in question. That is the whole rule in one sentence, but the details matter far more than the sentence suggests. The two tests — the green card test and the substantial presence test — interact with visa classifications, treaty elections, transitional rules for students and teachers, and the calendar itself. Most people who search "am I a nonresident alien for tax purposes" fall into one of a handful of recognizable patterns, and this article walks through each of them.
A note on scope: this article addresses individual income tax residency under the Internal Revenue Code as it stands at the reference date of November 13, 2026. It does not address state tax residency, which follows its own rules, or the tax residency rules of any country other than the United States. It also assumes you are not a U.S. citizen — citizens are never nonresident aliens regardless of where they live.
The Starting Point: Citizen, Resident Alien, or Nonresident Alien
U.S. tax law places every individual into one of three buckets: citizen, resident alien, or nonresident alien. Only the third bucket is the subject here. A resident alien is taxed on worldwide income much like a citizen; a nonresident alien is taxed on U.S.-source income, with different rules for different categories of income, and files a different set of forms (Form 1040-NR rather than Form 1040).
The confusing part is that "resident" in this context has nothing to do with where you actually live day to day, and "nonresident" has nothing to do with whether you own or rent a home. A person can live in the United States for years and still be a nonresident alien for tax purposes — an F-1 student in his fifth year of study is a common example. Conversely, someone who has never set foot in the United States can be a resident alien for tax purposes because of a green card. Immigration status and tax status are related but not identical.
The Green Card Test
If you hold an alien registration card — a green card — issued by U.S. Citizenship and Immigration Services, you are a lawful permanent resident and therefore a resident alien for tax purposes. The test is met on the first day of the tax year in which you hold the card, and it continues until the card is revoked, abandoned, or administratively or judicially determined to have been abandoned.
Two practical consequences follow. First, a green card holder who lives abroad for the entire year is still a resident alien for U.S. tax purposes unless the card has been formally abandoned or revoked — moving away does not switch you to nonresident status by itself. Second, the year of the card's issuance counts as a resident year even if the card arrives in December, which can sharply increase the income reportable for that year. People who receive a green card late in the year sometimes qualify for a first-year choice election to be treated as a resident for only part of the year, but that election produces partial-year residency, not nonresidency.
If you do not hold a green card, you are not automatically a nonresident alien — the substantial presence test must be checked next.
The Substantial Presence Test
The substantial presence test is a counting rule. You are a resident alien for a calendar year if you were physically present in the United States on at least 31 days during that year and the weighted sum of your days of presence over the current year and the two preceding years equals or exceeds 183. The weighting is: every day in the current year counts as one; every day in the immediately preceding year counts as one-third; every day in the year before that counts as one-sixth.
An illustrative example: suppose you were present 120 days in 2026, 120 days in 2025, and 120 days in 2024. The weighted total is 120 + (120 ÷ 3) + (120 ÷ 6) = 120 + 40 + 20 = 180. That is below 183, so on these facts alone you would not meet the test in 2026. Bump each year to 130 days and the total becomes 130 + 43.33 + 21.67 = 195, which clears the threshold. Fractional results are not rounded up to reach the threshold; the arithmetic is done as written.
Days of presence generally mean any day you were physically in the United States at any time during the day, with important carve-outs discussed below. Days spent in U.S. territories are treated differently depending on the territory; days spent commuting from Canada or Mexico to work in the United States are generally not counted.
If you meet neither the green card test nor the substantial presence test, and no exception or election applies, you are a nonresident alien for that year.
Days That Do Not Count Toward the Substantial Presence Test
The statute excludes several categories of days, and these exclusions are where many people's self-assessment goes wrong. Days do not count if you:
Commute to work in the United States from Canada or Mexico on a regular basis. Are in transit between two foreign points through the United States, provided you remain in an airport or other transit area and do not attend a business meeting or similar event while there. Are a crew member temporarily present on a foreign vessel that travels between the United States and a foreign port. Are temporarily present because of a medical condition that arose while you were in the United States and prevented you from leaving — though this exclusion is narrow and requires documentation, and it cannot be used if you were already a resident alien when the condition arose. Are a student, teacher, or trainee in certain visa categories, or a professional athlete temporarily in the United States to compete in a charitable sports event.
Some of these exclusions only remove days from the count; others do more, such as exempting an entire category of visa holders from the test for a period of years, as described next.
Students, Teachers, and Trainees: The Exempt-Individual Rules
This is the single largest source of confusion for people asking whether they are nonresident aliens, because the answer for a student or scholar often changes on a schedule that has nothing to do with how long they feel they have "lived" in the country.
An individual in F, J, M, or Q student status is generally an "exempt individual" for the substantial presence test for any part of the year in which the individual does not meet the substantial presence test — but the exemption is not indefinite. Students in F, J, M, or Q status are exempt for a period of five calendar years, after which they begin counting days and can become resident aliens by meeting the substantial presence test. Teachers and trainees in J or Q status are exempt for two calendar years out of a six-year period. The counting of those years is a technical exercise: the years are counted in a specific order and certain partial years consume a year of the exemption. Getting this wrong is one of the most common errors on student and scholar returns.
Two related traps deserve mention. First, the five-year window applies to the student in F, J, M, or Q status; a student who changes status, or who has a gap in status, may restart or alter the counting in ways that are not obvious. Second, a student who is exempt from the substantial presence test is still a nonresident alien, but a student who is exempt and also holds a green card is a resident alien — the green card test is not subject to the exempt-individual rules.
The Closer Connection Exception
Even if you meet the substantial presence test, you can still be a nonresident alien for the year if you satisfy the closer connection exception. The requirements are: you were present in the United States fewer than 183 days in the current year; you have a tax home in a foreign country during the year; and you have a closer connection to that foreign country than to the United States. You must file Form 8840 to claim the exception. This matters most for people who spend substantial time in the United States — snowbirds, for instance — but whose personal and economic life remains centered abroad. The 31-day floor of the substantial presence test still applies for the purpose of getting into the test, but the exception itself requires fewer than 183 days in the current year, which is stricter than the weighted 183-day figure.
Treaty Elections: When a Tax Treaty Overrides the Default Rules
The United States has income tax treaties with many countries, and those treaties commonly contain tie-breaker rules — "residence" articles — that determine which country treats an individual as a resident when both countries' domestic rules would claim the person. A nonresident alien who is a resident of a treaty country under the treaty's tie-breaker can elect to be treated as a nonresident alien of the United States for the year, even if the substantial presence test would otherwise make them a resident. The election is made on a properly filed return with the appropriate form and a disclosure of the treaty position, and it can have significant consequences: it generally prevents the person from claiming certain resident-only benefits for that year, and it affects withholding on subsequent payments. Treaty elections are not do-it-yourself material for most people, but knowing they exist prevents the mistaken conclusion that the substantial presence test is the end of the analysis.
Dual-Status Years
A person can be a resident alien for part of a calendar year and a nonresident alien for the rest. This is called dual status, and it typically arises in the year someone arrives in the United States to establish residency or leaves to establish a foreign tax home. During the resident portion, worldwide income is reportable; during the nonresident portion, only U.S.-source income is. A dual-status return has its own filing mechanics, and elections exist to be treated as a full-year resident in some cases — which is sometimes advantageous and sometimes not.
The key point for the original question is that dual status is not a third category; it is a combination of the two. If someone asks whether they are a nonresident alien for a year in which they were dual status, the precise answer is that they were a nonresident alien for part of the year.
What "Nonresident Alien" Means for Filing and Withholding
Being a nonresident alien changes the paperwork and the withholding rules. Nonresident aliens generally file Form 1040-NR. Income that is effectively connected with a U.S. trade or business is taxed at graduated rates; most other U.S.-source investment income — interest, dividends, royalties, and certain other categories — is taxed at a flat 30 percent, reduced by treaty, and is often collected through withholding by the payer, typically on Form 1042-S. Wages are generally subject to withholding under the same rules as for employees, though treaty exemptions may apply. Social Security and Medicare tax treatment depends on visa status and treaty provisions rather than on residency alone, which is a separate analysis that catches many students and scholars off guard.
The classification also determines eligibility for deductions, credits, and filing statuses. Nonresident aliens cannot generally claim the standard deduction, cannot file jointly with a spouse unless specific elections apply, and cannot claim certain credits. These limits are a common reason people are surprised to learn they are nonresident aliens — the return they expected to file is not the return the law requires.
How to Work Through Your Own Situation
A practical sequence for most people asking this question:
1: Check citizenship. If you are a U.S. citizen, the analysis ends; you are not a nonresident alien. 2: Check the green card. If you hold a green card, you are a resident alien unless it has been formally revoked or abandoned. 3: Determine whether you are an exempt individual. If you are in F, J, M, or Q status as a student, or J or Q status as a teacher or trainee, work out how many exempt years you have used, because this may take you out of the substantial presence test entirely. 4: If not exempt, count days for the current year and the two preceding years using the one, one-third, one-sixth weighting, applying the excluded-day categories. 5: If the test is met, check the closer connection exception and any treaty tie-breaker that might apply. 6: Consider dual-status and election rules if your arrival or departure occurred mid-year. 7: File the correct form — Form 1040-NR with the appropriate treaty or exception attachments, or Form 1040 if you are a resident alien.
Record-keeping is not optional in practice. The substantial presence test is proved with entry and exit records, and the excluded-day categories require documentation. People who reconstruct their travel dates from memory after the fact routinely get the count wrong.
Common Misconceptions Worth Clearing Up
A few beliefs come up repeatedly and are worth correcting directly. Living in the United States for more than half the year does not automatically make you a resident alien — the weighted count and the exempt-individual rules can produce a different result. Paying U.S. tax does not make you a resident alien; nonresident aliens pay U.S. tax on U.S.-source income all the time. Having a U.S. driver's license, a U.S. bank account, or a U.S. address does not change your tax residency. And a green card that has "expired" for immigration purposes but has not been formally abandoned or revoked may still support resident alien treatment, which is a question worth raising with a qualified tax professional rather than guessing.
Where the Answer Can Genuinely Be Uncertain
Some situations are not resolvable from general rules alone. Someone who holds a green card but has not lived in the United States for years needs an analysis of abandonment, which turns on facts — home, family, ties, and the intent to return. A student whose program length, status changes, or gaps in enrollment affect the exempt-year count needs the counting rules applied to their specific record. A person who is a resident of a treaty country under that country's law and also meets the substantial presence test needs the treaty's tie-breaker language read against their facts. In those cases the stable framework above identifies the right questions but does not produce a unique answer, and the reader should treat the framework as the map rather than the destination.
For most readers, though, the direct answer at the top holds: if you are not a citizen, do not hold an active green card, and do not meet the substantial presence test after applying the exempt-individual and excluded-day rules, you are a nonresident alien for U.S. tax purposes for that year. The work is in confirming each of those conditions against your own dates and status.
This article provides general educational information about U.S. federal tax residency rules and is not a tax determination or individualized advice. Residency depends on your specific immigration status, travel history, and treaty facts, and errors can affect filing obligations, withholding, and penalties. For a binding conclusion about your own situation, consult a qualified U.S. tax professional or the IRS directly.