The Substantial Presence Test is how the IRS decides whether a foreign national counts as a US tax resident. It is not a simple 183-day headcount: it weights three years of presence, counting every day this year, a third of last year’s days, and a sixth of the days from the year before. You meet it if that weighted total reaches 183 and you were present at least 31 days in the current year.
The weighting is what catches people out, since a pattern of regular US stays can tip you into residency well before any single year looks heavy. Exempt individuals (certain students, teachers, diplomats) and the closer-connection exception sit on top of the raw count, and they change the answer for many filers. Enter your days for each of the three years below to see where the formula lands you.