Capital gains non resident alien — do I report this on a US return?

Trying to figure out where I stand. I'm on an F-1 visa, have been in the US about 3 years, and I sold some shares in a US-listed ETF this year. My broker sent a 1099-B showing a long-term gain. Someone told me nonresident aliens don't pay US tax on capital gains, but someone else said that only applies if you're not in the US long enough. I ran the substantial presence test on the IRS site and I think I'm still a nonresident alien for 2025 — students on F-1 are exempt from counting days for 5 years. But now I'm looking at the 1099-B and don't know if I report this on Form 1040-NR or just ignore it. What's the actual rule for capital gains non resident alien filers?

34 comments

The general rule: a nonresident alien is not taxed by the US on capital gains from the sale of stocks or securities unless you were present in the US for 183 days or more during the tax year AND the gains are US-source. If those two conditions are both met, there's a flat tax on those gains. If you're under 183 days of presence in the year, the gains are generally not subject to US tax and you don't report them on Form 1040-NR. That 183-day test here is different from the substantial presence test — it's a straight count of days present in the calendar year, not the weighted three-year formula.

Hannah V.

Author

Thank you, that distinction matters a lot. I'm under 183 days in 2025 by the straight count, so sounds like these gains aren't taxable for me.

Worth adding: the 183-day rule for NRA capital gains is in IRC section 871(a)(2). It applies to gains from US sources. Gains from selling stock are sourced by where the seller resides, not by where the company is incorporated, but for this rule an NRA whose tax home is in the US is treated as a US resident, so those gains are generally US-source. Gains on the sale of securities through a US broker where the NRA is not present 183+ days during the year are still exempt. Publication 519 (US Tax Guide for Aliens) covers this in detail — that's the pub you want, not 550, for NRA situations specifically.

Pub 519 is definitely the right one here. I looked it up last year in the same situation. The IRS page on US tax treaties also matters if your home country has a treaty that changes the outcome.

Hannah V.

Author

Okay will pull up Pub 519. My home country does have a tax treaty with the US so I should check that too.

I dealt with this same residency question last year — F-1, sold ETF shares, wasn't sure if the 1099-B meant I owed anything. I uploaded my 1099-B and my draft 1040-NR to taxr.ai and it went through each line, flagged where the capital gain entry would go on Schedule NEC versus Schedule D, and told me exactly which lines to leave blank because the gains weren't taxable under the 183-day rule. Saved me from filing a form I didn't need to file. The rule itself you have to verify, but having it mapped to the actual lines on the form helped a lot.

Hannah V.

Author

That's really useful — I didn't realize there were two different schedules on 1040-NR for this. Good to know before I start filling anything in.

One thing people get confused on: if you ARE taxed on capital gains as an NRA (the 183-day threshold is met), those gains go on Schedule NEC of Form 1040-NR, not Schedule D. Schedule D on 1040-NR is for income effectively connected with a US trade or business. Capital gains taxed under the flat rate for NRAs are not ECI — they go on Schedule NEC at the applicable flat rate. The instructions for Form 1040-NR lay this out.

Mixing up where the gain lands on the NR return is where most people go wrong. Schedule NEC vs Schedule D on the 1040-NR is not the same as how a resident would think about it.

Exactly. And if the gains are ECI for some reason — say you're a trader who qualifies as being in a US trade or business — that's a totally different analysis and you'd probably want a CPA who handles NRA returns.

Also worth flagging: even if you don't owe US tax on the capital gains, you may still have to file Form 1040-NR if you had other US-source income like wages, scholarship income, or interest from certain sources. The capital gain answer doesn't settle the filing requirement question by itself.

Hannah V.

Author

Good point — I do have US wages from my stipend so I'll be filing 1040-NR regardless. This is just about whether the ETF gain goes on it.

The treaty angle is real and can override the domestic rules. Some US tax treaties exempt NRAs from US tax on capital gains even if the 183-day threshold is met, or they shift the taxing right entirely to the home country. You look at the treaty article on capital gains — usually Article 13 in most treaties — and compare it to the domestic rule. The treaty benefit applies if it gives you a better result, and you claim it on Form 1040-NR by attaching a disclosure of the treaty position.

The treaty disclosure is Form 8833 if the position reduces your tax below what the Code would otherwise impose. Not always required for every treaty claim but worth knowing.

Right, Form 8833 is the one. You'd attach it to the 1040-NR and describe the treaty article and country.

Quick practical note on the 1099-B: your broker issued it because they're required to, not because the gain is necessarily taxable to you. Brokers don't screen for NRA status in the same way. The 1099-B shows what happened — the proceeds, the basis, whether it's short or long term. What you do with that information on your return (or whether it goes on your return at all) depends on the residency and 183-day analysis, not on what the broker reported.

Just double-checking my own understanding — if the gain is not taxable to an NRA and you're filing 1040-NR for other income, do you just not enter the capital gain anywhere on the return? Or is there a line where you show it and then back it out?

You generally just don't include it. There's no line on 1040-NR to report and then exclude a non-ECI, non-183-day capital gain the way you'd exclude home sale gain on a resident return. If it's not taxable, it's not on the return.

That makes sense, thanks. I was overthinking it.

Had a similar situation — NRA status, sold shares, wasn't sure how the 1099-B interacted with the 1040-NR. I gave Taxr my 1099-B and the draft 1040-NR side by side and it listed out what each box on the 1099-B corresponded to on the NR return, what didn't need to appear anywhere, and flagged that my holding period was short-term — which matters if the 183-day threshold had been met because the flat rate applies to net gains. Helped me see the whole picture before I sent anything.

Hannah V.

Author

Useful to hear — my holding period is long-term but it's good to know the short-term question is in play for people who are over the 183-day line.

For what it's worth, the 183-day count for NRA capital gains (IRC 871(a)(2)) counts days of physical presence in the US during the tax year — same calendar year as the sale. It's not the rolling three-year weighted formula from the substantial presence test. F-1 students exempt from counting days under the substantial presence test still count every day for this separate 183-day capital gains rule.

Hannah V.

Author

Wait, so even though my F-1 days don't count toward substantial presence, they DO count for the 183-day capital gains test? That changes my mental model a bit. I'm still under 183 actual days in 2025 so I should be fine, but that's a meaningful distinction.

Correct. The two tests use day counts for different purposes under different code sections. For substantial presence you exclude exempt days; for the capital gains 183-day rule you count actual physical days present in the year. Pub 519 explains both.

If you end up being classified as a resident alien instead — say you made a first-year choice or your status changes mid-year — the whole analysis shifts. Resident aliens are taxed the same as US citizens on worldwide income including capital gains. You'd use Form 8949 and Schedule D the same way a citizen would, and the 183-day NRA exemption no longer applies. Worth confirming your status before you file.

The dual-status year situation is worth raising too — if you changed from NRA to resident (or vice versa) during 2025, you'd file a dual-status return. Capital gains realized during the NRA portion of the year follow the NRA rules; gains during the resident portion follow the resident rules. I had Taxr go through my forms when I had a mid-year status change and it laid out which transactions fell in which period and drafted a summary showing which gains needed to go where on each part of the return. That kind of period-by-period sorting is tedious to do manually.

Hannah V.

Author

I don't think I have a dual-status year — I've been NRA the whole year — but good to know that framework exists if my situation ever changes.

Don't forget state taxes. Some states tax NRAs on income sourced within the state, and the state rules don't always mirror federal. If you lived in a state with an income tax and realized gains through a broker account, check whether your state considers you a resident or part-year resident. The federal NRA exemption doesn't automatically carry over to state.

This is a real gotcha. Some states also don't honor federal tax treaty positions, so even if the treaty covers federal, you may still owe state tax on the same gain.

To confirm on the 1099-B box issue: box 1e is cost basis, box 1d is proceeds, box 1g would show any wash sale loss disallowed. For NRA purposes you're mainly just using the 1099-B to know what happened — the gain amount and holding period. The box-by-box entries on Form 8949 are for resident filers. As an NRA whose gains aren't subject to US tax, you're not filling out Form 8949 for these transactions.

Tallying up what this thread has established: you're NRA, under 183 actual days in 2025, so the capital gain from the ETF sale is not subject to US tax. You still file 1040-NR for the wage income. The gain doesn't go on the return. If you had been over 183 days, the gain would go on Schedule NEC of the 1040-NR at the flat rate, not Schedule D. And if a tax treaty applies, you'd look at the relevant treaty article and potentially file Form 8833.

Hannah V.

Author

This is exactly the summary I needed. Checking treaty article 13 for my country and then filing 1040-NR with just the wage income. Thanks everyone.

One last thing that is easy to miss: if you have FDAP income — fixed, determinable, annual or periodical income like dividends — that's taxed differently from capital gains as an NRA. Dividends from US corporations are FDAP and are withheld at source, usually showing up on a 1042-S not a 1099. If that ETF paid dividends to you as an NRA, the broker may have handled withholding separately from the capital gain on the 1099-B. Check whether you got a 1042-S as well.

Hannah V.

Author

I do have a 1042-S for the dividend distributions — I forgot to mention that. So that gets reported on 1040-NR separately from the capital gain question entirely. Got it.