How does this calculator apply the formula?
The substantial presence test adds three numbers: all of your US days in the test year, one third of your days in the prior year, and one sixth of your days in the year before that. You meet the test when the test year has at least 31 days and the weighted total reaches 183. Meeting it generally makes you a US tax resident for that year.
Both conditions matter. With 30 days or fewer in the test year you cannot meet the test regardless of earlier years, and heavy earlier years alone cannot push you over without the 31-day minimum.
Why are the fractions not rounded?
Because rounding can flip the verdict. The IRS compares the exact sum, so 120 days this year, 120 last year, and 120 the year before gives 120 + 40 + 20 = 180, not met, while a naive counter that rounds thirds and sixths upward could show 183. This calculator keeps the fractions exact, does the comparison in whole sixths of a day, and only rounds for display.
A useful habit: the 120-day pattern. Averaging about 120 US days every year keeps the weighted total at 180, just under the threshold, which is why many frequent travelers plan around it. One extra trip breaks the pattern, so count, do not estimate.
Which days should you enter?
Enter only days that count. Any part of a day physically present in the United States normally counts as a full day, including arrival and departure days. Leave out days as an exempt individual (students, teachers, trainees, diplomats within their limits), days you could not leave because of a medical condition that arose in the US, days in transit of under 24 hours, and regular commuting days from Canada or Mexico.
If your entered days meet the test but you were in the US fewer than 183 days this year, check the closer connection exception in the FAQ below. The threshold interacts with the same 183-day idea used elsewhere; see the 183-day rule guide for the international picture.