Substantial presence test calculator
Are you a tax resident or a nonresident alien? Enter the days you were in the U.S. in the last three years. We apply the IRS substantial presence test, including the rules that let F-1, J-1, M-1 and Q students, teachers and trainees leave out their exempt days.
An estimate, not tax advice. This covers the substantial presence test only. Your tax status can also depend on a green card, a tax treaty, your first and last year in the U.S. and other rules. Confirm with a qualified tax professional or the IRS before you file. This is general information, not legal or tax advice.
How the test works
- Two parts, both required. You must be in the U.S. at least 31 days in the tax year, and your weighted total must be at least 183: all your days this year, plus one third of your days last year, plus one sixth of your days the year before.
- Example from the IRS. 120 days in each of 2023, 2024 and 2025 gives 120 + 40 + 20 = 180 for 2025. That is under 183, so no resident status from this test.
- Exempt individual days do not count. This covers students (F, J, M, Q visas), teachers and trainees (J, Q), and some others. Students are exempt for up to 5 calendar years. Teachers and trainees lose the exemption if they were exempt in 2 of the 6 years before.
- Other days that do not count. Commuting from Canada or Mexico, transit of under 24 hours between two places outside the U.S., foreign vessel crew, and a medical condition that prevented you leaving.
- Closer connection. If you pass the test but were in the U.S. fewer than 183 days this year, you may still be treated as a nonresident if you keep a tax home and closer connection to a foreign country (Form 8840).
- Which return. A resident alien generally files Form 1040. A nonresident alien generally files Form 1040-NR. Exempt individuals file Form 8843 with their return, or alone if they have no return to file.
- H-1B and OPT. H-1B workers have no exempt status, so every day counts. F-1 students on OPT are still students, so the 5-year limit applies to them.
Privacy: Everything is worked out in your browser. The numbers you enter are not sent to us or stored.
Need help organizing your documents?
One Path Finder can help you gather and organize documents where permitted by law. We are not a law firm or a tax preparer and can’t tell you what applies to your case. Contact us to start a conversation. For legal advice, ask us for a referral to our partner law firm.