Skip to content

Substantial Presence Test Calculator

Run the IRS 3-year weighted formula to see if you meet the Substantial Presence Test for US tax residency. Handles green cards, visa-based exempt days, the 31-day minimum rule, and the Closer Connection Exception.

  • 3-year weighted formula with live results
  • Visa exemptions (F, J, M, Q, A, G) with year tracking
  • Reverse calculator: max safe days in the current year
  • Closer Connection Exception + tax treaty awareness
This calculator is for informational purposes only — not legal or tax advice. US tax residency rules are complex. Consult a qualified tax professional for advice specific to your situation.

Days physically present in the United States

Weight: 100%= 0 days
Weight: × ⅓= 0 days
Weight: × ⅙= 0 days
Does Not Meet TestThreshold: ≥ 183 weighted days
0 / 183

You do not appear to meet the Substantial Presence Test for 2026.

You are 183 weighted days below the 183-day threshold.

Safe zone for 2026: Based on your prior-year days, you can spend up to 182 days in the US in 2026 without meeting the SPT.

Your inputs are saved in this browser tab. To save permanently or share, click Share below.

This calculator is for informational purposes only and does not constitute tax, legal, or financial advice. Tax residency rules are complex and vary by jurisdiction. Consult a qualified tax professional for advice specific to your situation.

Track your US days automatically

The Substantial Presence Test hinges on an accurate day count. iReside uses GPS to log whether you're in the US or abroad every day — no manual tracking required.

Download iReside — Free Trial$34.99/year after trial. No credit card required.

What Is the Substantial Presence Test?

The Substantial Presence Test is the IRS's primary mechanical test for determining whether a foreign national is a “resident alien” for US federal income tax purposes. Unlike the Green Card Test (which is binary — you have one or you don't), the SPT uses a weighted day-count formula that looks at your physical presence in the US over a rolling 3-year window.

If you meet the test, you are generally treated the same as a US citizen for tax purposes: you must report worldwide income, you may be subject to FBAR and FATCA reporting, and you file Form 1040 rather than 1040-NR. The stakes are high — which is why getting the count right matters.

The 3-Year Weighted Formula Explained

The formula is straightforward: take your days in the US for the current tax year (counted at full value), add one-third of your days from the prior year, and add one-sixth of your days from two years ago. If the total is 183 or more, you meet the day-count prong of the test. You must also have been present for at least 31 days in the current year — this “minimum presence” rule prevents triggering the test based solely on prior-year carryover.

Exempt Days: What Doesn't Count

The IRS excludes certain categories of days from the SPT count. The most common exemptions are for students (F, J, M, Q visas — exempt for the first 5 calendar years of US presence) and teachers/trainees (J, Q visas — exempt for 2 of the preceding 6 calendar years). Foreign government officials on A or G visas are fully exempt. Days spent in transit through the US for less than 24 hours and days you were medically unable to leave also don't count.

The Closer Connection Exception (Form 8840)

Even if you meet the SPT, you may avoid being treated as a US resident if you can demonstrate a “closer connection” to a foreign country. To qualify: you must have been present in the US for fewer than 183 actual days in the current year, maintained a tax home in a foreign country for the entire year, and had a closer connection to that country than to the US. You claim this by filing IRS Form 8840 (Closer Connection Exception Statement) with your tax return.

Track Your US Days with iReside

For anyone splitting time between the US and abroad, accurate day-counting is essential. iReside uses GPS to automatically log whether you're in the US or in a foreign country every day of the year. It calculates your SPT weighted total in real time and alerts you before you approach the threshold — so you can adjust your travel plans before it's too late.

Frequently Asked Questions

What is the Substantial Presence Test?
The Substantial Presence Test (SPT) is the IRS's primary method for determining whether a foreign national is a 'resident alien' for US federal income tax purposes. It uses a weighted formula counting your days of physical presence in the US over a 3-year period. If the weighted total reaches 183 or more AND you were present for at least 31 days in the current year, you meet the test and may be required to report worldwide income to the IRS.
How does the 3-year weighted formula work?
The formula weights your days in the US: current year days count at 100%, last year's days count at 1/3, and the year before that counts at 1/6. For example, if you spent 120 days in 2026, 120 days in 2025, and 120 days in 2024, your weighted total would be 120 + 40 + 20 = 180 — just under the 183-day threshold.
What days don't count (exempt days)?
Several categories of days are excluded from the count: days as a foreign government official on an A or G visa (fully exempt), days as a student on an F, J, M, or Q visa (exempt for the first 5 calendar years), days as a teacher or trainee on a J or Q visa (exempt for 2 of the past 6 calendar years), days spent in transit through the US for less than 24 hours, and days you were unable to leave due to a medical condition that developed while in the US.
What is the 31-day minimum rule?
Even if your 3-year weighted total reaches 183 or more, you do NOT meet the Substantial Presence Test unless you were physically present in the US for at least 31 days during the current tax year. This prevents someone who hasn't visited the US at all this year from being classified as a resident based solely on prior-year days.
What is the Closer Connection Exception?
If you meet the SPT but were present in the US for fewer than 183 actual days in the current year, you may be able to claim the Closer Connection Exception. To qualify, you must demonstrate that you maintained a tax home in a foreign country and had a closer connection to that country than to the US. You claim this exception by filing IRS Form 8840 with your tax return.
How does the green card test differ from the SPT?
The green card test is separate and simpler: if you held a US green card (lawful permanent resident status) at any point during the tax year, you are a US tax resident regardless of how many days you spent in the US. The SPT is relevant for foreign nationals who don't have a green card but spend significant time in the US.
What if a tax treaty applies?
If you meet the SPT but are also a tax resident of a country that has a tax treaty with the US, the treaty's 'tie-breaker' provision may determine which country has the primary right to tax you. Treaty tie-breakers typically look at where you have a permanent home, center of vital interests, habitual abode, and nationality. Consult an international tax professional to evaluate treaty benefits.
How does iReside help with the SPT?
iReside tracks your physical location via GPS every day, automatically logging whether you're in the US or abroad. It calculates your SPT weighted total in real time, alerts you when you're approaching the threshold, and generates an audit-ready report showing your exact day count for each year.

Track your days automatically

Stop counting manually. iReside uses GPS to log your state every day in the background. Get alerts before you hit thresholds. Generate audit-ready reports with one click.

Download on the App Store

Free trial. $34.99/year. No credit card required.