IRS Substantial Presence Test Calculator (All Visa Types)

IRS substantial presence calculator helps you find the US tax residency based on your stay in the US. At least 31 days in current year and 183 days in last 3 years required.

Written by AM22Tech Team
  AM22Tech Team    Updated 1 Jun, 23

IRS substantial presence calculator helps you find the US tax residency based on your stay in the US.

A foreign national is taxed in the US as a resident or a non-resident alien based on the number of days you have spent physically in the US.

What is a Substantial Presence Test?

The US tax agency is known as IRS and they have created a residency test called SPT (Substantial Presence Test). It is a simple test that counts the number of days you have resided in the US in the last 3 years.

F1 Students

Many people enter the US for studies using an F1 visa but then change their status to an H1B work visa within the same year.

This creates confusion with respect to whether you should count the days spent in the US on an F1 student visa for the substantial presence or not.

Teacher or Trainee

Similarly, the app takes care of J-1 and Q-1 status rules for the IRS residency tests which exempt them from counting these days for SPT unless they are in the US as a student.

IRS exempts all the alien physicians, au pairs, short-term scholars, and summer camp workers temporarily present in the U.S. in “J” visa status from SPT counting as they are included within the IRS definition of “Teacher or Trainee.”

B1/B2 Visitors

Business or tourist visitors using a B-1/B-2 US visa will also be considered for tax residency. Most B-1 business workers do receive payments in USD and may have to file income tax returns as ‘resident aliens’ if they pass the substantial presence test.

Please consult a tax consultant or a CPA if you are not sure what kind of tax you need to pay or file in the US.

IRS Substantial Presence Calculator

The substantial presence app supports listing your dates of entry and exit from the US. It automatically calculates the number of days you spent in the US.

The app takes care of all the complex IRS rules if you specify the correct dates with the correct visa status.

Open App in new Window >

Substantial Presence Test Rules

The basic criteria for the IRS test take into account the current year which is the year that you are trying to file taxes.

The test has two parts and both should be satisfied to consider yourself a ‘resident-alien’ for filing 1040 taxes in the US.

  1. 31 days during the current year, and
  2. 183 days during the 3-year period that includes the current year and the 2 years immediately before that, counting:
    • All the days you were present in the current year, and
    • 1/3 of the days you were present in the first year before the current year, and
    • 1/6 of the days you were present in the second year before the current year.


If you came to the US on 1 Jan as a student on an F1 visa and then converted to H1B visa on Oct 1 (same year) to keep working, you have two separate legal stays in the US:

  • 1 Jan to 20 Sep stay on F1 will be considered exempt from counting.
  • From Oct 1 to 31 Dec staying on an H1B visa will be counted as a legal presence in the US.
IRS F1 to H1B change of status substantial presence test calculator
IRS F1 to H1B change of status substantial presence test calculator

Transit Through US

IRS allows you to exclude the day if you were present in the US for less than 24 hours just because you were on a transit flight.

Many people on business trips using B-1/B-2 visas travel through the USA stopover flights in Atlanta while going to Mexico.

am22tech’s Substantial presence test app allows you to specify your trip as transit and hence it will not be counted.

Living in Canada/Mexico but working in the US

You can exclude the days that you have commuted from Canada or Mexico to the US just for day work.

A lot of people who work in the Detroit area commute daily to the US while living in Canada using their PR. They can exclude the days they worked in the US.

IRS substantial presence test calculator exemptions
IRS substantial presence test calculator exemptions

Many highly skilled H1B workers also have Canada PR and try to maintain both at the same time but make sure that you calculate your residency using the Substantial Presence Test calculator to see if you have the correct US residency status.

Check My Substantial Presence >

The other exceptions include

  • Unable to leave the US due to medical conditions that developed while you were in the US.
  • Staying in the US as a crew member of a foreign vessel.
  • A professional athlete competing in Charitable Events in the US. Athletes performing in the US for profit cannot claim this exemption.


Written by AM22Tech Team
  AM22Tech Team     

Recent discussion on forum

  1. anil_am22

    Did you use the app? What does it show as your residency status?

  2. anil_am22

    You must have entered wrong values in the app is what i guess.

    Looks like there may be a bug in the app for F1 visa. I hope they fix it soon.

  3. anil_am22

    I think you will be considered resident alien for tax purpose.

  4. anil_am22

    I tested your situation using the app and it seems you are not resident alien based on IRS exemptions.

    Why is the tax service company counting you as resident alien then? Is there more information with respect to your status that you have shared with them but not here?

  5. reddysanil

    You will be a Non Resident. As a student on F-1 visa, you qualify to be as an exempt individual

Comments are closed. Ask question on

6 more replies