Free tool

US Substantial Presence Test calculator

The IRS treats you as a US resident for a calendar year if you were present at least 31 days that year and 183 days over three years, counting all of this year, a third of last year and a sixth of the year before. Add your US stays to see the exact weighted total.

Your US stays over three years

Add stays from this year and the two years before it.

Runs entirely in your browser. Nothing you enter is stored or sent anywhere, and it keeps working offline once the page has loaded.

How the Substantial Presence Test works

Under IRS Publication 519, a person who is not a US citizen or green card holder is a US resident for tax purposes for a calendar year if both of these apply:

  • 31 days this year. You were physically present in the US on at least 31 days during the year.
  • 183 weighted days over three years. All the days in the current year, plus one third of the days in the year before, plus one sixth of the days in the year before that, add up to 183 or more.

Three details change the count:

  • Any part of a day counts. Arriving at 11 pm is a day of presence. This calculator counts both your arrival and departure days.
  • Fractions are not rounded. 182 and 5/6 days is below 183. The calculator keeps the thirds and sixths exact, as the app does.
  • Some days do not count. Days as an exempt individual (for example many F, J, M or Q visa students and teachers, and foreign government officials), in transit between two foreign points for under 24 hours, as a regular commuter from Canada or Mexico, as crew of a foreign vessel, or when a medical condition that arose in the US stopped you leaving. Leave those days out of your stays.

Meeting the test does not settle everything. If you were in the US for fewer than 183 days in the current year, you may still be treated as a nonresident under the closer connection exception: a tax home in another country and a closer connection to it, claimed on Form 8840 by the filing deadline. A tax treaty tie-breaker can also apply. The calculator flags when the closer connection exception is worth checking.

Worked example

Press Load the example. It has 120 days in the US in each of 2024, 2025 and 2026. The working for 2026 is 120 + 120 ÷ 3 + 120 ÷ 6 = 120 + 40 + 20 = 180 weighted days: below 183, so the test is not met for 2026. The calculator shows that two more days in the US in 2026 would still leave you below it; a third would reach 183.

This mirrors the IRS's own example in Publication 519, which reaches the same 180-day total.

Common mistakes

  • Counting only this year. The 183 is a three-year weighted total. Someone who never spends 183 days in a single year can still meet it.
  • Rounding the thirds and sixths up. 37 days in the prior year is 12 and 1/3, not 13.
  • Forgetting travel days. A late-night arrival or an early-morning departure is still a day in the US.
  • Missing the Form 8840 deadline. The closer connection exception has to be claimed; it is not automatic.
  • Assuming the states follow the same rule. US states such as New York and California have their own residency tests. The Midnightly app counts those too.

This is an estimate, not tax or legal advice. The Substantial Presence Test has exceptions, elections and treaty rules beyond a day count, and green card holders are resident under a separate test. Check your position with a qualified US tax adviser.

Frequently asked questions

Is the Substantial Presence Test the same as the 183-day rule?

It is the US version of a 183-day rule, but it counts a weighted total over three years: all of this year's days, a third of last year's and a sixth of the year before. You also need at least 31 days in the current year.

Do partial days count?

Yes. Any part of a day you are physically present in the US counts as a day of presence, including arrival and departure days, unless an exception applies.

Which days can I leave out?

Days as an exempt individual (such as many students and teachers on F, J, M or Q visas), transit of under 24 hours between foreign points, regular commuting from Canada or Mexico, foreign-vessel crew days and days a medical condition kept you in the US. Remove those days from your stays.

What is the closer connection exception?

If you meet the test but were in the US for fewer than 183 days in the current year, you may be treated as a nonresident if you had a tax home in another country and a closer connection to it. You claim it on IRS Form 8840.

Does a green card holder use this test?

No. A lawful permanent resident is a US resident under the green card test regardless of days. This calculator is for people without a green card.

Is my data sent anywhere?

No. The calculator runs entirely in your browser. Nothing you type is stored, uploaded or shared.

Source: IRS, Publication 519, U.S. Tax Guide for Aliens, and Substantial Presence Test. Other free tools: Schengen 90/180 calculator, 183-day rule calculator, UK SRT day counter, Spain 183-day and Beckham law calculator, UK FIG regime 10-year checker, Portugal 183-day rule calculator and UAE tax residency days calculator.

Track this automatically every day

Midnightly counts every rule at once, shows its working and exports a signed evidence pack your adviser can verify.

  • A running three-year weighted US count, with the thirds and sixths shown, plus the closer connection questions.
  • UK SRT, US Substantial Presence, Schengen 90/180, US state and 183-day rules in one engine, verified against 58 official worked examples.
  • Your record stays on your iPhone. No account.
Download on theApp Store

Free to download.