What the substantial presence test is
The U.S. taxes residents and nonresidents differently. A person who is not a citizen is treated as a resident for a calendar year if they meet the green card test (lawful permanent resident at any time in the year) or the substantial presence test, which counts days of physical presence. This calculator covers only the day count. It is an IRS formula, not an immigration status, and spending many days in the U.S. does not give anyone a visa, a green card or the right to stay.
The two conditions
According to the IRS and Publication 519, you meet the test for the current year when both are true:
- you were in the U.S. on at least 31 days during the current year, and
- your days this year, plus one third of your days in the first year before, plus one sixth of your days in the second year before, add up to 183 or more.
The IRS example is 120 days in each of three years: 120 + 40 + 20 = 180, so the test is not met. The 31-day condition is a hard floor: with 30 days this year you do not meet the test, however long your earlier years were.
Another example: 150 days this year, 99 last year and 40 the year before give 150 + 33 + 6.67 = 189.67, so both conditions hold. With 98 days last year and none before, the total is 182.67, just short. The calculator also shows the fewest days this year that would meet the test given your two earlier years.
Which days count
Count each calendar day on which you were in the U.S. for any part of the day, after removing the days the IRS does not count:
- days as an exempt individual: a teacher or trainee on a J or Q visa, a student on an F, J, M or Q visa, a holder of an A or G visa (other than A-3 and G-5), or a professional athlete on the days they compete in a charitable sports event;
- days you could not leave because of a medical condition that arose while you were here;
- days you commute regularly from Canada or Mexico, days of under 24 hours in transit between two places outside the U.S., and days as a regular crew member of a foreign vessel.
Exempt status has limits, for example a general five-calendar-year limit for students. If you exclude days as an exempt individual or for a medical condition, you generally must file Form 8843 by the due date, and filing late can cost you the exclusion.
Exceptions that can change the answer
The closer connection exception can let you be treated as a nonresident if you were here fewer than 183 days in the year, kept a tax home in one foreign country all year, and had a closer connection to it than to the U.S. It is not available if you took steps toward a green card, and it is claimed on Form 8840 filed on time. Tax treaties can also treat you as a resident of the other country, and a first-year choice can start residency early. The year you arrive or leave can be a dual-status year, with part as a nonresident and part as a resident. The calculator does not decide any of these.
What this calculator leaves out
It does not know your visa, immigration history, treaty country, income or what you would owe, and it counts only the days you type. If you are close to the line or have exempt days, an exception or a treaty question, read the IRS pages below or ask a qualified tax professional. For tax numbers see the income tax calculator, and for a taxpayer number without a Social Security number see the ITIN guide.
Frequently asked questions
Is the 183-day rule the same as spending 183 days here this year?
No. The 183 is a weighted total over three years: this year's days, one third of last year's and one sixth of the year before. You can meet the test with fewer than 183 days this year if the earlier years were long, but you still need at least 31 days this year.
If I meet the test, do I owe U.S. tax?
Not automatically. Meeting the test generally makes you a resident for tax purposes for that year, and residents are generally taxed on worldwide income. Whether you owe tax depends on your income, deductions, credits and any treaty, and the closer connection exception or a treaty may change your status.
Do days as an international student count?
Days as an exempt student on an F, J, M or Q visa who substantially complies with the visa are generally not counted, usually for up to five calendar years, and you generally file Form 8843. After that they count unless you show you do not intend to reside permanently in the U.S. Enter your days after taking out the exempt days.
Official sources
Checked on October 17, 2026: IRS, Substantial presence test (last reviewed March 14, 2026), IRS, Determining an individual's tax residency status (February 11, 2026), IRS Publication 519 (2025), U.S. Tax Guide for Aliens, IRS, Closer connection exception (July 16, 2026), IRS, Dual-status aliens (July 23, 2026), IRS, About Form 8843, IRS, About Form 8840.
This page gives general information and arithmetic, not tax, legal or immigration advice. Tax treaties and exceptions may change the result. See IRS Publication 519 or a qualified professional for your situation.