Tools/Visa-holder finance/Substantial Presence Test Calculator✓ CHECKED AGAINST WORKED EXAMPLES · SEP 29, 2026

Am I a resident alien for US tax purposes?

Enter your days in the US for the last three years to see whether you meet the substantial presence test, how many more days you can spend here, and what your status means for withholding.

Edit on my map
Green card at any time in the year you are testing?
Do any of those days not count?
Choose Student or Teacher if you were an F, J, M or Q exempt individual on any day in these three years, even if you are on an H-1B now: those days drop out of all three years, including the earlier ones. Choose No only if none of your days were exempt.
Were you a US tax resident last year?
You were if you held a green card, or met this test, for last year.
Leaving the US for good this year?
This changes the answer only if you were a US resident last year. If you arrive and leave in the same year, the arrival paragraph is the one that applies.
DAYS COUNTED TOWARD THE TESTNONRESIDENT ALIEN
180vs 183
You do not meet the test: 120 + 40 + 20 = 180 weighted days, 3 short of 183. You can spend up to 122 days here this year (2 more) and stay under it.
This year
120 days
Last year ÷ 3
40.0
Year before ÷ 6
20.0
Days you can add
2 days
UNDERSTAND YOUR RESULT
LIBRARY CHAPTERCounting Days: the Substantial Presence Test and Form 8843How to count days of presence, which days never count, how long F, J, M and Q students and J-1 scholars stay exempt, when Form 8843 is due even with no income, and the closer connection exception.LIBRARY CHAPTERYour First Year: Dual Status and the First-Year ChoiceWhen residency starts, the restrictions on a dual-status return, the first-year choice for people who arrive late in the year, and the full-year resident choice that lets a married couple file jointly.QUICK ANSWERWhat is the substantial presence test?The substantial presence test is the IRS day count that decides whether someone who is not a US citizen or green-card holder is taxed as a US resident. You meet it with at least 31 days in the US this year and at least 183 days when you add all of this year's days, a third of last year's and a sixth of the year before's.
Terms:Substantial presence testResident and nonresident alien (for tax)Exempt individual (substantial presence test)Form 8843Dual-status alienFirst-year choice

Do my days add up to 183?

Weighted days (this year + 1/3 of last year + 1/6 of the year before)180
183
Days counted this year120
31

180 weighted days against the 183 needed, and 120 days this year against the 31 needed: the 31-day minimum is met but the weighted total is not.

How your three years add up

YearDays hereDays countedWeightAdds
This year120120× 1120.0
Last year120120× 1/340.0
Two years ago120120× 1/620.0
TotalNeed 183180.0

This year counts in full, last year at one-third and the year before at one-sixth, for 180 weighted days.

What each status means for you

Resident alienNonresident alienDual-status year
ReturnForm 1040Form 1040-NRForm 1040 or 1040-NR with a statement
Taxed onIncome from everywhereUS-source incomeBoth, for the part of the year each applies
Wage withholdingLike a US citizenGraduated, special W-4 (Notice 1392)By the status you give your employer
Dividends and interestNo 30% withholding (W-9)Dividends: 30% or treaty rate (W-8BEN); most bank and portfolio interest: noneDividends: 30% or treaty rate while a nonresident; most bank and portfolio interest: none
Standard deductionYesGenerally noNo

Yours is the nonresident alien column. You are not a resident yet, but if you will meet the test next year you may be able to choose resident treatment for part of this year (the first-year choice, Publication 519 chapter 1). Tax treaties and residency dates can change the details; this page does not compute the dates.

How it's computed

FORMULA
Weighted days = days this year + 1/3 × days last year + 1/6 × days the year before
Test met = at least 31 days this year AND weighted days ≥ 183
Resident alien = green card at any time in the year, OR test met (unless the closer-connection exception applies)
Days as an exempt individual, and a few other days, are not counted
  • You are present on any day you were physically in the US at any time during the day. The days that do not count are: exempt-individual days (F, J, M or Q students; J or Q teachers and trainees; A or G government-related; athletes in a charitable event), regular commuting from Canada or Mexico, transit under 24 hours between two foreign places, days as crew of a foreign vessel, and days you could not leave because of a medical condition that arose here. Enter those days as exempt days.
  • Students are exempt for five calendar years, and teachers and trainees are not exempt if they were exempt in 2 of the 6 preceding years; past those limits this year’s exempt days are counted and the result if the exception applies is shown next to it. The page does not check that you meet the other conditions of the exemption or file Form 8843.
  • The closer-connection exception needs fewer than 183 days here this year, a tax home in a foreign country for the whole year and closer ties to it, and no green card application that year. It is claimed on Form 8840.
  • Tax treaty tie-breaker rules are not applied, and no residency starting or ending date is computed. Your day counts for the earlier years are your own records. This is not tax advice.
WORKED EXAMPLE · SAMPLE NUMBERS
This year: 120 days. Last year: 120 × 1/3 = 40. Two years ago: 120 × 1/6 = 20. Total 180 against 183, and 120 days this year against 31, so the test is not met.
Keep this number honest as your life changes.
Put it on your Money Map and it re-runs as you change the seven numbers. It stays in this browser, and the calculator stays free.
Open your Money MapTell me when bank sync opens

Questions about this result

A day-count test for US tax residency. You meet it if you were in the US on at least 31 days this year and your weighted total is at least 183 days: every day this year, plus one-third of the days last year, plus one-sixth of the days the year before (IRS Publication 519). Meeting it makes you a resident alien for tax purposes unless an exception applies. The IRS’s own example: 120 days in each of three years totals 180, so that person is not a resident.
Not while you are an exempt individual. Days as a student on an F, J, M or Q visa, and days as a J or Q teacher or trainee, do not count if you substantially comply with the visa. Students are exempt for five calendar years, and any part of a year counts as a year; in the sixth, their days count unless they show they do not intend to reside permanently in the US. Teachers and trainees are not exempt if they were exempt as a teacher, trainee or student in 2 of the 6 preceding calendar years. Exempt individuals file Form 8843.
You are present on any day you were physically in the US at any time during the day, so a partial day counts. Days in transit through the US for less than 24 hours between two foreign places, days commuting from Canada or Mexico if you regularly commute, days as crew of a foreign vessel, days you could not leave because of a medical condition that arose here, and exempt-individual days do not count (Publication 519).
Even if you meet the test, you can be treated as a nonresident if you were in the US fewer than 183 days this year, kept a tax home in a foreign country all year, and had a closer connection to it than to the US. You cannot use it if you applied for a green card, or took other steps to become a permanent resident, that year. You claim it on Form 8840 by the due date of your Form 1040-NR.
A tax year in which you were both a nonresident and a resident alien, usually the year you arrive or leave (Publication 519, chapter 6). If you meet the test and were not a resident last year, you are a resident only from your residency starting date, which is your first day in the US that year (days as an exempt individual are not days here), and a nonresident before it; if that day is January 1 there is no nonresident part. If you leave for good, your residency ends on December 31 unless you qualify for an earlier date, the last day you were in the US, by keeping a tax home and closer connection abroad afterwards. A dual-status return cannot use the standard deduction and, with limited exceptions (see “Choosing Resident Alien Status” in Publication 519), cannot be filed jointly. It could not be e-filed for 2025; check the current year’s rule. This page does not compute the dates.
You tell your employer which you are so it can withhold correctly. Residents are withheld like citizens. A nonresident’s wages are subject to graduated withholding but follow special Form W-4 instructions (IRS Notice 1392), and US dividends face 30% withholding unless a treaty lowers it (most bank and portfolio interest is not withheld on). Nonresident F, J, M or Q visa holders generally do not pay Social Security and Medicare tax on work that carries out the purpose of their visa, such as on-campus work or practical training; once they become residents those taxes are withheld even though the visa is the same.
THE LEDGER · 10 min5 Retirement Mistakes That Cost $100K+ (Part 3 of 3)
THE LEDGER · 28 min5 Retirement Mistakes That Cost $100K+ (Part 2 of 3)
GUIDE · $39The Retire-Early Playbook
YOUR MAP · 0 of 7 doneNext: FIRE CalculatorContinue →