Substantial presence test calculator
You meet the substantial presence test, and are a US resident for tax, if you were in the United States on at least 31 days in the year and the weighted total is 183 days or more: all days of the year, plus 1/3 of the days of the year before, plus 1/6 of the year before that. Days as an exempt student on an F, J, M or Q visa (the first 5 calendar years) or as a teacher or trainee on a J or Q visa (2 years) do not count. A resident files Form 1040; a nonresident files Form 1040-NR.
Your days stay on your device. The count is made in your browser. Nothing you enter is sent to us or stored.
Your count for 2026
Enter your days in the United States on line 4. The count and what it means appear here.
General information, not tax advice. This result applies the IRS rules to your answers only. It is not advice for your situation and does not promise any IRS outcome. A CPA or Enrolled Agent reviews your facts before anything is filed.
Email me this result, or have a preparer confirm it
Your result is above; you do not need to give an email to see it. If you want a copy, or want a CPA or Enrolled Agent to check your answers, send them here. We reply within one business day.
How the substantial presence test counts your days
The IRS substantial presence test page sets two conditions. You must have been physically present in the United States on at least 31 days during the year, and on 183 days during the three years that end with it, counting all days of the year, 1/3 of the days of the year before and 1/6 of the days of the year before that. Both must be met.
The IRS gives this example: 120 days in each of 2023, 2024 and 2025.
| Year | Days in the US | Share that counts | Days counted |
|---|---|---|---|
| 2025 (the year tested) | 120 | All | 120 |
| 2024 | 120 | 1/3 | 40 |
| 2023 | 120 | 1/6 | 20 |
| Total | 180 |
The total is 180, so the test is not met for 2025. Three more days in 2025 would have made it 183. The calculator keeps the fractions as they are: 1/3 of 100 days is 33 1/3, and a total of 182 5/6 does not meet the test.
Any part of a day counts as a day. "United States" here means the 50 states, the District of Columbia and US territorial waters; it does not include US territories or US airspace.
Days that do not count
The IRS and Publication 519, chapter 1 list days you leave out of the count. Do not enter them in the calculator at all:
- Days you commuted to work in the US from your home in Canada or Mexico, if you commute regularly (on more than 75% of your workdays).
- Days you were in the US for less than 24 hours, in transit between two places outside the United States. A business meeting at the airport makes it a day that counts.
- Days as a regular crew member of a foreign vessel traveling between the US and a foreign country or a US territory.
- Days you could not leave because of a medical condition that arose while you were in the US. You explain these on Form 8843.
- Days in the US under a NATO visa as a member of a force or civilian component to NATO (not their family members).
Days as an exempt individual do not count either. "Exempt" here means exempt from counting days, not exempt from tax. The calculator asks about these days separately, because they have time limits.
Exempt days: Students, teachers, trainees and diplomats
| Who | Visa | Days do not count | Form |
|---|---|---|---|
| Student | F, J, M or Q | For the first 5 calendar years. Any part of a year counts as a year. Longer only if you show you do not intend to live in the US permanently. | Form 8843 |
| Teacher or trainee (anyone on a J or Q visa who is not a student) | J or Q | Not in a year when you were exempt for any part of 2 of the 6 years before, so usually for 2 calendar years. Longer in some cases when a foreign employer paid all your pay. | Form 8843 |
| Foreign government-related individual | A or G, but not A-3 or G-5 | The whole stay. A-3 and G-5 household staff count every day. | Not needed |
| Professional athlete | - | Only the days you competed in a charitable sports event | Form 8843 |
Sources: IRS: exempt individual who is a student, IRS: teachers and trainees, Publication 519, chapter 1. The years counted include years on another of these visas: a J-1 researcher who studied on an F-1 visa before has already used exempt years.
The spouse and unmarried children under 21 of an exempt person are exempt too, when their visa comes from that person's (for example F-2 or J-2). Each files their own Form 8843.
You keep the exemption only if you file Form 8843 on time: with your Form 1040-NR, or by itself by the Form 1040-NR due date. The IRS says that if you do not file Form 8843 on time, you cannot exclude those days, unless you show by clear and convincing evidence that you took reasonable actions to become aware of the filing requirements and significant steps to comply with them. IRS: Substantial presence test.
The calculator assumes you held the visa in every calendar year from the first one you name. If there were years in between without it, you have used fewer exempt years than it counts.
Test met with fewer than 183 days: The closer connection exception
The IRS closer connection page says you can still be treated as a nonresident, even though you meet the test, if all of these apply:
- You were present in the United States on fewer than 183 days during the year (days that count, so exempt days stay out).
- Your tax home, the general area of your main place of work, was in one foreign country for the whole year.
- You had a closer connection to that country than to the United States, shown for example by where your permanent home, family, belongings and driver's license are and where you vote.
- You had not applied, or taken other steps to apply, for a green card, and had no application pending.
You claim it on Form 8840: attached to your Form 1040-NR, or by itself to the IRS in Austin, Texas, by the Form 1040-NR due date including extensions. For tax year 2026 that is June 15, 2027, or April 15, 2027 if you had wages subject to US income tax withholding. If you do not file it on time, you cannot claim the exception, unless you show by clear and convincing evidence that you took reasonable steps to learn about and meet the requirement (Form 8840 instructions).
With 183 days or more in the year there is no closer connection exception. A student who does not qualify for it may still qualify for an exception for students only, with four conditions: no intent to live in the US permanently, compliance with the student visa, no steps toward a green card, and a closer connection to a foreign country. It is claimed with Form 8843 attached to Form 1040-NR (IRS: the closer connection exception for foreign students).
What your result means: Which return you file
| Your result | Your status for the year | What you file | Our service |
|---|---|---|---|
| Test not met, or an exception applies | Nonresident alien | Form 1040-NR if you had US income that needs a return. Form 8843 if you excluded days. Form 8840 for the closer connection exception. | Student tax return or Form 1040-NR |
| Test met, and you were not a resident the year before | Dual status: a nonresident until your residency starting date, a resident after it | Form 1040 marked "Dual Status Return", with a statement for the nonresident part (Form 1040-NR can be used) | Dual-status return |
| Test met, and you were a resident the year before | Resident alien from January 1 | Form 1040, reporting your income from inside and outside the US | We do not prepare full-year resident returns |
| Test met, but a tax treaty makes you a resident of the other country | Nonresident for figuring your tax | Form 1040-NR with Form 8833 | Form 1040-NR |
Sources: IRS: determining tax residency status; Publication 519, chapter 1 (First Year of Residency, Effect of Tax Treaties), chapter 6 (dual-status tax year) and chapter 7 (resident aliens file Form 1040 or 1040-SR). Your residency starting date is generally the first day of the year you were present in the US. A student who changes to a work visa during the year often has a dual-status year, and a preparer works out the exact date. The IRS dual-status page explains the rules for each part.
A green card holder is a resident under the green card test from the first day they are in the US as a lawful permanent resident, whatever the day count.
A nonresident files Form 1040-NR only when they need to. For students and scholars: There is no minimum amount of income that makes a nonresident student or scholar file a US return. A return is required for a taxable scholarship or fellowship grant, for income that is partly or fully exempt under a tax treaty, and for any other taxable income. It is not required when the only income is from foreign sources, interest from a US bank, savings and loan, credit union or insurance company, or a scholarship that is entirely tax-free. IRS: foreign students and scholars. Who else files is in who must file Form 1040-NR.
Questions about the substantial presence test
How do I count days for the substantial presence test?
Count every day you were physically in the United States at any time of the day, for the year and for each of the two years before. Leave out transit of less than 24 hours, regular commuting from Canada or Mexico, and days as an exempt individual. Then add all days of the year, 1/3 of the year before and 1/6 of the year before that. Your I-94 travel history from US Customs and Border Protection lists your entries and exits. Rule: IRS substantial presence test page.
Do my days as an F-1 student count?
Not for your first 5 calendar years as a student, teacher or trainee, and the year you arrive counts as one of them, even if you came in August. From the 6th calendar year your days count, unless you show the IRS you do not intend to live in the US permanently. Each year you exclude days, you file Form 8843. Rule: IRS: exempt individual who is a student.
I am a J-1 researcher or scholar. When do my days start to count?
A J-1 or Q-1 visitor who is not a student is a "teacher or trainee" for this test. You are not exempt in a year if you were exempt for any part of 2 of the 6 years before, so for most people the days start to count in the third calendar year. The exception: you were exempt in 3 or fewer of the 6 years and a foreign employer paid all your pay. Rule: IRS: teachers and trainees.
I meet the test but was in the US fewer than 183 days this year. Am I a resident?
Possibly not. If your tax home was in one foreign country all year, you had a closer connection to it than to the US, and you took no steps toward a green card, you can be treated as a nonresident by filing Form 8840 by the Form 1040-NR due date. Rule: IRS: closer connection exception.
I meet the test this year for the first time. Do I file Form 1040 for the whole year?
Usually not. If you were not a US resident the year before, you are a resident only from your residency starting date, generally the first day you were in the US that year. Before it you are a nonresident: a dual-status year. You file Form 1040 marked "Dual Status Return" with a Form 1040-NR statement for the nonresident part. Rule: Publication 519, First Year of Residency and chapter 6.
Does this calculator keep my answers?
No. The count is made in your browser. Your days and answers are not sent to us and are not stored, so they are gone when you close the page.
Your next step
- Fill out Form 8843 free
If you left out days as a student, teacher or trainee: the official IRS form, filled in your browser, with where to mail it.
- Student Tax Return (Form 1040-NR + Form 8843)
Nonresident students and J or Q scholars with US income. $99 per person, per tax year; our fee only, tax you owe is not included.
- Form 1040-NR Non-Resident Tax Return
Every other nonresident with US income. from $99 per person, per tax year; our fee only, tax you owe is not included.
- The substantial presence test explained
The green card test, the exceptions, tax treaties, and how residents and nonresidents are taxed.
Checked on November 28, 2026 against: IRS: Substantial presence test; IRS Publication 519 (2025), U.S. Tax Guide for Aliens; IRS: Exempt individual who is a student; IRS: Exempt individuals, teachers and trainees; IRS: Closer connection exception to the substantial presence test; IRS: The closer connection exception for foreign students; IRS Form 8843 and its instructions (2026); IRS Form 8840 and its instructions (2026); IRS: Green card test; IRS: Determining an individual's tax residency status. General information, not tax advice. USTAX is a private firm, not connected to the IRS.