Why doesn't the US tax foreign investors' stock market capital gains?

Been going down a rabbit hole on this. I'm a US citizen helping a friend who is a nonresident alien understand their tax situation. They've been investing in US-listed stocks through a brokerage account here and made some decent gains this year. When I looked into it I saw something about foreign investors not owing US tax on stock market capital gains and I honestly can't figure out why that would be the case. My friend got a 1099 from the broker but it doesn't show capital gains withholding. Is this actually right, or is my friend going to owe something at filing time? They don't have any US-source wages or a business here, just the stock trades. What's the rule and where does it come from?

36 comments

The basic rule is that nonresident aliens are only taxed by the US on income that is "effectively connected" with a US trade or business, or on certain fixed and determinable US-source income like dividends and interest. Capital gains from selling stocks on a US exchange generally don't fall into either category for a nonresident who isn't spending substantial time in the US. So the gains are simply outside the reach of the US income tax system for most foreign investors.

Dana V.

Author

That makes sense. So the gains just aren't considered US-source taxable income for a nonresident?

Exactly. The stock being listed on a US exchange doesn't make the gain US-source the same way a US job or US rental property would.

There's a policy reason behind it too. If the US taxed foreign investors' capital gains it would push a lot of capital out of US markets. The exemption is basically a deliberate choice to keep US equity markets liquid and attractive to international money. Congress has had this structure in place for decades.

Yes, and it also avoids double taxation since the investor's home country usually taxes those gains anyway.

Worth knowing the actual statutory basis: the exemption for nonresident alien capital gains on US securities generally comes from the structure of how "US source" income is defined and what gets withheld under the tax code. I ran my friend's brokerage documents through taxr.ai last year when they were in a similar spot and it identified which 1099 boxes applied to nonresidents versus citizens and flagged that the capital gains lines weren't subject to NRA withholding. Really helped clarify what actually needed to be reported. IRS Publication 519 (U.S. Tax Guide for Aliens) also covers the sourcing rules for nonresidents and is worth reading alongside Publication 550.

Dana V.

Author

That's really useful. So the 1099 boxes for dividends and interest are different from the capital gains treatment for nonresidents?

Yes, dividends from US corporations are US-source income and are subject to withholding for nonresidents. The capital gains on stock sales generally are not, so you'll see those treated differently on the forms.

One thing to watch: this exemption applies to portfolio gains, meaning the nonresident isn't trading as a business and doesn't have an office or agent in the US managing the trades as part of a US trade or business. If the activity rises to that level, the gains can become effectively connected income and get taxed. For most individual foreign investors using a brokerage account that's not an issue, but it's worth knowing the line exists.

Dana V.

Author

My friend is just buying and holding ETFs and a few individual stocks, nothing that sounds like running a business.

Then they're almost certainly fine. The "effectively connected" threshold is not triggered by ordinary retail investing.

Also worth noting that dividends are treated completely differently. A nonresident gets a 30% withholding on US-source dividends unless a tax treaty reduces that rate. So your friend will likely see withholding on any dividends in their account even though the capital gains aren't touched. That 30% (or treaty rate) is usually the final tax, they don't file a 1040-NR just for that.

Dana V.

Author

That explains why the broker was withholding something but not on the gains specifically. I was confused why the numbers didn't match.

The nonresident has to file a 1040-NR if they have US-source income that requires it, but capital gains on US stock sales typically don't put them over that threshold. If the only US connection is stock market investing with no dividends or interest, there might not even be a filing requirement.

FIRPTA is the exception people sometimes trip over. If your friend were selling US real property interests, that gain absolutely would be taxed and withheld on. But that rule applies to real estate, not publicly traded stock. So FIRPTA doesn't come into play for ordinary brokerage account stock trades.

There is actually a FIRPTA exception for certain publicly traded REITs but that gets complicated fast. For plain stocks and ETFs it's not relevant.

Dana V.

Author

Good to know, they're not in any real estate investments so sounds like FIRPTA isn't something to worry about here.

The holding period rules work the same way on Form 8949 and Schedule D whether you're a citizen or not, but for a nonresident the resulting gain is just not taxable by the US for portfolio investments. So the broker reports it the same way on the 1099-B but the tax consequence is different.

My situation last year was similar, nonresident family member with a US brokerage account. I uploaded their 1099-B and the draft 1040-NR to Taxr and it went line by line and showed me which income lines mattered for nonresident purposes and which ones, including the capital gains entries, produced no US tax liability. Saved a lot of guessing. The IRS page on Publication 550 at https://www.irs.gov/publications/p550 has the holding period rules, and Publication 519 has the nonresident sourcing rules that back this up.

Dana V.

Author

Did they end up needing to file a 1040-NR at all?

No, the only US-source income was the dividends and withholding covered that. No filing required in the end.

Tax treaties can also modify the dividend withholding rate. A nonresident from a country that has an income tax treaty with the US might get a reduced withholding rate on dividends, sometimes significantly lower than 30%. The capital gains exemption usually exists in treaties too but it's largely redundant since the domestic law already provides it.

Right, some treaties also have a "savings clause" that the US uses to still tax its own citizens even when abroad, but that clause doesn't apply to nonresidents on portfolio gains.

Something I noticed when I went through this: the broker may still generate a Form 1099-B for the nonresident showing proceeds from stock sales. That doesn't mean the gains are taxable. The form is generated because the broker may not always distinguish between account holders, or they issue it for the client's own records. The tax treatment follows the person's status, not just the fact that a form was issued.

Dana V.

Author

That's exactly what confused me. The 1099-B showed all the sale proceeds and I assumed there was a tax bill attached to it.

I had a similar question when I was reviewing a family member's US brokerage statements alongside their treaty country documents. I gave Taxr the 1099-B and the 1040-NR instructions and it mapped out which lines on the 1040-NR were relevant for each type of income and confirmed the capital gains lines had no US tax effect for a nonresident with no effectively connected income. Really cut down the time I spent cross-referencing.

Dana V.

Author

Was there any income type that did create a US liability for them?

Yes, the ordinary dividends triggered withholding. That showed up on the 1040-NR. The capital gains did not.

To summarize the core answer: US tax law generally doesn't tax nonresident aliens on gains from selling stock on a US exchange because those gains are not considered US-source taxable income under the effectively connected income rules. The exemption is intentional, it keeps foreign capital in US markets. Dividends are different and do get withheld. FIRPTA is the carve-out for real property. That's the whole structure.

One nuance worth adding: if a nonresident spends enough time in the US to become a "resident alien" under the substantial presence test, all of this changes. At that point they're taxed like a US person on worldwide income including capital gains. So the exemption is only as durable as the person's nonresident status.

Dana V.

Author

My friend visits the US a few times a year but definitely doesn't meet substantial presence. Good reminder to keep an eye on that though.

Yes, it's worth counting the days each year. The substantial presence calculation is specific and uses a weighted formula across three years, not just the current one.

Publication 519 (US Tax Guide for Aliens) is the main IRS publication covering all of this for nonresidents. It goes through the effectively connected income rules, the fixed and determinable income withholding rules, and the filing thresholds for the 1040-NR. Worth pointing your friend to it or running their documents through it before they decide whether to file anything.

Dana V.

Author

Is that available on irs.gov?

Yes, search Publication 519 on the IRS site. It's the most direct reference for nonresident alien tax situations.

The bottom line for your friend: capital gains from selling US-listed stocks through a brokerage account are almost certainly not taxable by the US if they're a nonresident alien with no US trade or business. The 1099-B shows the proceeds but generates no US tax liability on the gains. Dividends are a separate matter and withholding likely already covered those.