# US substantial presence test: the 183-day formula explained

> The IRS substantial presence test: 31 days this year and 183 weighted days over three years. The formula, worked examples, exempt days and exceptions.

Last updated 2026-11-23. https://stayquota.co/guides/us-substantial-presence-test/

The substantial presence test is the IRS day-count test that can make someone who is not a US citizen a US resident for federal income tax for a calendar year. You meet it if you were physically present in the United States on at least 31 days during the current year and on at least 183 days over the three-year period made up of the current year and the two years before it, counting all of this year's days, one third of last year's days and one sixth of the days from the year before that.

> This guide is general information, not tax advice. The official sources are the IRS page on the [substantial presence test](https://www.irs.gov/individuals/international-taxpayers/substantial-presence-test) and [IRS Publication 519, US Tax Guide for Aliens](https://www.irs.gov/publications/p519). Ask a tax adviser about your own situation.

## The formula

1. Count your days of physical presence in the US in the current year. If there are fewer than 31, you don't meet the test.
2. Add one third of your US days in the first year before the current year.
3. Add one sixth of your US days in the second year before the current year.
4. If the total is 183 or more, you meet the test for the current year.

The IRS uses the fractions as they are. Days in the US on any part of a day generally count as a day, but some days are left out (see below).

## Worked examples

The IRS's own example: you were in the US on 120 days in each of 2023, 2024 and 2025. For 2025 you count 120 days, plus 40 (one third of 120) for 2024, plus 20 (one sixth of 120) for 2023. The total is 180, so you don't meet the test for 2025.

The same pattern shows where the line is. If you spend the same number of days in the US every year, the weighted total is one and a half times that number:

| US days in each of 2024, 2025 and 2026 | 2026 days | ⅓ of 2025 | ⅙ of 2024 | Total | Meets the test for 2026? |
|---|---|---|---|---|---|
| 120 | 120 | 40 | 20 | 180 | No |
| 121 | 121 | 40⅓ | 20⅙ | 181½ | No |
| 122 | 122 | 40⅔ | 20⅓ | 183 | Yes |

So 122 days a year, every year, is enough to meet the test, even though you never spent 183 days in the US in any single year.

A snowbird example: 150 days in 2026, 150 in 2025 and 140 in 2024 gives 150 + 50 + 23⅓ = 223⅓. That meets the test for 2026. Because 2026 has fewer than 183 days, the closer connection exception described below may still apply.

## Days that don't count

The IRS lists days that are not counted toward the test:

- Days you commute to work in the US from a residence in Canada or Mexico, if you regularly commute.
- Days you are in the US for less than 24 hours while in transit between two places outside the US.
- Days you are in the US as a crew member of a foreign vessel.
- Days you can't leave the US because of a medical condition that developed while you were in the US.
- Days you are an exempt individual.

## Exempt individuals

"Exempt individual" is a defined term, and it doesn't mean the person is exempt from tax. The IRS lists four groups: certain foreign government-related individuals (A or G visas, other than A-3 or G-5), teachers or trainees on J or Q visas, students on F, J, M or Q visas, and professional athletes temporarily in the US to compete in a charitable sports event. Each group has conditions and time limits, and people who leave out days as exempt individuals or for a medical condition generally file Form 8843. Check Publication 519 before relying on any of them.

## The closer connection exception

You can be treated as a nonresident even though you meet the test if, for the current year, you were present in the US on fewer than 183 days, kept a tax home in a foreign country, and had a closer connection to that country than to the US. You claim it on [Form 8840](https://www.irs.gov/forms-pubs/about-form-8840), filed on time each year. It isn't available if you have applied for a green card or taken other steps toward permanent residence. Students have a separate closer connection exception.

Two other things can change the result. A tax treaty between the US and your country may contain tie-breaker rules, and the green card test makes lawful permanent residents US residents whatever their day count. Neither is covered here.

## Fractions and whole days

The IRS counts one third and one sixth exactly, so 121 days in the prior year adds 40⅓, not 40. Day counters often show whole numbers. StayQuota's IRS presence rule shows each term rounded down to whole days, so its total can be up to one day lower than the exact figure. If you are within a few days of 183, work out the exact fractions or ask your adviser.

## Keeping a record of your US days

The test runs on days, so a reliable day record is the whole game, especially if you spend winters in the US or travel back and forth for work.

StayQuota: Country Tracker records the country you're in each day on your iPhone, in the background. Its IRS presence test rule counts your US days for the current year and the two years before, and writes the result in plain words, for example "120 days this year + 40 + 20 from prior years = 180 of 183." Days you mark as transit or medical are left out, so mark them only when they meet the IRS conditions above. When you meet the test, StayQuota reminds you that Form 8840 may still apply. You can bring in earlier years from a Google Maps Timeline export, a CSV or your photos, and export a PDF or CSV of every day for your adviser.

Canadian snowbirds can follow Ontario OHIP's 153-day rule next to the IRS test; see the [snowbird 183-day guide](https://stayquota.co/guides/snowbird-183-day-rule/). For the other rules StayQuota follows, see [features](https://stayquota.co/features/) and [pricing](https://stayquota.co/pricing/).

Download StayQuota: Country Tracker on the App Store: https://apps.apple.com/app/id6819390323
