US · rule v2026.1 · last verified 2026-08-28
Substantial Presence Test calculator
Work out whether you meet the IRS Substantial Presence Test: the three-year weighted count, days remaining, and your latest safe departure date.
Runs entirely in your browser. Nothing you enter is transmitted.
Enter your US days to evaluate.
The US Substantial Presence Test, explained explains the rule in full.
The calculator above runs the same rules engine as the Residay app, checked against golden test vectors. It works entirely in your browser — nothing you enter is transmitted.
What the test does
The Substantial Presence Test is how the IRS decides whether someone who is not a US citizen or green-card holder is nonetheless a US tax resident for a calendar year. It is a three-year weighted count, and that reach-back is what catches people out: a year with only a few months in the country can still tip you over if the two preceding years were heavy.
US · v2026.1
US Substantial Presence Test
You meet the Substantial Presence Test if you are present in the US at least 31 days in the current year AND your weighted total reaches 183: all current-year days, plus one third of last year's days, plus one sixth of the year before. Any part of a day present counts (with narrow exceptions such as certain transit and commuting days). Meeting the test makes you a US tax resident unless an exception (closer connection, treaty) applies.
| Reference period | calendar year |
|---|---|
| Aggregation | 183 days over 3 years |
How days are counted
- Any part of a day present counts as a full day.
- Pure transit, without passing border control, is excluded.
The arithmetic, exactly
Two conditions must both hold. You were present at least 31 days in the current year, and your weighted total reaches 183 across 3 calendar years.
The weights are best handled in sixths rather than fractions, because that is the only way to keep the arithmetic exact:
- Each current-year day counts 6 sixths.
- Each day from the preceding year counts 2 sixths.
- Each day from the year before that counts 1 sixth.
Rounding each year’s contribution before adding them is a common source of off-by-one answers near the threshold. This calculator sums in whole sixths and compares once, at the end.
A worked example
Someone spends 120 days in the US this year, 180 last year and 180 the year before. The current year contributes 120 days at full weight. Last year contributes 60. The year before contributes 30. The weighted total is 210 — comfortably over the threshold — even though this year alone was nowhere near it. The gate is satisfied too, so the test is met.
Reverse the pattern and the answer flips: 180 days this year with nothing in the two prior years gives a weighted total of 180, just under the line.
Latest safe departure date
The headline output most calculators omit is the one that helps you plan: given where you already are, how many more days can you stay, and what date does that make?
Because any part of a day counts, the departure day itself is a counted day. If the arithmetic leaves room for five more days, the fifth day is the last one you can be present — leaving on the sixth is already too late. The calculator does that subtraction for you, and clamps to 31 December, since days after that fall into a new current year and re-weight rather than simply accumulate.
What this calculator does not do
It counts presence. It does not know which of your days are excluded, and those exclusions are where borderline cases are usually won: regular commuting from Canada or Mexico, transit of under 24 hours between two foreign points, days you could not leave for a medical reason that arose while you were in the country, and days as an exempt individual. Subtract those before entering your totals.
It also cannot tell you whether the closer connection exception applies. If you were present fewer than 183 days in the current year, kept a tax home abroad and had a closer connection to that country, Form 8840 may preserve non-resident status even though the weighted test is met. Note the asymmetry: the exception is judged on the current year alone, while the test that caught you spans three. Crossing that figure in the current year closes the door.
Finally, the federal test says nothing about states. New York in particular runs its own statutory residency test with different counting and its own audit programme, and clearing this one is no evidence of clearing that.
Last reviewed 2026-08-29
Not tax or legal advice. Verify with a qualified professional.
Common questions
How is the Substantial Presence Test calculated?
Count every day you were physically present in the United States for any part of the day. Take all of the current year's days, add a third of the previous year's, and add a sixth of the year before that. If the weighted total reaches 183 and you were present at least 31 days in the current year, you meet the test.
What is the 31-day rule in the Substantial Presence Test?
It is a gate that sits in front of the weighted count. Unless you were present at least 31 days in the current year, you cannot meet the test at all, no matter how large your weighted total from prior years would be.
Do arrival and departure days count for the Substantial Presence Test?
Yes. Any part of a day present counts as a full day, so both count. There is no midnight rule, which makes this stricter than the UK Statutory Residence Test.
Which days are excluded from the Substantial Presence Test?
Days you commute regularly from Canada or Mexico, days in transit of under 24 hours between two foreign points, days you could not leave because of a medical condition that arose in the United States, and days as an exempt individual such as certain students, teachers and diplomats. Subtract those days before entering your counts here.
Can I meet the test and still file as a non-resident?
Possibly. The closer connection exception preserves non-resident status if you were present fewer than 183 days in the current year, kept a tax home abroad and had a closer connection to that country, claimed on Form 8840. A treaty tie-breaker may also apply. Both are worth professional advice.