Free IRS day count calculator

Substantial presence test calculator: count your US days the way the IRS does

Updated 13 November 2026Rules from IRS Publication 519 (2025)Runs in your browser
The short answer

You are a US tax resident for a year if you were in the US on at least 31 days that year and on 183 days over three years, counting every day this year, a third of last year's days and a sixth of the days the year before.

A day counts if you were in the US for any part of it, so the day you land and the day you fly out are both days.

The line 183 weighted days across three calendar years Plus at least 31 days in the year you are testing. Day 183 is the first day of residence, not the last day of safety.

It usually starts with a booking. A trade show in Las Vegas in March, a client in Miami in June, a long summer with family in Texas. Each trip feels short. The IRS doesn't look at trips. It looks at days, across three calendar years, and it counts a day the moment you set foot on US soil. Put your stays in below and you'll see the exact count, how many days you have left this year, and which exceptions could still keep you a nonresident.

Key takeaways

  • The test is 31 days this year and 183 weighted days: all of this year, 1/3 of last year, 1/6 of the year before.
  • Any part of a day in the US is a full day, so a short hop can cost two or three days.
  • Students, teachers, trainees and diplomats on certain visas are exempt individuals whose days don't count while the exemption lasts.
  • Under 183 days this year with a tax home abroad? The closer connection exception on Form 8840 can keep you a nonresident.
  • A tax treaty tie-breaker (Form 8833) can override the result for figuring your US tax.
  • For a foreign owner of a US LLC, becoming resident means worldwide income on a US return and a different set of filings for the company.
Chapter 1

Substantial presence test calculator

INUS

Pick the year you want to test. Then add each stay in the US with the day you arrived and the day you left; both are counted. Overlapping trips are merged, a stay over New Year is split between the two years, and days you mark as excluded are left out of the total. If you already know your totals, switch to typing them.

    Only part of a stay excluded, such as the days a medical problem kept you from flying home? Enter that part as its own trip and mark it.

    Nothing you type is sent anywhere. Trips are kept in this browser only, so they're still here when you come back; "Clear all trips" removes them.

    1
    Key takeaway

    The verdict turns on one number: weighted days of 183 or more, with at least 31 this year.

    Chapter 2

    What counts as a day of presence in the US

    IRS Publication 519 treats you as present on any day you are physically in the US at any time during that day.

    There is no hour threshold. Land at 11.40 pm and that whole calendar day is in your count; take the first flight out at 6 am and that day is in too. "The United States" here means the 50 states, the District of Columbia and US territorial waters. It does not include Puerto Rico, Guam or the other US territories, and it does not include US airspace, so overflying the country costs nothing.

    One short trip, counted two ways. Land in New York on a Monday night, fly out on Wednesday morning.
    IRS countMonland 23:40TueWedleave 06:103 days
    UK style countMonmidnight hereTuemidnight hereWedgone by midnight2 days

    Six kinds of days you leave out

    Transit under 24 hoursChanging planes between two places outside the US. It stops being transit if you attend a business meeting, the IRS adds, even one held at the airport.
    Regular commutingCommuting to work in the US from a home in Canada or Mexico on more than 75% of your workdays in the working period.
    Crew of a foreign vesselTemporary presence as a regular crew member of a foreign ship sailing between the US and abroad, unless you do other business in the US that day.
    A medical conditionDays you meant to leave but couldn't, because of a condition that arose while you were in the US. Not for a condition you already knew about. Form 8843 is required.
    NATO visasMembers of a NATO force or its civilian component. Their family members on NATO visas still count every day.
    Exempt individualsCertain diplomats, students, teachers, trainees and athletes, explained in chapter 4.

    Everything else counts: holidays, family visits, medical treatment you came for, days you worked remotely for a foreign employer, days spent house hunting. Your I-94 travel history from US Customs and Border Protection lists your recorded arrivals and departures, which is a good starting point for the trip list above.

    2
    Key takeaway

    Count calendar days touched, not nights slept or hours spent.

    Chapter 3

    How to calculate the substantial presence test: three worked examples

    The weights make old days cheap and this year's days expensive. A day two years back is worth a sixth of a day; a day last year, a third. The receipts show how that plays out.

    The IRS's own example

    Publication 519: 120 days in each of 2023, 2024 and 2025, testing 2025
    2025: all 120 days120
    2024: 120 ÷ 340
    2023: 120 ÷ 620
    Weighted total180
    Short of 183, so not a resident for 2025 under the test. Load it into the calculator with "Type day totals".

    Say you stay 30 days longer

    150 days in 2026 after 120 in each of 2025 and 2024
    2026: all 150 days150
    2025: 120 ÷ 340
    2024: 120 ÷ 620
    Weighted total210
    You meet the test. With fewer than 183 days in 2026 itself, the closer connection exception is still open to you.
    122days is the most you can spend in the US this year after 120 days in each of the last two years, without meeting the test122 + 40 + 20 = 182. Day 123 makes it 183. The calculator works this out for your own history.

    The third pattern catches frequent visitors: 121 days every year is the steady state that never trips the test, because 121 + 40.33 + 20.17 = 181.5. At 122 days a year the total reaches 183 from the third year on. Our rule of thumb for a regular visitor is to plan around 120 days a year and keep the receipts.

    3
    Key takeaway

    Your safe number this year depends on the last two; the calculator gives it to you exactly.

    Chapter 4

    Exempt individuals: whose days don't count

    "Exempt individual" doesn't mean exempt from tax. It means the days don't count toward the test while you hold that status. There are four groups, each with its own time limit.

    WhoVisaHow long the days stay excludedForm 8843
    Foreign government-related individualsA or G (not A-3 or G-5 household staff), plus full-time staff of designated international organisationsFor as long as the status lastsNot required
    Teachers and traineesJ or Q, substantially complyingNot exempt if you were an exempt teacher, trainee or student in any part of 2 of the 6 previous calendar years, with an exception when a foreign employer paid youRequired
    StudentsF, J, M or Q, substantially complying5 calendar years; longer only if you show no intention to reside permanentlyRequired
    Professional athletesAny, at a charitable sports eventOnly the days you actually competeRequired

    For diplomats, teachers, trainees and students, a spouse and unmarried children under 21 in the household whose visas depend on yours share the exemption. A business visitor on a B-1 or B-2 visa or under the Visa Waiver Program is not an exempt individual, which is the group most foreign company owners fall into. Mark exempt periods in the calculator with "Exempt individual days".

    4
    Key takeaway

    Business and tourist visits are never exempt; every day is counted.

    Chapter 5

    The closer connection exception and Form 8840

    Meeting the test isn't always the end of the story. You can still be treated as a nonresident for the year if all three of these hold:

    1. Fewer than 183 daysin the US in the year itself (actual days, not weighted).
    2. A tax home abroadfor the whole year: your main place of business or work, or where you regularly live if you have none.
    3. A closer connectionto that country than to the US, judged on your permanent home, family, belongings, affiliations, business, driving licence, voting and the residence you state on forms such as W-8BEN.

    You claim it by attaching Form 8840 to your return, or by sending it alone if you don't have to file, by the Form 1040-NR due date: 15 June of the following year if you had no US wages with withholding, 15 April if you did. Miss it and the exception is lost unless you can show clear and convincing evidence that you tried to comply.

    When it's closed to you

    If during the year you applied for a green card, took other steps toward permanent residence, or had an adjustment of status pending, you cannot claim a closer connection. A two-country version exists for people who moved their tax home from one foreign country to another during the year.

    5
    Key takeaway

    Under 183 real days and a life clearly based abroad: file Form 8840 on time and stay nonresident.

    Chapter 6

    Tax treaty tie-breaker: resident in two countries

    The substantial presence test doesn't override a tax treaty. If you are a resident of the US under the test and of another country under its own law, and the two have an income tax treaty with a residence tie-breaker, the treaty can decide that you are resident in the other country. You then figure your US tax as a nonresident, filing Form 1040-NR with Form 8833 attached, while still counting as a US resident for other purposes such as your residency dates.

    Most US treaties follow the order in the OECD Model's residence article: where you have a permanent home, then where your personal and economic ties are closer, then where you habitually live, then nationality. Read the residence article of your own treaty from the IRS treaty list. Long-term green card holders should take advice first: Publication 519 warns that a tie-breaker claim can trigger the expatriation tax.

    6
    Key takeaway

    No treaty, no tie-breaker: then the closer connection exception is your only way back.

    Chapter 7

    Dual-status years: the year you arrive and the year you leave

    Residence under the test doesn't always cover the full calendar year. You can be a nonresident for part of a year and a resident for the rest, which the IRS calls a dual-status year.

    The first year: before and after your residency starting date
    NonresidentJan 1 to the day beforeResidentFrom your first day in the US that year
    1 JanResidency starting date31 Dec

    Arriving

    If you weren't a resident the year before, your residency starts on the first day you were in the US in the year you meet the test. Up to 10 days of earlier short visits can be left out of that date if you had a closer connection abroad on those days, though they still count toward the test itself. A signed statement goes with your return. The calculator above shows your first counted day for the year.

    Leaving

    In your last year, residence normally runs to 31 December. It can end earlier, on the last day you were in the US, if you keep a tax home abroad and a closer connection to it for the rest of the year and you aren't resident the next year. Up to 10 days of later visits can again be ignored for this date.

    The first-year choice

    If you don't meet the test this year but will next year, you can choose to be treated as resident from part of this year, provided you were in the US for 31 days in a row and for at least 75% of the days from the start of that run to 31 December, with up to 5 days away counted as present. People usually do it to file jointly or claim resident deductions.

    7
    Key takeaway

    Residence starts on a date, not on 1 January; that date decides which income is taxed as a resident's.

    Chapter 8

    The 183 day rule elsewhere: the UK and tax treaties

    1 Jan6 Apr

    "183 days" turns up in three different rules, and people mix them up. The US test is a weighted count over three calendar years. The UK test is a single tax year with its own way of counting days. And the treaty rule decides where an employee's salary is taxed, not where the person lives.

    The UK statutory residence test, in brief

    The UK tax year runs from 6 April to 5 April, and HMRC counts a day only if you are in the UK at midnight. The test runs in three steps, set out in HMRC's RDR3 guidance:

    1. Step 1: automatic overseas testsNon-resident if any appliesFewer than 16 days in the UK if you were resident in one of the 3 previous tax years; fewer than 46 days if you were resident in none; or full-time work abroad with fewer than 91 UK days, of which fewer than 31 with more than 3 hours of work.
    2. Step 2: automatic UK testsResident if any applies183 days or more in the UK; your only home in the UK for 91 days in a row, at least 30 of them in the tax year; or full-time work in the UK over a 365 day period.
    3. Step 3: sufficient ties testDays and ties togetherFamily, accommodation, work and 90 day ties, plus a country tie if you were resident in any of the previous 3 years. The more ties, the fewer days it takes.
    Resident in 1 or more of the last 3 tax years
    16 to 45 days
    4 ties
    46 to 90 days
    3 ties
    91 to 120 days
    2 ties
    Over 120 days
    1 tie
    Resident in none of the last 3 tax years
    46 to 90 days
    All 4 ties
    91 to 120 days
    3 ties
    Over 120 days
    2 ties

    One catch: under HMRC's deeming rule, someone resident in one of the previous three years with at least three ties who is in the UK on more than 30 days without staying to midnight has every such day after the 30th counted anyway. Leaving at 11 pm every time doesn't work for long.

    Count one trip both ways

    The 183 day rule in tax treaties

    Most income tax treaties have an employment article built on Article 15 of the OECD Model Tax Convention. It lets an employee work in another treaty country and be taxed only at home if all three conditions hold:

    • present there for no more than 183 days in any 12-month period starting or ending in the tax year (some older treaties use the calendar or fiscal year);
    • paid by, or on behalf of, an employer that is not resident in that country;
    • the pay is not borne by a permanent establishment the employer has there.

    Publication 519 sets out the same three conditions for people working in the US, and notes that some treaties differ. Two things the rule is not: it is not a residence test, and it doesn't cover the self-employed or business profits, which most treaties handle under a separate article that looks for a fixed base or permanent establishment instead of a day count.

    8
    Key takeaway

    Three different 183s: a weighted US count, a UK midnight count, and a treaty limit on taxing salaries.

    Chapter 9

    Why the count matters if you own a US LLC and visit the US

    Plenty of people who own a US LLC from abroad never think about this test, because they rarely set foot in the US. The ones who should are the owners who go for conferences, meet clients, spend winters in Florida or move there in stages. Three things change.

    If you become residentYour worldwide income goes on a US return

    A resident alien is taxed like a citizen on income from everywhere, on Form 1040, and a single-member LLC's profit shows up on that return. You also stop being a "foreign person", so the LLC is no longer the foreign-owned disregarded entity that files Form 5472; the filings become the ones a US owner makes.

    Even as a nonresidentWork done on US soil is US income

    Publication 519 sources pay for services by where you perform them, and says that performing personal services in the US at any time in the year usually means you are engaged in a US trade or business. A month of working for your clients from a rented flat in Miami can create income that is taxable in the US, with no 183 day threshold. The small exception, 90 days and US$3,000 for an employee of a foreign business, rarely fits an owner.

    Either wayKeep the paper trail

    Keep your trip list, your I-94 history and boarding passes for at least the three years the test looks back over. If you get close to 183, decide before the trip, not after, whether Form 8840 or a treaty claim will apply to you, and see our guides to the ITIN and the W-8BEN-E that your LLC's bank and payment platforms ask for.

    None of this stops you running a US company from abroad, and an owner who visits a few weeks a year stays far from the line. It just means the calendar belongs in the same folder as the company papers.

    9
    Key takeaway

    The LLC doesn't make you resident; your days do. Count them before you book a long stay.

    Chapter 10

    Substantial presence test questions, answered

    ?
    How do you calculate the substantial presence test?
    Add all the days you were in the US in the year you are testing, a third of the days in the year before and a sixth of the days in the year before that. If the total is 183 or more and you were in the US for at least 31 days in the year being tested, you meet the test.
    Does a partial day count as a day for the substantial presence test?
    Yes. The IRS treats you as present on any day you are physically in the US at any time during that day, so arrival and departure days both count. The exceptions are transit of under 24 hours between two foreign places, regular commuting from Canada or Mexico, foreign vessel crew, a medical condition that arose in the US, NATO visas and exempt individuals.
    Is the substantial presence test the same as the 183 day rule?
    It uses 183 as its threshold, but the 183 days are weighted over three years, not counted in one year. Other "183 day rules", such as the UK's automatic residence test or the treaty limit for taxing an employee's salary, work differently.
    Can I meet the substantial presence test and still be a nonresident?
    Yes, in two ways. With fewer than 183 actual days in the year, a tax home abroad and a closer connection to that country, you can file Form 8840 and remain a nonresident. If you are resident in a treaty country under its law, the treaty's tie-breaker may make you a nonresident for figuring US tax, claimed on Form 1040-NR with Form 8833.
    Do F-1 students count their days?
    Not while they are exempt individuals: students on F, J, M or Q visas who comply with the visa terms exclude their days for up to 5 calendar years, and must file Form 8843. After that, days count unless the student shows no intention to reside permanently.
    When is Form 8840 due?
    By the due date of Form 1040-NR for the year: 15 June of the following year if you had no US wages subject to withholding, otherwise 15 April. If you don't have to file a return, you send it on its own to the IRS in Austin by the same date.
    Does owning a US LLC make me a US tax resident?
    No. Residence for a non-citizen depends on the green card test or the substantial presence test, which look at you, not your company. Owning an LLC changes nothing until your days in the US reach the test, although work you physically do in the US can create US-source income before then.

    Changelog

    • 13 November 2026: first published, with the rules of IRS Publication 519 (2025) for 2025 returns, the IRS list of income tax treaties (last reviewed 3 January 2026), HMRC's RDR3 notes (updated 11 June 2026) and the residence manual pages RFIG20710 and RFIG20720. The calculator reproduces the Publication 519 example (120 days a year gives 180).
    Run it from abroad

    A US company doesn't need you in the US.

    We form your LLC, keep its filings on time and set up the bank account with you, all without a flight. Your days stay yours.