Non resident capital gains tax on US stocks — what do I actually owe?

I'm on an F-1 visa, have been in the US for about 14 months, and my OPT started this past January. My broker sent a 1099-B showing gains from selling some index fund shares I bought two years ago. I ran the substantial presence test and I think I'm still a nonresident alien for 2025 because of the student exemption. If that's right, I'm not sure what the non resident capital gains tax rules actually say for me — do I owe anything on those gains, do I file Form 8949 and Schedule D the usual way, or is there a totally different form? My broker just checked box D on the 1099-B and reported basis to the IRS. I haven't filed anything yet.

31 comments

Nonresident alien status changes everything here. If you're a nonresident alien, you generally don't pay US tax on capital gains that are not effectively connected with a US trade or business — that's the basic rule. Gains from selling publicly traded stocks on a US exchange typically fall outside ECI. So if your index funds were exchange-traded, that income may not be taxable in the US at all. You'd file Form 1040-NR, not the regular 1040. Schedule NEC inside that return is where non-ECI passive income goes. The 1099-B your broker sent is still relevant for your records, but the reporting path is different from what US citizens use.

Diego H.

Author

So the 1040-NR replaces the 1040 entirely for me? And the gains go on Schedule NEC rather than Schedule D? That's very different from what I expected. I'll look at the 1040-NR instructions.

Confirming the nonresident status first is the critical step. The student exemption can keep you out of the substantial presence count for up to 5 calendar years, but the exact year count matters and so does whether your school reported your status correctly. If you get the residency determination wrong and file a 1040 when you should file 1040-NR (or vice versa), the IRS can treat the return as invalid. Worth double-checking Publication 519 (US Tax Guide for Aliens) on irs.gov before you decide.

Diego H.

Author

I've been here since fall 2024 so I'm well within the 5-year exemption window for F-1. Pretty confident I'm nonresident for 2025. The question is what the gains actually trigger.

Even within the exemption window the counting still has to be done right, year by year. Some people make assumptions and get it wrong. Good habit to show the actual math.

The ECI distinction is what drives the whole answer. Capital gains from US-listed ETFs or mutual funds sold on an exchange are generally not ECI for a nonresident alien, so they're not subject to the regular capital gains rates you see on Schedule D. Schedule NEC on the 1040-NR has its own rate column — for most nonresident aliens it's a flat rate on certain income types, and capital gains from securities may fall at a 0% rate depending on the country of your tax treaty and whether the gains are from a US real property interest (FIRPTA doesn't apply to publicly traded ETFs at normal ownership levels).

Diego H.

Author

The FIRPTA angle hadn't even crossed my mind. These are broad market index ETFs, nothing real-estate-specific, so I think I'm clear on that. The 0% possibility is interesting — I'll check the 1040-NR instructions for the Schedule NEC rate table.

Had a nearly identical situation last year — nonresident on F-1, sold ETF shares, got a 1099-B. I uploaded my 1099-B and my visa documents to taxr.ai and had Taxr map out every line of the 1040-NR that my gains would touch, including whether Schedule NEC or Schedule D (Form 1040) applied and which columns to use. It flagged that my broker had checked the wrong box for a nonresident filer and laid out what the correct basis and proceeds entries should look like. I still had a tax preparer review the final return, but walking in with that mapped document made the appointment much shorter.

Diego H.

Author

That's exactly the kind of prep work I need. The box-checking issue on the 1099-B is something I wouldn't have caught on my own.

The broker checking the standard covered-security boxes for a nonresident makes sense from their side — they don't always know your residency status. The 1099-B is still the source document; the residency status is what changes how you use it on the return.

Worth separating two things people mix up: treaty benefits and the default nonresident rules. Even without a tax treaty your capital gains on publicly traded US securities are generally not taxable as a nonresident alien under the default Code rules. A treaty can sometimes add protections or change rates for other income types, but for plain stock and ETF gains the default is already favorable. Check the instructions for Schedule NEC inside the 1040-NR package — the IRS lays out the rate structure there.

One scenario that does flip the result: if you were actually a resident alien for any part of 2025 under the substantial presence test (say you miscounted the exemption years), those gains during the resident period would be taxable the normal way on Schedule D. Dual-status returns exist for years when you cross from one status to the other and they're complicated. If there's any doubt about your residency status for the full year, that's a situation where a CPA or enrolled agent who handles international tax is worth the cost.

Diego H.

Author

My F-1 start date was late 2024 so 2025 is only my second calendar year. The exemption period is clearly intact. But I'll keep the dual-status scenario in mind if I'm ever near the edge.

When I sold shares in my second year on an F-1 I uploaded my 1099-B, my visa timeline, and the Schedule NEC draft to Taxr and asked it to check whether each gain was correctly classified as non-ECI and whether the holding period (long vs short) still mattered for the Schedule NEC rate columns. It went line by line and flagged one lot I'd held under a year that needed to be listed separately. Really helped me hand a clean, organized set of documents to my preparer.

The holding period question on the 1040-NR is narrower than it looks — the Schedule NEC lists each sale with its dates, but it has no separate long-term and short-term lines, and taxable non-ECI gains get the same flat rate either way. Worth being precise with the dates rather than lumping everything.

FIRPTA is the main exception worth knowing even if it doesn't apply here. If a nonresident alien sells a US real property interest — which includes stock in a US Real Property Holding Corporation — the gain is ECI and taxable. Publicly traded REITs at normal ownership thresholds and broad market ETFs generally don't trigger it. The IRS digital assets page at irs.gov/businesses/small-businesses-self-employed/digital-assets also covers whether crypto gains follow the same nonresident rules, if that's ever relevant.

Practically speaking: you'll need an ITIN if you don't already have one, since you can't file a 1040-NR with just a Social Security number in all situations — actually if you have an SSN from your OPT authorization you can use that. But if you've never filed a US return before, the 1040-NR package and its instructions walk through what ID number to use. Don't skip the return just because you think the gains aren't taxable — the filing obligation can still exist even when the tax owed is zero.

Diego H.

Author

I do have an SSN from my OPT. Good point about filing even if the tax is zero — I hadn't thought about whether a filing obligation exists independent of a tax liability.

Filing even at zero gain or zero tax is smart for nonresidents. It starts the statute of limitations running, which protects you later if the IRS ever questions the return.

The 1099-B with box D checked (long-term, basis reported to the IRS) is still useful information even on a 1040-NR. It confirms the dates, proceeds and basis for each lot, though the holding period doesn't change how a non-ECI gain is treated on Schedule NEC. Keep it even though the form was designed for resident filers.

Something I learned the hard way: state taxes are a separate question. Some states tax nonresident aliens on US-source income regardless of the federal treatment. If your state has an income tax and you earned income there during OPT, check the state's nonresident rules independently. The federal 1040-NR result doesn't automatically carry over.

Diego H.

Author

I'm in a state with income tax so this matters. I hadn't separated the state question from the federal one at all. Definitely need to look at the state nonresident return separately.

State rules vary a lot. Some states conform to the federal nonresident alien treatment, others don't. The state department of revenue's instructions for nonresidents is the starting point, not the IRS pages.

To be clear on the Form 8949 question from your original post: nonresident aliens generally do not use Form 8949 or Schedule D for capital gains that are non-ECI. Those gains belong on Schedule NEC of the 1040-NR if they are taxable at all. If a gain were ECI (which yours probably isn't), it would go on Form 8949 and Schedule D (Form 1040), attached to the 1040-NR. The 1040-NR instructions spell out which schedule handles which type of capital gain.

Diego H.

Author

That clears up the Form 8949 question directly. I was trying to figure out how to fill it in and the answer is I probably don't use it at all.

For the actual holding period mechanics: Publication 550 at irs.gov/publications/p550 covers the rule that for securities traded on an established market the holding period starts the day after the trade date you bought and ends on the trade date you sold — not settlement date. That determines long vs short term even on the 1040-NR, so if you're near the one-year line on any lot it's worth checking the actual trade dates rather than relying on the broker's category.

If your gains are truly non-ECI and not from a US real property interest, the practical upshot is often that you owe zero federal tax on them and the 1040-NR shows that explicitly. The return is still worth filing to document the position. An enrolled agent who does international returns can review it quickly — it's not a complex return once the residency status is confirmed.

Agreed that an EA with international experience is the right professional here, not a general preparer who mostly does W-2 returns. The 1040-NR has enough quirks that it's worth the specificity.

One procedural note: the due date for the 1040-NR if you had wages subject to US withholding follows the same April calendar as the regular 1040. If you had no wages withheld, the due date shifts. The 1040-NR instructions and the IRS page for international taxpayers have the exact dates — worth checking so you don't miss it.

Pulling the thread back to the original question: non resident capital gains tax for an F-1 student selling US-listed ETFs is almost certainly zero at the federal level under the default rules, with the 1040-NR as the filing vehicle and Schedule NEC as the place the gains land (or don't land, if excluded). Confirm residency status, check for any FIRPTA-covered securities, check your state separately, and file even if the number is zero.

Diego H.

Author

This is the clearest summary of my actual situation. Confirm nonresident status, 1040-NR, Schedule NEC, check state, file anyway. That's my action list. Thank you all.