🇺🇸 United States tax residency calculator
Enter your stays in United States (and anywhere else — one ledger feeds every country) and the calculator applies the US rule over the calendar year (3-year lookback), shows the exact day count against 31 days + weighted 183, and tells you how many safe days remain.
Your travel ledger
Paste your travel list (one stay per line)
Format: YYYY-MM-DD ~ YYYY-MM-DD XX with the two-letter code of a
country on this site, or a single day YYYY-MM-DD XX. This site's CSV exports can be
re-imported as-is.
How the US rule works
The United States does not use a simple 183-day count. Under the Substantial Presence Test (IRC §7701(b)(3)) you are treated as a US resident for a year if you are physically present on at least 31 days during that year, and your weighted three-year total reaches 183 days: all days of presence in the current year, plus one-third of the days in the first preceding year, plus one-sixth of the days in the second preceding year.
The weighting is what surprises long-term visitors: a heavy travel year keeps counting against you for the following two years. Spending 120 days in the US in three consecutive years produces 120 + 40 + 20 = 180 weighted days — just under the threshold, as IRS Publication 519’s own worked example shows. One extra day in the third year pushes you over.
A day counts if you are present at any time during it. Certain days never count at all: regular commutes from Canada or Mexico (when commuting is more than 75% of your workdays), days in transit between two places outside the US for less than 24 hours, days you could not leave due to a medical condition, and days you were an exempt individual (for example F, J, M or Q students, teachers and trainees).
Even if you meet the test, the Closer Connection Exception can keep you a nonresident: fewer than 183 days of presence in the year, a tax home maintained in a foreign country, a closer connection to that country, and a timely filed Form 8840.
- IRC §7701(b), (b)(2) substantial presence test, (b)(3) weighted 3-year formula — official text
- IRS Publication 519 (2025), Chapter 1 — The Substantial Presence Test — official text
- IRS Form 8840, Closer Connection Exception Statement for Aliens — official text
Every calculation above follows the cited publications. If a rule changes, the verification date above is updated — pages with stale dates are flagged for re-verification.
What this calculator does not decide
- This calculator applies only the Substantial Presence Test. It does not cover green-card holders, who are US residents regardless of day count.
- Excludable days are not deducted here: commuter days from Canada or Mexico (more than 75% of workdays), transit days under 24 hours between two places outside the US, medical-condition days, and exempt-individual days (F/J/M/Q students and teachers, foreign-government "A"/"G" visas). If any apply, your counted days are lower than shown.
- The Closer Connection Exception (Form 8840) can still make you a nonresident if you meet the test but were present fewer than 183 days in the year.
- First-year and last-year residency elections (residency starting/ending dates) are not modeled.
- The 31-day threshold and the 183-day weighted total use fractional terms (⅓ and ⅙) kept exact in the arithmetic. Near a threshold, confirm rounding treatment with a cross-border tax adviser.
- Tax residency is separate from US filing obligations and from immigration status.
United States rules explained in depth — the full article →
United States residency FAQs
How many days can I stay in the US without becoming a tax resident?
There is no single number. With no US presence in the two prior years, 182 days in the year keeps you under the Substantial Presence Test. With prior-year presence the weighted formula (current + ⅓ of last year + ⅙ of the year before) can cut that headroom dramatically — the calculator computes your personal remaining days.
Does the day I arrive in or depart from the US count?
Yes. US counting counts any day on which you are present at any time during the day, including arrival and departure days. Days in transit between two places outside the US (less than 24 hours, e.g. changing planes) do not count.
I am an F-1 student. Do my days count?
Generally no — F, J, M and Q visa holders are usually "exempt individuals" whose days are excluded (students for up to 5 calendar years, teachers/trainees for 2 of the prior 6 years). This calculator does not know your visa status; if you were an exempt individual, your true counted days are lower than shown.
Can I be a US tax resident and still avoid US tax on foreign income?
Residents are taxed on worldwide income, but treaties and the foreign earned income exclusion may reduce the result. That is a separate question from this calculator, which only answers residency. A cross-border tax adviser should confirm filing positions.
What is the Closer Connection Exception?
If you meet the Substantial Presence Test but were present fewer than 183 days in the year, maintained a tax home in a foreign country, and had a closer connection to that country than to the US, you can remain a nonresident by filing Form 8840 on time. You cannot use it if you applied for a green card or permanent residence.