Free tool

Substantial Presence Test calculator

The IRS Substantial Presence Test (SPT) decides whether non-citizens are US tax residents. It's a 3-year weighted formula, easy to misapply, expensive to miss. Plug your numbers in and see your status.

Days in the United States

Count any day on which you were physically present in the US, with limited exceptions (transit days, exempt-individual days, medical days). Partial days count as full days.

Weighted total
0.00 / 183
  • 2026: 0 × 1 = 0.00
  • 2025: 0 × 1/3 = 0.00
  • 2024: 0 × 1/6 = 0.00

The SPT formula

You meet the Substantial Presence Test if both are true:

  • You were physically present in the US for at least 31 days in the current year, AND
  • Your weighted total is 183 days or more:current + 1/3 × prior + 1/6 × two-years-prior

Exempt individuals

Some categories of people exclude their US days entirely: foreign government-related individuals (A or G visa), teachers and trainees on J or Q visa (limited), students on F, J, M, or Q visa (limited to 5 calendar years), and a few others. If you're an exempt individual, this calculator's inputs should reflect only non-exempt days.

The closer-connection exception

Even if you meet the SPT, you can still be treated as a non-resident if all of these are true: your current-year US days are under 183, you maintain a tax home in a foreign country, and you have a closer connection to that country. File Form 8840 to claim the exception.

Read the full guides: The Substantial Presence Test calculated step-by-step and The closer-connection exception (Form 8840) explained.

Questions

The Substantial Presence Test, step by step

What is the Substantial Presence Test formula?

You are generally a US tax resident for a year if you spend at least 31 days in the US that year and your weighted total reaches 183 days: all of this year's US days, plus one-third of last year's days, plus one-sixth of the days from the year before.

Which days don't count toward the Substantial Presence Test?

Common exclusions include days as an exempt individual (for example certain F and J visa students and teachers, for a limited number of years), days you could not leave because of a medical condition that arose in the US, days in transit of less than 24 hours, and regular commuting days from Canada or Mexico. Each exemption has detailed conditions, so check the IRS rules for your case.

What is the closer connection exception?

If you were in the US fewer than 183 days in the current year, keep a tax home in a foreign country, and maintain a closer connection to that country, you can generally avoid US residency for the year even when the weighted formula reaches 183. You claim it by filing Form 8840 on time.

Does the SPT apply to green-card holders?

No. Lawful permanent residents are US tax residents under the separate green card test regardless of day counts. The SPT matters for people without green cards: visitors, workers on nonimmigrant visas, and frequent business travelers.

What happens if I meet the Substantial Presence Test?

You are generally treated as a US tax resident for that calendar year, which typically means reporting worldwide income. First and last years can be split into dual-status periods, and tax treaties can override the result, so the details are worth confirming with a professional.

Is this calculator private?

Yes. It runs entirely in your browser and nothing you enter leaves your device.

Sources & further reading

Every rule on this page is drawn from primary sources. Verify the current law before making a residency decision.

  1. [1]Substantial Presence TestIRS
  2. [2]Exempt Individual, Who Is a Student or Teacher/TraineeIRS
  3. [3]Closer Connection Exception to the Substantial Presence TestIRS
  4. [4]Form 8840, Closer Connection Exception StatementIRS

Track the SPT in real time on your iPhone

Tax Days runs the full 3-year weighted SPT calculation as you log trips. Notifications fire 30, 14, 7, 3, and 1 days before you'd cross 183 weighted days.

Download Tax Days on the App Store