Updated March 12, 2026H1B TaxFile Editorial

File your H-1B return — $49.99

Start free

Substantial Presence Test

How the IRS determines whether you are a U.S. tax resident for filing purposes.

What Is the SPT?

The Substantial Presence Test (SPT) is the primary test the IRS uses to determine whether a foreign national is a U.S. tax resident. If you meet the SPT, you are treated as a resident alien for tax purposes and file Form 1040 (the same form U.S. citizens use). If you do not meet the SPT, you may be a nonresident alien and would file Form 1040NR instead.

For H-1B visa holders who have been working in the U.S. for a full calendar year, the SPT is almost always met. The test becomes more relevant in your first year (if you arrived mid-year) or in transition years (F-1 to H-1B change of status).

The Formula

Dayscurrent + (Daysprior1 ÷ 3) + (Daysprior2 ÷ 6) ≥ 183

Where:

  • Dayscurrent = Days you were present in the U.S. during the current tax year
  • Daysprior1 = Days you were present in the U.S. during the first preceding tax year
  • Daysprior2 = Days you were present in the U.S. during the second preceding tax year

You must meet both of the following conditions to pass the SPT:

  1. You were present in the U.S. for at least 31 days during the current tax year, AND
  2. The weighted sum of your days (using the formula above) is 183 or more.

The 31-Day Rule

Even if your weighted day count exceeds 183, you must have been physically present in the U.S. for at least 31 days during the current tax year to meet the SPT. This prevents someone who was in the U.S. for many days in prior years but only briefly in the current year from being classified as a resident.

Exempt Days

Certain days do not count toward the SPT. The most relevant exemptions for H-1B-related filers:

  • F-1 student visa holders: Days present in the U.S. as an F-1 student are exempt from the SPT count for the first 5 calendar years. This is critically important for people who transitioned from F-1 to H-1B status.
  • J-1 visa holders: Days present as a J-1 scholar/researcher are exempt for 2 calendar years out of the preceding 6.
  • Q-1 visa holders: Similar exemption rules apply.

Example: If you were on an F-1 visa for 4 years (2021-2024) and switched to H-1B on October 1, 2025, your F-1 days are exempt. Only your H-1B days (October 1 - December 31, 2025 = approximately 92 days) count for the current year. You may not meet the SPT for 2025 and could need to file as a nonresident — or make a first-year election.

Impact on Filing Status

Meet SPT = Resident Alien

  • File Form 1040
  • Report worldwide income
  • Eligible for standard deduction
  • Eligible for most credits (CTC, EITC, etc.)
  • Must report foreign accounts (FATCA, FBAR)

Do Not Meet SPT = Nonresident Alien

  • File Form 1040NR
  • Report only U.S.-source income
  • Cannot use standard deduction (in most cases)
  • Limited credit eligibility
  • Different withholding rates may apply

First-Year Election

If you arrived in the U.S. mid-year on an H-1B visa and do not meet the SPT for that year, you may be able to make a "first-year election" under IRC Section 7701(b)(4). This allows you to be treated as a resident alien for the portion of the year starting from your arrival date, provided you meet certain conditions:

  • You were not a U.S. resident in the prior year.
  • You meet the SPT in the following year (which most H-1B holders do if they are present for a full calendar year).
  • You were present in the U.S. for at least 31 consecutive days during the election year.
  • You were present for at least 75% of the days from the start of the 31-day period through December 31.

F-1 to H-1B Transition

This is one of the most common and confusing scenarios. If you were on an F-1 visa and changed to H-1B status during the year:

  • Your F-1 days are exempt from the SPT count (for the first 5 calendar years of F-1 status).
  • Only your H-1B days count toward the SPT.
  • If you changed status on October 1 (the most common COS date), you have approximately 92 H-1B days, which is not enough to meet the SPT on its own.
  • You may need to file a dual-status return or make a first-year election.
  • You may need to file Form 8843 for the F-1 portion of the year to document your exempt status.

How We Handle the SPT

Built into the filing wizard

In Step 4 of the filing wizard (H-1B Specific), the platform includes a Substantial Presence Test calculator. You enter your arrival dates, visa types, and days present for the current and prior two years. The calculator automatically accounts for exempt days (F-1, J-1, Q-1), applies the weighted formula, and determines your residency status. If you do not meet the SPT, the wizard guides you through your options (dual-status return, first-year election).

Frequently Asked Questions

Skip the complexity. We handle all of this for you.

H1B TaxFile supports every form in this guide — FATCA, PFIC, FTC, RSU basis correction, and 22 more H-1B-specific features. Flat price, no surprises.

No credit card to start Printable PDF in 15 minutes 22 H-1B-specific features
File your return — $49.99

H1B TaxFile Team

Written by the H1B TaxFile editorial team — tax professionals and software engineers who specialize in U.S. federal tax filing for H-1B visa holders, F-1 students, and nonresident aliens.

Reviewed by a licensed CPA with international tax experience.

Disclaimer: This guide is for educational purposes only and does not constitute tax or legal advice. Tax laws are complex and change frequently. Consult a qualified tax professional for advice specific to your situation.

Recommended Reading