US Residency

Substantial Presence Test Calculator: US Tax Residency Explained

How the IRS Substantial Presence Test works - the weighted 3-year day count, the 31-day and 183-day thresholds, exempt individuals and exceptions, and how to calculate it automatically on iPhone.

8 min read · 8 July 2026 · Tax Residency Tracker Team

A substantial presence test calculator answers one question that trips up almost every non-citizen who spends real time in America: am I a US tax resident this year? The IRS does not use a plain 183-day count. Instead it applies a weighted three-year formula that can quietly push you over the line even in a year you spent well under half your time stateside. This guide explains exactly how the Substantial Presence Test works, what counts as a day, who is exempt, and how to run the whole calculation automatically on your iPhone.

What the Substantial Presence Test is

The Substantial Presence Test (SPT) is the IRS rule that decides whether a non-US-citizen is a resident alien for tax purposes based purely on physical presence. It matters because a resident alien is generally taxed on worldwide income and must file like a US citizen, whereas a nonresident alien is usually taxed only on US-source income. Getting the count right is the difference between a domestic and an international tax return.

You meet the test for a given calendar year if both of these are true:

  • You were physically present in the US on at least 31 days during the current year, and
  • You reach at least 183 days over a three-year weighted total, counted using the formula below.

Miss either threshold and you generally do not meet the test. The 31-day floor is easy to overlook, but it means a single short trip in the current year can be the trigger that "activates" days carried over from previous years.

The weighted three-year formula

This is where a substantial presence test calculator earns its keep. The IRS does not add up three years of days at face value - it discounts the older years:

  • Current year: every US day counts in full (× 1).
  • Prior year: each US day counts as one-third of a day (× 1/3).
  • Year before that: each US day counts as one-sixth of a day (× 1/6).

Add those three weighted figures together. If the total is 183 or more - and you cleared the 31-day current-year floor - you generally meet the Substantial Presence Test and are treated as a US resident alien for that tax year.

Weighted 3-year total vs 183 Current year 120 × 1 = 120 + Prior year 120 × 1/3 = 40 + Year before 120 × 1/6 = 20 Weighted total = 180 183 threshold Under 183 → nonresident
The same 120 US days weigh differently by year. Three years at 120 days each total 180 weighted days - just under the 183 line, so this traveller stays a nonresident alien.

Notice how sensitive the result is: a traveller with an identical 120 days in each of three years lands at 180 - three days short. Add a single week to the current year and they cross the threshold. That non-linear weighting is exactly why counting by hand goes wrong.

What counts as a day of presence

For the SPT, any part of a day spent in the US generally counts as a full day of presence. Land at 11:00 pm and that whole day is on your count; leave at 6:00 am and the departure day counts too. This is the strictest common counting method, and it is the same "any-part-of-a-day" rule many US states use - see how to count days for tax residency for how methods differ across jurisdictions.

Exempt individuals and days that don't count

Some days in the US are not counted at all. If you fall into an "exempt individual" category, those days are excluded from your SPT total - which can keep you a nonresident even after a long stay. The main cases:

  • Certain visa holders - students on F, J, M or Q visas are exempt for up to 5 calendar years, while teachers or trainees on J or Q visas are exempt for 2 calendar years out of the last 6, under the rules for each category.
  • Foreign-government-related individuals - people present on A or G visas, and their immediate family, in connection with that status.
  • Professional athletes temporarily in the US to compete in a charitable sports event.
  • Medical-condition days - days you intended to leave but could not because of a medical condition that arose while you were in the US.
  • Regular commuters from Canada or Mexico who travel to work in the US, subject to the commuting-day conditions.
  • Transit days - time in the US of under 24 hours while travelling between two points outside the US.

Each category has its own conditions and paperwork (exempt individuals typically file Form 8843 to claim the exclusion). Do not assume a day is exempt - confirm you actually qualify before removing it from your count.

When you meet the test but still aren't a resident

Crossing 183 weighted days is not always the end of the story. Two well-established routes can still leave you a nonresident alien even when the raw numbers say otherwise:

  • Closer Connection Exception: if you were present fewer than 183 days in the current year, maintain a tax home in another country, and have a closer connection to that country than to the US, you may claim to remain a nonresident (typically via Form 8840).
  • Tax-treaty tiebreaker: if the US and your home country have a tax treaty, its residency tiebreaker rules can assign your residence to the other country, overriding the SPT result.

These exceptions exist and are widely used, but they carry their own tests and filing requirements. The safe approach is to know your SPT number precisely first, then decide with a professional whether an exception applies - a low, well-documented day count is the strongest possible starting position.

Run the Substantial Presence Test automatically on iPhone

Tracking three overlapping years, weighting each one correctly, and remembering the 31-day floor is exactly the kind of arithmetic that fails under pressure. Tax Residency Tracker does it continuously in the background:

  • Automatic SPT calculation - the app runs the US Substantial Presence Test weighted formula for you, so your residency status updates as you travel instead of once a year at filing time.
  • Thresholds screen - see your weighted days against 183 at a glance, with the per-year breakdown (current year, prior year, year-before-that) and the 31-day current-year check shown alongside your Schengen 90/180 and country totals.
  • Automatic GPS US-day detection - the app spots when you enter and leave the US and creates dated stays, even when it is closed, so every US day is captured without you logging it.
  • CSV export for your accountant - hand over a dated, evidenced record of US days, with optional proof documents attached, if you ever need to show your work.
  • On-device and private - your travel history is processed on your iPhone and never uploaded, so the record stays confidential while remaining audit-ready.

Frequently asked questions

Does the Substantial Presence Test use a simple 183-day count?

No. The 183 threshold applies to a weighted three-year total, not to current-year days alone. Current-year days count in full, prior-year days at one-third, and the year before that at one-sixth. You also need at least 31 days in the current year for the test to apply at all.

Do arrival and departure days count?

Yes. Under the "any part of a day" rule, both the day you arrive in the US and the day you leave count as full days of presence, unless the day falls under a specific exception such as a transit stay of under 24 hours.

Can I meet the test and still file as a nonresident?

Sometimes. The Closer Connection Exception or a tax-treaty tiebreaker can keep you a nonresident even after you meet the SPT numerically, provided you satisfy their conditions and file the right forms. Knowing your exact day count first is what makes those claims defensible.

Do days on a student or work-exchange visa count?

Often not. Students on F, J, M or Q visas and teachers or trainees on J or Q visas are typically "exempt individuals" for a limited number of years, meaning those days are excluded from the SPT - but only if you qualify and file the required form. Confirm your category before excluding any days.

Next, see how the 183-day rule works globally, how to track state residency for taxes on top of the federal test, and how to prove tax residency for an audit - or browse all tax-residency guides.

Related guides

US Residency How to Track US State Residency for Taxes How US state residency really works - statutory residency vs domicile, the 183-day day count, why the burden of proof is on you, and how to track your days by state automatically on iPhone. 8 min read US Residency The California 183-Day Rule and Residency, Explained Does California have a 183-day rule? How California residency really works - the facts-and-circumstances test, the nine-month presumption, the narrow six-month presumption, the 546-day safe harbor, and how to document your days on iPhone. 7 min read US Residency New York's 183-Day Rule and Statutory Residency How New York's 183-day statutory-residency rule works - the 184-day line, the permanent-place-of-abode test, how any part of a day counts, and how to keep audit-proof records on iPhone. 7 min read
Browse all guides