Join the waitlist for the 2027 tax season
Blog · Residency

The Substantial Presence Test: Basic Residency Rules

Published November 6, 2026

Your residency status changes which income tax rules apply to you. For U.S. income tax, a noncitizen is either a resident alien or a nonresident alien. Publication 519 (2025), U.S. Tax Guide for Aliens, explains the tests. This guide is general information. It is not advice about your return.

Two tests for resident alien status

Publication 519 (2025) says you are a resident alien for tax purposes if you meet either the green card test or the substantial presence test. The green card test applies if you are a lawful permanent resident at any time during the calendar year. This guide covers the substantial presence test.

The 31-day and 183-day rules

The publication says you meet the substantial presence test for 2025 if you are physically present in the United States on at least 31 days during 2025, and on at least 183 days during the 3-year period that includes 2025, 2024, and 2023. The days in the 3-year period are counted with a weight for each year:

  • All of the days you were present in 2025 count in full.
  • One-third of the days you were present in 2024 count.
  • One-sixth of the days you were present in 2023 count.

A worked example from the publication

Publication 519 gives this example. You were present in the United States on 120 days in each of 2025, 2024, and 2023. You count all 120 days for 2025, 40 days for 2024 (one-third of 120), and 20 days for 2023 (one-sixth of 120). The total is 180 days. Because 180 is less than 183, you are not a resident under this test for 2025.

A few days can change the result. Keep a day-by-day travel log so you can check your count.

Days that do not count

Publication 519 counts each day you are physically present in the United States. It also lists days that do not count:

  • Days you are in the United States for less than 24 hours while you are in transit between two places outside the United States.
  • Days you are a crew member of a foreign vessel.
  • Days you cannot leave because of a medical condition that arose while you were in the United States.
  • Days you are an exempt individual, described below.

Publication 519 also says that a regular commuter from Canada or Mexico does not count the days he or she commutes to work in the United States. A regular commuter works in the United States on more than 75% of the workdays in the working period.

Exempt individuals

The publication says the term "exempt individual" does not mean someone who is exempt from U.S. tax. It refers to certain groups whose days in the United States are not counted. Examples include some people temporarily present under an "A" or "G" visa for foreign government work, other than the A-3 and G-5 classes. Another example is a teacher or trainee temporarily present under a "J" or "Q" visa who substantially complies with the visa requirements.

The publication says you are not an exempt individual as a teacher or trainee in 2025 if you were exempt as a teacher, trainee, or student for any part of 2 of the 6 preceding calendar years. The publication then lists conditions for an exception. Read those conditions before you count days in these categories. If you exclude days of presence as a student, the publication says you must file a fully completed Form 8843. Our guide to Form 8843 explains that form.

Closer connection to a foreign country

The publication says that even if you meet the substantial presence test, you may still be treated as a nonresident alien. That can happen if you have a closer connection to a foreign country than to the United States. The publication says your tax home must be in that foreign country for the entire current year. You must also file a fully completed Form 8840, Closer Connection Exception Statement for Aliens, by the due date. If you do not file it on time, the publication says you cannot claim this exception.

Simple steps

  1. List each day you were physically present in the United States in 2025, 2024, and 2023.
  2. Remove the days that fall under the exceptions and the exempt categories.
  3. Apply the weights: all of 2025, one-third of 2024, and one-sixth of 2023.
  4. Check both numbers: at least 31 days in 2025, and a weighted total of at least 183 days.
  5. If the rules require Form 8843 or Form 8840, file it by the due date.

The count answers only one question. The green card test, tax treaties, and other rules may also apply. For the full rules, read the publication. See also our guide to U.S. citizens living abroad for a different set of rules.

Upload your documents and answer a few simple questions to start your return.

Sources: Sources: IRS, Publication 519 (2025), U.S. Tax Guide for Aliens (https://www.irs.gov/pub/irs-pdf/p519.pdf) This is general information, not advice about your specific return.

More guides on: Expats, military and international taxes

← Back to the blog · Leer en español

Get tax updates in your inbox

Occasional emails about deadlines, tax-law changes and File US Taxes news. No spam, unsubscribe anytime.