Substantial Presence Test Calculator

Form 8843 and Form 8840

Both forms deal with the substantial presence test, but they do different jobs.

Form 8843Form 8840
PurposeExplains the basis for excluding days of presenceClaims the closer connection exception
Used whenYou are an exempt individual, or could not leave because of a medical conditionYou meet the substantial presence test but have a closer connection to a foreign country
With a returnAttach to your income tax returnAttach to your income tax return
Without a returnSend to the address in the form instructions by the return due dateSend to the IRS service center in the form instructions
If lateDays cannot be excluded unless you show by clear and convincing evidence that you took reasonable actions and significant steps to complyThe exception cannot be claimed unless you show the same

Which days each form covers

Form 8843 covers days excluded as an exempt individual and days excluded for a medical condition; see days that do not count. Form 8840 does not exclude days. It lets you be treated as a nonresident for the year even though you meet the test.

Both can matter in the same year. Days excluded on Form 8843 reduce the count before you decide whether you need the closer connection exception at all.

Updated: November 4, 2026

Back to the calculator →

Guides