Form 8840 and the closer connection exception

Form 8840 is how some people claim they should still be treated as nonresidents even if they meet the substantial presence test. The calculator only checks the day-count gate.

Who the form is for

The IRS explains the closer connection exception to the substantial presence test and publishes Form 8840, Closer Connection Exception Statement for Aliens. Even if you meet the substantial presence test, you can still be treated as a nonresident for U.S. tax purposes if you qualify for this exception (or, in some cases, a treaty tie-breaker, which this tool does not apply).

The 2026 Form 8840 states that you are not eligible for the closer connection exception if any of the following apply: you were present in the United States 183 days or more in calendar year 2026; you are a lawful permanent resident (a green card holder); or you have applied for, taken other affirmative steps to apply for, or have an application pending to change your status to that of a lawful permanent resident.

Which day counts the form cares about

The official closer connection page requires that you were present in the United States less than 183 days during the year. The form also asks you to enter the number of days you were present in the United States during the current year and the two prior years — the same three years used in the substantial presence formula.

This calculator treats the Form 8840 day-count gate as relevant when both of these are true:

If current-year counted days are 183 or more, the tool reports that the Form 8840 day-count gate is not met, following the form’s own eligibility note. If the substantial presence day-count test is not met, the tool reports that this exception is not what would keep you from meeting that test. Neither result is a determination of your residency, and neither is a decision that you must, or must not, file Form 8840.

What the tool does not decide

Meeting the day-count gate is not a certification that the exception applies. The calculator cannot decide whether you had a foreign tax home for the entire year, whether you had a closer connection to a foreign country, or whether you took steps toward a green card. Those are factual and legal judgments. See tax home and closer connection and Form 8840 filing timing.

There is also a separate closer connection path for some students that uses a different form path. This tool does not apply the student-only exception.

Open the calculator

Enter your travel calendar once. All day-count math runs in your browser.