Calculators.Life Calculator
Tax Accounting

Substantial Presence Test Calculator

Input Parameters

Scenarios
Number of days physically present in the United States during the current tax year.
Number of days physically present in the US during the first preceding tax year.
Number of days physically present in the US during the second preceding tax year.
Certain individuals under F, J, M, Q, A, or G visas are exempt from counting days toward the Substantial Presence Test.

Computed Results

Substantial Presence Test Status
Resident Alien
Total Weighted Days205
31-Day Current Year TestPass
183-Day Weighted TestPass
Closer Connection Exception (Form 8840)Eligible (File Form 8840)
Primary Federal Tax FormForm 1040 (or Form 1040-NR with Form 8840)

This substantial presence test calculator helps foreign nationals estimate their US tax residency status based on physical presence over a three-year period. By calculating your total weighted days, you can determine if you meet the IRS threshold to be considered a resident alien for tax purposes.

This calculator provides mathematical estimates for informational purposes only and does not constitute professional tax or legal advice.

Practical Use Cases

Foreign nationals living, working, or studying in the United States use the substantial presence test to determine their tax filing obligations. If you meet the test requirements, you are generally treated as a resident alien for tax purposes and must file Form 1040, reporting worldwide income. If you do not meet the test, you are typically considered a nonresident alien and file Form 1040-NR, reporting only US-sourced income. This calculator also helps identify potential eligibility for the Closer Connection Exception, which allows individuals who meet the test but spend fewer than 183 days in the US during the current year to retain nonresident status by filing Form 8840.

Formula & Explanation

The substantial presence test evaluates your physical presence in the United States over a three-year period. To meet the test, you must be physically present in the US for at least 31 days during the current year, and accumulate at least 183 weighted days over the current year and the two preceding years.

The weighted days are calculated using the following formula:

Total Weighted Days = (Current Year Days × 1) + (Prior Year Days × 1/3) + (Second Prior Year Days × 1/6)

If the total weighted days equal or exceed 183, and the current year days are at least 31, the test is met. Certain visa holders (such as specific F, J, M, Q, A, or G visas) may be considered "exempt individuals," meaning their days of presence do not count toward the test for a specified period.

Verified Scenario Walkthroughs

The following scenarios demonstrate how the substantial presence test applies to different situations based on the calculator's logic.

Exempt student under 5-year rule

An individual on an exempt visa (e.g., F-1 student under the 5-year rule) spends 180 days in the US during the current year, 180 days in the prior year, and 180 days two years prior. Because they are an exempt individual, their days are not counted. Their total weighted days are 0, resulting in a Nonresident Alien (Exempt Individual) status. They would file Form 1040-NR with Form 8843.

Nonresident alien failing 31-day test

An individual spends 20 days in the US in the current year, 300 days in the prior year, and 300 days two years prior. Their total weighted days are 170. Because they fail the 31-day current year test (20 days) and the 183-day weighted test, their status is Nonresident Alien, and they would file Form 1040-NR.

Resident alien eligible for closer connection

An individual spends 120 days in the US in the current year, 200 days in the prior year, and 200 days two years prior. Their total weighted days are 220. They pass both the 31-day and 183-day tests, resulting in a Resident Alien status. However, because their current year days (120) are less than 183, they are eligible to claim the Closer Connection Exception by filing Form 8840.

Resident alien present over 183 days

An individual spends 200 days in the US in the current year, 100 days in the prior year, and 50 days two years prior. Their total weighted days are 241.67. They pass both tests and are considered a Resident Alien. Because they spent 183 or more days in the US during the current year, they are not eligible for the Closer Connection Exception and must file Form 1040.

How to Use the Calculator

Follow these steps to estimate your substantial presence test status:

  1. Enter the number of days you were physically present in the United States during the current tax year.
  2. Enter the number of days you were present in the US during the first preceding tax year.
  3. Enter the number of days you were present in the US during the second preceding tax year.
  4. Select your visa or exempt individual category from the dropdown menu, if applicable.
  5. Review your estimated tax residency status, total weighted days, and potential tax forms.

Inputs & Outputs

The table below defines the data used and generated by the calculator.

Field NameTypeDescription
Days in US — Current Tax YearInputNumber of days physically present in the United States during the current tax year.
Days in US — Prior Year (Year - 1)InputNumber of days physically present in the US during the first preceding tax year.
Days in US — 2 Years Prior (Year - 2)InputNumber of days physically present in the US during the second preceding tax year.
Visa / Exempt Individual CategoryInputCertain individuals under F, J, M, Q, A, or G visas are exempt from counting days toward the Substantial Presence Test.
Substantial Presence Test StatusOutputThe estimated tax residency classification (Resident Alien or Nonresident Alien).
Total Weighted DaysOutputThe calculated sum of weighted days over the three-year period.
31-Day Current Year TestOutputIndicates whether you were present for at least 31 days in the current year.
183-Day Weighted TestOutputIndicates whether your total weighted days equal or exceed 183.
Closer Connection Exception (Form 8840)OutputEstimates eligibility for the Closer Connection Exception based on current year days.
Primary Federal Tax FormOutputThe estimated primary IRS tax form required based on your residency status.

Frequently Asked Questions

What happens if I am an exempt individual?

Days spent in the US under certain visas (like specific F, J, M, or Q visas) may not count toward the substantial presence test for a specific number of years. If you are an exempt individual, your weighted days for that period are treated as zero.

What is the Closer Connection Exception?

If you meet the substantial presence test but spend fewer than 183 days in the US during the current year, you may still be treated as a nonresident alien if you maintain a closer connection to a foreign country and file Form 8840.

Author portrait
About the Author
Arnab Biswas

Calculator developer and SEO strategist who builds practical online calculators and tests calculation logic, input handling, and expected results using real-world scenarios.