The Substantial Presence Test, Day by Day
The substantial presence test is the default door into U.S. tax residency for anyone who is not a citizen or a green card holder. It is a mechanical day count, not a judgment call, and it runs across three years at once. Most people who fail it do so because they counted only the current year and stopped.
The two-part gate
IRC §7701(b)(3) sets the test in two stages. First, a person must be present in the United States for at least 31 days during the current calendar year. If that threshold is not met, the analysis ends there: the weighted formula never runs, and the person is not a resident under this test for the year, regardless of how many days were spent in the U.S. in prior years.
Second, once the 31-day gate is cleared, the formula adds up a weighted total across three years:
| Year | Days counted | Weight |
|---|---|---|
| Current year | Full count | 1 (100%) |
| Prior year | Days present | 1/3 |
| Second prior year | Days present | 1/6 |
If the sum of current-year days, one-third of prior-year days, and one-sixth of second-prior-year days reaches 183 or more, the person is a U.S. tax resident for the current year under this test. Because the weighting decays quickly, a person present in the U.S. 183 days or more in the current year alone always meets the test on that year's count by itself; the three-year formula mainly catches people who split time more evenly across the period, or who ramp up presence gradually.
A worked example
Someone present 120 days in the current year, 120 days in the prior year, and 120 days in the second prior year is not automatically a resident on a naive average. The math is 120 + (120 ÷ 3) + (120 ÷ 6) = 120 + 40 + 20 = 180. That falls just short of 183, so the test is not met for that year on those facts. The same person present 122 days each year clears it: 122 + 40.67 + 20.33 = 183.
This is why the test rewards attention to the prior two years, not just the current one. A person who was heavily present in the U.S. two years ago carries a real, if shrinking, weight into this year's count.
What counts as a day of presence
Treas. Reg. §301.7701(b)-1(c)(1) treats a person as present on any day they are physically in the United States for any part of the day, with narrow exceptions. A traveler who arrives at 11:50 p.m. still has a day of presence for that date. There is no fractional day counting under the general rule; a single minute in the country is enough to trigger a full day.
Days that are excluded before the count begins
Several categories of physical presence are excluded from the day count entirely, meaning they never enter the formula in the first place. These matter because they can take someone who looks close to 183 days and move them well under it:
- Commuters. Regular commuters from Canada or Mexico who work in the United States are not counted for their commuting days, under Treas. Reg. §301.7701(b)-3(e).
- Transit days. A day spent in the U.S. for less than 24 hours while in transit between two points outside the United States is excluded.
- Crew members. A regular crew member of a foreign vessel engaged in transportation between the U.S. and a foreign country generally does not count days present in connection with that transportation, subject to conditions.
- Medical condition days. Days a person is unable to leave the U.S. because of a medical condition that arose while they were present are excluded, subject to a separate certification requirement covered in its own dossier.
- Exempt individuals. Certain visa categories, including many F, J, M, and Q visa holders, teachers, trainees, and students, exclude their days of presence entirely for a defined period, covered in the exempt-individual dossier.
An exempt individual's days are not merely favorably treated; they do not enter the count at all for the years the exemption applies. A student properly classified as an exempt individual can spend the entire year physically in the United States and still show zero days for purposes of this test.
What meeting the test actually changes
This is the part that gets underweighted. A person who meets the substantial presence test becomes a U.S. tax resident for the year, and a U.S. tax resident is taxed on worldwide income under IRC §61 and §7701(b)(1)(A), not merely on U.S.-source income. Foreign salary, foreign investment income, and foreign business income all come into the U.S. return. Foreign bank accounts and financial assets may also trigger FBAR and FATCA reporting once residency status changes, independent of whether any additional tax is owed.
The change is not elective and does not depend on intent. A person can meet the test by accident, through travel patterns they did not track, and become a resident for the year without ever deciding to be one. This is the single most common way non-U.S. individuals unexpectedly acquire U.S. tax residency.
The residency starting date
Under Treas. Reg. §301.7701(b)-4(a), a person who meets the substantial presence test does not become a resident retroactively for the entire year. Residency generally starts on the first day the person was physically present in the United States during the calendar year in which the test is met, subject to a de minimis rule that disregards up to 10 days of presence at the start of the period if the person can establish a closer connection to a foreign country during those days. This starting-date mechanic is what produces dual-status returns, covered separately, for the year residency begins.
The closer connection exception
A person who meets the substantial presence test but was present fewer than 183 days in the current year, maintains a tax home in a foreign country, and has a closer connection to that foreign country than to the United States may claim the closer connection exception on Form 8840, filed with a timely return. This exception is not automatic; it must be affirmatively claimed and is unavailable to anyone with a pending green card application, among other disqualifiers.
Treaty tie-breaker as a separate path
A person who is a resident under this test and also a tax resident of a treaty country under that country's domestic law may be able to claim treaty tie-breaker relief instead of, or in addition to, the closer connection exception. That path requires disclosure on Form 8833 and is covered in its own dossier, since it operates on different mechanics and carries its own consequences.
Partial-year residency and the last-day rule
The mirror image of the residency starting date is the residency ending date, which matters for anyone who meets the test in a given year but leaves the United States before year-end and does not expect to return. Under Treas. Reg. §301.7701(b)-4(b), a person's last day of residency can, in limited cases, be treated as an earlier date than December 31 if the person establishes that, for the remainder of the calendar year, their tax home was in a foreign country and they had a closer connection to that country than to the United States. This is a narrower and more fact-intensive test than the starting-date rule, and it does not apply at all to a person who meets the test again in the following year; it is available only where the following year is genuinely a nonresident year.
Multi-year travel patterns and cumulative exposure
Because the formula looks backward two years, a person's exposure in the current year depends partly on choices made in years that have already closed. Someone who spent 150 days in the U.S. two years ago and 150 days last year carries a combined weighted total of 25 days (150 ÷ 6) plus 50 days (150 ÷ 3) before a single day of current-year presence is counted. That person only needs 108 current-year days to reach 183. A person with no U.S. presence in either of the prior two years starts from zero and can spend up to 182 days in the current year alone without meeting the test. The same current-year travel plan produces very different residency outcomes depending on what happened in the two years before it, which is why a single year's calendar is not enough information to answer the question.
Recordkeeping in practice
The test is applied to actual entry and exit dates, not to visa validity periods, employment start dates, or lease terms. U.S. Customs and Border Protection travel history, available to individuals through an online request, is the most reliable single source for reconstructing past presence, but it records border crossings, not the exclusions described above. A person's own records need to separately track which of those crossing days, if any, fall into an excluded category, since CBP's data will not make that determination. Reconstructing several years of travel after the fact, once a residency question has already arisen, is materially harder than tracking it contemporaneously, and errors tend to run in the direction of undercounting exclusions the traveler forgot to document at the time.
Because the count spans three years and several categories of days are excluded before the formula ever runs, anyone tracking U.S. presence for tax purposes needs the actual travel calendar, not an estimate. The interactive calculator at /substantial-presence-test walks through the same weighted formula described here and applies it to specific dates.