# Substantial Presence Test

The Substantial Presence Test (SPT) is a criterion used by the Internal Revenue Service (IRS) in the United States to determine whether an individual who is not a citizen or lawful permanent resident in the recent past qualifies as a "resident for tax purposes" or a "nonresident for tax purposes"; it is a form of physical presence test. The SPT should be used in conjunction with the Green Card Test (the criterion that the individual possessed a valid Green Card at any time of the year). An individual who satisfies either one or both of these tests is treated as a resident for tax purposes.

## Summary of the test
### Formula used by the IRS

The SPT features a number of exemptions. Ignoring the exemptions, the criterion is as follows. Note that the criterion is used to determine residency for tax purposes for people who are not citizens and fail the Green Card Test.
* The individual must have been physically present in the United States for at least 31 days in the year for which the tax return is being filed; and
* The total of (number of days present in the tax year) + (1/3)(number of days in the year before the tax year) + (1/6)(number of days in the year two years before the tax year) must be at least 183.
In particular, any individual who was in the United States in a non-exempt status for more than 6 months during the tax year qualifies for the SPT and (unless exempted based on one of the exemptions) must be treated as a resident for tax purposes.

### Definition of United States for physical presence

"Physical presence in the United States" refers to presence in one or more of the following areas:
* All 50 states and Washington D.C.
* The territorial waters of the United States (about 12 nautical miles out from the border between land and sea).
* The seabed and subsoil of those submarine areas that are adjacent to U.S. territorial waters and over which the United States has exclusive rights under international law to explore and exploit natural resources (about 200 nautical miles out from the border between land and sea).

### Days of physical presence

Any day that an individual was present physically in any United States for any part of the day counts as a day of physical presence, with the following exceptions:
* Days commuting to work in the United States from a residence in Canada or Mexico for those who regularly commute from Canada or Mexico. The IRS define" regularly" as more than 75% of the workdays in the working period. Days in the United States for the entire day cannot be exempted on this basis.
* Days in the United States for less than 24 hours when one is in transit between two places outside the United States.
* Days in the United States as a crew member of a foreign vessel.
* Days one is unable to leave the United States because of a medical condition that arose in the United States (see the medical condition exemption below).
* Days one is an exempt individual (see the special status exemption section below).

### Applicability to whole tax year

Individual meeting the Substantial Presence Test at the time of tax filing are treated as a resident for tax purposes for the part of the calendar year starting from the first day of physical presence in the United States including the part of the year before accruing a substantial presence in the United States.
That can lead to minor inconsistencies and complications in the tax return. While the individual was getting paid by an employer prior to accruing a substantial presence, the employer may have been operating under the assumption that the individual would be a nonresident for tax purposes and using the tax deduction laws and reporting requirements associated with employing nonresidents. At the time of tax filing, any retrospective inconsistency between the status that the employer believed the individual had at that time and the status as it appears to be by the end of the year must be reconciled.
However, an individual may choose to exempt the first 10 days (that is less than the 31-day period needed for the substantial presence test) if the individual is able to establish a closer connection to a foreign country and the individual's tax home was the foreign country.

## Significance
### Tax forms to file

Residents for tax purposes are generally required to file Form 1040 or one of its variants (Form 1040A or Form 1040EZ). Non-residents for tax purposes are generally required to file Form 1040NR (or its variant, Form 1040NR-EZ). For those who are nonresidents for tax purposes, the relevant information about when the person was present in the United States, and the calculations based on that to show that the person fails the SPT, are done in Schedule OI, which is the fifth and last page of Form 1040NR. Those who would otherwise qualify as residents for tax purposes under the SPT, but are seeking an exemption, may need to file additional forms (such as Form 8840 or Form 8843) as discussed in the exemptions section.

### Tax liability

Nonresidents for tax purposes may not be allowed to take the standard deduction that is available to residents for tax purposes. The tax exemptions (as well as withholding exemptions) permitted for a nonresident depend on the nature of tax agreement between the nonresident's country of tax residence and the United States.
Also, nonresidents who are in certain types of statuses (F, J, M, and Q) are not required to pay Social Security or Medicare taxes for employment that falls within their status. However, this is not really specific to nonresidents, since residents for tax purposes (including citizens and green card holders) are also exempt from Social Security and Medicare taxes for income earned where the employer is the educational institution, subject to a number of caveats. However, the distinction becomes relevant to on-campus employment not by the university, as well as to off-campus employment undertaken under Optional Practical Training or Curricular Practical Training: students in such employment need to pay Social Security and Medicare taxes if and only if they have become residents for tax purposes.

## Relation between residency for tax purposes and citizenship and immigration status
### Residency for tax purposes does not imply permanent residency

It is possible to be a resident for tax purposes in the United States but not a permanent resident of the United States. A non-citizen can be a permanent resident of the United States only by holding a Green Card. On the other hand, people on non-immigrant visas may well be treated as residents for tax purposes.

### Resident and nonresident aliens

* A resident for tax purposes who is not a United States citizen is termed a resident alien for tax purposes.
* A non-resident for tax purposes who is not a United States citizen is termed a non-resident alien for tax purposes.

## Exemptions

Some aliens (i.e., people who are not citizens) can claim exemptions from the substantial presence test.

### Foreign government-related individual

A foreign government-related individual is an individual (or a member of the individual's immediate family) who is temporarily present in the United States:
* As a full-time employee of an international organization,
* By reason of diplomatic status, or
* By reason of a visa (other than a visa that grants lawful permanent residence) that the Secretary of the Treasury determines represents full-time diplomatic or consular status.
The relevant visas that correspond to these exemptions are the A visa and the G visa. These visas include both the visas granted to people who are directly involved in the government-related or diplomatic jobs, and their spouses and minor children.
There is no limit on the number of days that can be excluded from the Substantial Presence Test for a foreign government-related individual.

### Special status: F, J, M, Q, medical conditions, or athletes

In calculating days of presence for the substantial presence test, a person can exclude a few calendar years present on a F visa, J visa, M visa, or Q visa (the number of calendar years varies based on the status). In addition, individuals can exclude days of presence due to medical conditions and if attending charitable sports events. Explicitly, the four types of exclusions possible are:
* Temporary presence in the United States as a student on a F visa, J visa, M visa, or Q visa. It is possible to exclude only the first five calendar years of presence from the Substantial Presence Test. Also, it is possible to use the exemption at most 5 times.
* Temporary presence in the United States as a teacher or trainee under a J visa or Q visa. It is possible to exclude at most three years out of any continuous period of six years. There are some other caveats to the use of this status as well.
* Days of presence in the United States because the individual was unable to leave due to a medical condition.
* Days of presence in the United States as a professional athlete for a charitable event.
A person seeking exemption in this manner is required to file Form 8843 along with his or her tax return. In fact, even those who have no income need to file Form 8843 to inform the IRS that they are in student status and are not residents for tax purposes. For those with taxable income, Form 8843 must be filed as part of the tax return by the usual tax filing deadline (April 15, but can be deferred up to six months to October 15) and for those with no taxable income, the filing deadline is June 15.

### Closer connection to a foreign country

There are two "closer connection" exceptions available:
* The closer connection exemption available to all aliens. To qualify for this, the individual must submit Form 8840.
* The closer connection exemption available only to foreign students. To qualify for this, the student must submit Form 8843.

## Dual-status aliens
### First-year choice

Some aliens may, under some circumstances, elect to file "dual-status" returns, treating part of their tax year as being in nonresident status and part of it in resident status. In order to be able to elect to file as a dual-status alien, an individual must meet both of the following requirements:
* Be present in the United States for at least 31 days in a row in the tax year
* Be present in the United States for at least 75% of the number of days beginning with the first day of the 31-day period and ending with the last day of the tax year. For the 75% requirement, 5 days of absence from the United States can be treated as days of presence in the United States.
If the individual elects to file as a dual status alien, the residency starting date for the tax year is the first day of the earliest 31-day period (described in (1) above) that is chosen to qualify for the choice.
That option is typically used by people who expect to become residents for tax purposes in the next year.

### Options related to spouses and joint filing

People who are filing jointly with their spouses may have the option of electing to file as residents for the whole year despite being otherwise dual-status.

## Similar tests in other countries

* Statutory Residence Test in the United Kingdom
* Physical presence test, used to determine the tax status of US citizens and permanent residents who lived or earned income abroad.