{"slug":"us-substantial-presence-test","name":"US Substantial Presence Test — the real 183-day rule","category":"everyday","tags":["tax","planning","immigration"],"region":"US","tagline":"Whether your US days make you a tax resident — the weighted 3-year formula where 122 days a year is enough, and student-visa days may not count at all.","endpoint":"https://xearno.tools/api/v1/tools/us-substantial-presence-test","page":"https://xearno.tools/t/us-substantial-presence-test","description":"Determines US tax residency under the Substantial Presence Test (IRC §7701(b)): 31+ days this year AND a weighted total ≥ 183, counting this year’s days in full, last year’s at one-third, and the year before at one-sixth. The popular \"stay under 183 days\" rule is wrong — a steady 122 days every year triggers residency. The inputs that actually decide the answer are the ones people don’t know matter: visa status (F/J/M/Q student and J/Q teacher days can be excluded entirely — or suddenly start counting), prior-year day counts, and whether the closer connection exception (Form 8840) is still open — it closes at 183 actual days, and a pending green-card application bars it.","inputSchema":{"type":"object","properties":{"status":{"description":"US immigration status this year The decisive input, and the one almost nobody knows matters. A green card makes you a resident regardless of days. F/J/M/Q student and J/Q teacher visas can make your days NOT count at all — or, past a limit, suddenly count. Most work and visitor statuses (H-1B, L-1, B1/B2, ESTA) have no special rule: pick the first option.","type":"string","enum":["none","greenCard","studentFJMQ","teacherJQ"],"default":"none"},"exemptYears":{"description":"Exempt calendar years Only used for student/teacher status; two meanings. Student (F/J/M/Q): the calendar years you have EVER spent as an exempt student, teacher, or trainee — cumulative over your lifetime, any part of a year counts as a full year, and include this year if it applies. Teacher/trainee (J/Q): how many of the 6 PRECEDING calendar years you were exempt.","type":"number","minimum":0,"maximum":15,"default":0},"daysCurrent":{"description":"Days in the US this calendar year Any part of a day counts as a full day — an evening arrival is a day. But first REMOVE days that never count: regular-commuter days from Canada/Mexico, under-24h transits between two foreign points, days as crew of a foreign vessel, and days you could not leave because of a medical condition that arose in the US.","type":"number","minimum":0,"maximum":366,"default":120},"daysPrior1":{"description":"Days in the US in the 1st preceding year Last calendar year’s day count, same counting rules. It is weighted at one-third — prior years are why \"under 183 this year\" is not safe.","type":"number","minimum":0,"maximum":366,"default":120},"daysPrior2":{"description":"Days in the US in the 2nd preceding year The calendar year before that, weighted at one-sixth.","type":"number","minimum":0,"maximum":366,"default":120},"closerConnection":{"description":"Foreign tax home with a closer connection? If the test is met but you spent under 183 actual days, the closer connection exception can still keep you a nonresident: a tax home in a foreign country for the entire year plus a closer connection to it, claimed on a timely Form 8840.","type":"string","enum":["unsure","yes","no"],"default":"unsure"}},"required":[],"additionalProperties":false},"methodology":["The Substantial Presence Test (IRC §7701(b)(3)): you are a US tax resident for the year if you are present at least 31 days in the current year AND the weighted total — current-year days ×1 + first-preceding-year days ×⅓ + second-preceding-year days ×⅙ — is at least 183. Fractions are not rounded, and exactly 183.00 triggers. This tool computes in exact integer sixths (6×current + 2×prior + 1×second-prior ≥ 1098) so no floating-point artifact can flip a boundary case; the weighted total is displayed to two decimals.","Counting days: any part of a day physically present counts as a full day. Days that never count and should be removed before entering: days commuting to work from a residence in Canada or Mexico as a regular commuter, days in transit between two foreign points for under 24 hours, days as a crew member of a foreign vessel, and days you were unable to leave because of a medical condition that arose while in the US (documented on Form 8843).","Exempt individuals (26 CFR 301.7701(b)-3): their days of presence are excluded from the test entirely. A student on an F, J, M, or Q visa is exempt unless they have already been exempt (as a student, teacher, or trainee) for any part of more than 5 calendar years — cumulative over their lifetime, with no automatic reset; an extension is possible only by establishing no intent to reside permanently in the US. A teacher or trainee on a J or Q visa is exempt unless exempt for any part of 2 of the 6 preceding calendar years (a 4-of-6 variant applies when a foreign employer paid all the teaching compensation and the person was not exempt as a teacher/trainee in the prior 6 years). Form 8843 must be filed to exclude the days.","Closer connection exception (IRC §7701(b)(3)(B), Form 8840): even when the test is met, a person present under 183 actual days in the current year remains a nonresident if they maintained a tax home in a foreign country for the entire year and had a closer connection to that country than to the US. It is claimed on Form 8840 by the return due date and is unavailable to anyone who has applied for lawful permanent residence or taken steps toward it. At 183+ actual days the exception is statutorily unavailable — only an income-tax-treaty residency tie-breaker remains.","Residency starting date: for a first residency year under the SPT, residency starts on the first day of presence in the US during that calendar year. A de minimis first stay of up to 10 days can be disregarded (shifting the start to a later trip) if the person had a closer connection to a foreign country during it — but those days still count toward the day totals.","The green card test is separate and absolute: a lawful permanent resident is a US tax resident for any year the status is held at any time, regardless of days of presence, until the status is revoked or formally abandoned.","The steady-state arithmetic behind the headline: x days every year gives a weighted total of 1.5x, so 122 days a year = 183.00 exactly — resident — while 121 a year = 181.50 — clear. The IRS’s own worked example (120/120/120 → 180 → not resident) sits just under the line. The popular \"183-day rule\" is thus wrong by 61 days for anyone with a recurring pattern."],"usage":"POST https://xearno.tools/api/v1/tools/us-substantial-presence-test with a JSON body matching inputSchema."}