The US substantial presence test, explained
The US doesn't use a flat 183 days — it weights the last three years. Here's how the substantial presence test works, the closer-connection exception, and how to track the days it relies on.
Short answer: the US substantial presence test (SPT) decides whether a non-citizen is a US tax resident for a year. You meet it if you were present at least 31 days this year and 183 weighted days across a three-year window — counting all of this year's days, ⅓ of last year's, and ⅙ of the year before.
So it is not a simple 183-days-this-year rule. A formula example:
- This year: 120 days → 120
- Last year: 120 days → 40 (×⅓)
- Year before: 120 days → 20 (×⅙)
- Total: 180 weighted days → just under 183, so not resident — even though you spent 120 days each year.
Cross 183 weighted days and you're generally a US tax resident, taxed on worldwide income.
The closer connection exception
Even if you meet the SPT, you may avoid US residency under the closer connection exception if you were in the US fewer than 183 days this year and can show a tax home and stronger ties to another country (filed on Form 8840). Treaties can also override the result.
Citizens are a special case
US citizens and green-card holders are taxed on worldwide income wherever they live — citizenship-based taxation. The SPT is about non-citizens; if you hold the passport, the days don't get you out.
Why the weighting makes tracking hard
The three-year weighting means a "safe" year depends on the two years before it. You can't eyeball it — you need an accurate dated history.
How Flags does it
Flags: Tax Residency keeps a multi-year dated record of your US days from your photos (offline, on-device) and shows your day counts against the US threshold, with a flag if you hold US citizenship.
Important limitation: Flags counts days and flags the US as citizenship-based, but it does not compute the full weighted three-year SPT formula, the closer-connection exception, or treaty positions. Treat it as an early warning and confirm the exact test with a qualified US tax adviser.