HomeAll calculatorsUnited States

US Substantial Presence Test calculator

Count your US days across three years, check the Substantial Presence Test and see how many additional days fit below its thresholds.

Add your stays

Add every countable US stay in the assessment year and the two years before it. Missing stays count as zero; visa exemptions and other excluded days are not deducted automatically.

Import or paste a travel list

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.

Saved in this browser · no account required

Adjust for confirmed excluded days →

Two simple examples

120 days in each of three years

Assessment year 2026; 120 US days in 2024, 2025 and 2026.

120 + 40 + 20 = 180 weighted days. The SPT is not met; 2 more countable days fit below it. The third additional day reaches 183.

Three extra days change the result

Keep the prior years at 120 days each; stay 123 days in 2026.

123 + 40 + 20 = 183 weighted days, and the current-year count exceeds 31. Both SPT conditions are met, before any applicable exceptions.

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. Two additional countable days in the current year stay below 183; the third reaches the threshold.

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.

Page guidance checked 2026-10-02
  • IRC §7701(b), (b)(3) substantial presence test: 31 current-year days and the 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 →

Which days can be excluded? Student limits, Form 8843 and examples →

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.

Why are my weighted days different from my days in the US?

They measure different things. Your current-year days are the actual countable dates in that year. The SPT also adds one-third of last year’s days and one-sixth of the year before. Enter all three years so the weighted result and additional-day allowance are meaningful.

Informational only — not tax advice. Based on the published day-counting tests, the calculator tells you what appears to follow. Qualifying facts require your own evidence; the tool does not verify housing, family, employment or treaty claims. Confirm with a qualified cross-border tax adviser.

Other country calculators