Tool · Runs entirely in your browser · Updated August 2026
Substantial presence test calculator.
Enter your US days for three years. See the weighted math worked out step by step — the 31-day minimum and the 183-day total, shown separately. On a student or teacher visa? The calculator zeroes out your exempt years too. Nothing you type leaves this page or is saved.

How do I calculate the substantial presence test?
Add every US day in the current year, plus one third of the prior year's days, plus one sixth of the days from the year before that. If that weighted total reaches 183 and you were present at least 31 days in the current year, the test is generally met — subject to IRS exceptions.
What counts as a US day?
A US day generally means any day you were physically present in the United States, but the IRS excludes certain days — for example some days for exempt individuals. Whether a day is counted at all can matter as much as the arithmetic, so check the current IRS guidance.
Do F-1 student days count toward the substantial presence test?
Generally not during your first 5 calendar years in the US: as a student on an F, J, M, or Q visa you're an exempt individual, and exempt days don't count. Any part of a calendar year counts as a whole year, and the 5-year limit is a lifetime total. You still report those years on Form 8843. Select the student option in the calculator to see the effect on your numbers.
What is the closer connection exception?
It can let you avoid US residency even if you meet the day count, when you were in the US fewer than 183 days in the current year and can show a tax home and closer ties to another country. Claim it on Form 8840; see the IRS substantial presence test page and Publication 519 for the conditions. The calculator flags when your numbers make it worth checking.
Does this store my data?
No. The calculator runs entirely in your browser. Nothing you type leaves this page or is saved. A result link keeps your numbers in the part of the URL after the #, which the browser never sends to a server.