Capital gains tax rate for foreign investors — what actually applies?

Trying to get clarity on the capital gains tax rate for foreign investors because I'm getting conflicting information everywhere. I'm a nonresident alien living abroad, I have a U.S. brokerage account holding some ETFs and individual stocks, and I sold positions this year with gains. My broker sent a 1099-B but I've also seen references to a 1042-S in some places. I don't know which form governs my situation, what rate actually applies, whether a tax treaty changes anything, and whether I even need to file a 1040-NR. I tried reading the IRS digital assets page and Publication 550 but neither of them spell out the nonresident rules clearly. What is the actual U.S. federal treatment of capital gains for someone in my position?

34 comments

The starting point for nonresident aliens is whether the gain is "effectively connected income" (ECI) or not. If the gain is NOT effectively connected with a U.S. trade or business, most capital gains realized by a nonresident alien are not subject to U.S. tax at all — provided you were not present in the United States for 183 days or more during the tax year. That 183-day rule for nonresidents is a separate test from the substantial presence test for residency. If you were in the U.S. 183 days or more in the tax year, your capital gains become taxable at a flat rate — check the Form 1040-NR instructions for the current year's rate on that line.

Wes G.

Author

I was not in the U.S. at all this year, so the 183-day threshold doesn't apply to me. Does that mean I owe nothing on the stock sales regardless of the gain amount?

Generally yes for portfolio gains on publicly traded securities — but confirm whether any position counts as a U.S. real property interest (FIRPTA rules), because that changes everything. ETFs that hold U.S. real property can trigger FIRPTA withholding even when other gains don't.

Form 1042-S versus 1099-B: your broker should be issuing a 1042-S if they know you're a nonresident and are withholding on certain income. The 1099-B is typically for U.S. persons. If your broker issued you a 1099-B it may mean they have you classified as a U.S. person, which could create complications. Worth verifying what W-8 form you have on file — W-8BEN is the standard certificate of foreign status for individuals.

Wes G.

Author

I never submitted a W-8BEN to this broker. Could that be why they sent a 1099-B instead of a 1042-S?

Almost certainly. Without a valid W-8BEN on file they may treat you as a U.S. person for withholding purposes. You'd want to submit one now and ask the broker whether they can correct the information reporting. It doesn't fix the past year automatically but it matters going forward.

Form W-8BEN is what ties your treaty claim to the account. I had almost this same situation last year — gains in a U.S. account, no treaty form on file, broker sending the wrong documents. I uploaded everything to taxr.ai and it read through my 1042-S, the 1099-B the broker had also issued, and the treaty article I thought applied, then listed exactly where the numbers conflicted and what I'd need to reconcile on the 1040-NR. That draft comparison saved me hours of going back and forth. The treaty benefit for capital gains varies by country — some treaties exempt portfolio gains entirely, others don't mention them. You need to check the specific article in your country's treaty with the U.S.

Wes G.

Author

Which IRS page has the actual treaty texts? I want to look up my country's article on capital gains.

The IRS maintains a full list of U.S. tax treaties with links to the treaty text and technical explanations at irs.gov — search "United States income tax treaties A to Z" and you'll find each country's PDF. Look for the article titled "Capital Gains" or sometimes "Alienation of Property."

One thing people miss: even if the gain itself isn't taxable, dividends paid by U.S. corporations to nonresidents usually are subject to withholding. The capital gains tax rate for foreign investors being potentially zero doesn't mean the whole account is tax-free. Dividends and interest income have their own withholding rules — often 30% absent a treaty, reduced by treaty.

Does the same 30% withholding apply to ETF distributions that include both dividends and return-of-capital amounts?

Return of capital is not taxed the same way — it reduces your basis rather than being treated as income. Only the dividend portion of the distribution would be subject to withholding. The broker should break this out on the 1042-S in separate boxes.

FIRPTA is the one everyone overlooks. If you sold shares in a U.S. real property holding company (USRPHC), the gain can be treated as ECI regardless of your days in the U.S. That can include many U.S. REITs and some ETFs. But for stock that is regularly traded on an established securities market, it only counts if you owned more than 5% of that class (more than 10% for publicly traded REIT stock). FIRPTA withholding on gross proceeds also doesn't apply when you sell regularly traded stock. Check whether any position you sold was flagged as a USRPHC and whether your stake crossed that threshold. The details are in the FIRPTA regulations.

Wes G.

Author

None of my positions were REITs. The ETFs were broad market equity funds. Would those still trigger FIRPTA?

Broad market equity ETFs generally don't qualify as USRPHCs because U.S. real property is not more than half their assets. You should be in the clear on FIRPTA for a standard total market or S&P 500 type fund.

Form 1040-NR filing requirement: even if no tax is owed, you may still have a filing requirement if you were engaged in a U.S. trade or business. Passive portfolio investing in a U.S. brokerage account doesn't by itself make you engaged in a U.S. trade or business under the general rule, so many nonresident investors with only non-ECI gains have no U.S. filing obligation at all. I had Taxr walk through my 1040-NR line by line when I was trying to figure out what to include after selling U.S. stock positions — it flagged that I had a withholding credit I could have claimed back and showed me where it went on the return. That refund claim alone made filing worth it even when I didn't strictly have to.

Wes G.

Author

How far back can a nonresident go to claim a refund of over-withheld amounts?

The standard refund claim period under section 6511 is generally three years from the date the return was filed (an early return counts as filed on the due date) or two years from payment, whichever is later. Withheld tax is treated as paid on the return's due date. The 1040-NR instructions and Publication 519 (the nonresident alien tax guide) both address this. I'd read those carefully for your specific situation.

Publication 519 is the main reference the IRS puts out specifically for nonresident aliens — it covers which income is U.S.-source, what is ECI, the 183-day rule for capital gains, and treaty interactions. It's not the same as Publication 550 which is written for U.S. persons. If you've been reading 550 and finding gaps, switching to 519 will answer most of the basic questions.

Wes G.

Author

Is Publication 519 updated for the current year? I want to make sure I'm reading current rules.

The IRS updates publications on a rolling basis — the cover page of any publication shows the tax year it covers. Always check the "products" section on irs.gov to confirm you have the latest version rather than a cached PDF.

Worth flagging: some nonresidents receive a Scholarship or Fellowship grant from U.S. sources and also have brokerage income. If that describes anyone here, those are reported differently on the 1040-NR and have their own withholding treatment. For pure stock gains the ECI / non-ECI analysis above is what governs.

State taxes are a separate question entirely. Some states tax nonresidents on income sourced to that state. If your brokerage is based in a state that taxes nonresidents on brokerage income (rare but it comes up), you might have a state filing obligation even when the federal obligation is zero. This thread is focused on federal but don't forget the state layer.

Wes G.

Author

My broker is based in a state with an income tax. Does the state's tax on nonresidents usually follow the federal ECI analysis or do states have their own tests?

States have their own sourcing rules and they don't always follow the federal ECI framework. Most states tax nonresidents only on income from sources within that state, and for portfolio gains on publicly traded securities most states do not assert nexus over a foreign investor just because the broker is located there — but you'd need to check the specific state's nonresident instructions. I went through something similar when I had gains in a U.S. account and wasn't sure about state exposure. I had Taxr read through the state's nonresident instructions alongside my federal position and it mapped where the state's sourcing rules diverged from the federal ones, which made it easy to see I had no state obligation in that case.

Schedule D and Form 8949 aren't only for U.S. persons. Nonresidents filing a 1040-NR report effectively connected capital gains on Schedule D and Form 8949 attached to the 1040-NR. Non-ECI gains that are taxable under the 183-day rule go on Schedule NEC at the flat or treaty rate instead. Which schedule you use, and the tax rates applied, depend on whether income is ECI or the flat rate applies. Sort out ECI versus non-ECI before you start mapping your situation onto the forms.

This is something that trips people up. ECI gains go on Schedule D and Form 8949 with the 1040-NR, while non-ECI income goes on Schedule NEC, and the instructions walk through which rate column applies to each non-ECI item. Read those column headings carefully before entering anything.

If there is any chance your gains are ECI — for example if you actively trade and someone could argue that rises to a U.S. trade or business — the analysis gets complicated fast. At that point the capital gains tax rate for foreign investors becomes the same progressive rate structure that applies to U.S. persons on ECI. An enrolled agent or CPA who specializes in international tax is worth the cost in that situation; the ECI line is not always obvious.

Wes G.

Author

How often does passive buy-and-hold investing cross into the "U.S. trade or business" territory for a foreign investor?

Rarely for a true buy-and-hold investor with no other U.S. business ties. The IRS and courts have generally not found that mere investing, even fairly active trading, rises to a U.S. trade or business without other facts. But if you're running a strategy with hundreds of trades, leverage, derivatives, that's where you'd want an international tax professional to review before assuming you're in the clear.

Treaty claims require a specific article in the treaty and usually a statement attached to the 1040-NR claiming the treaty position. If you claim a treaty benefit without attaching the required statement or Form 8833 where required, the IRS may disallow it. Form 8833 is required when you're taking a treaty-based return position that overrides a Code provision — check the Form 8833 instructions to see whether your situation requires it.

Wes G.

Author

Does the treaty claim on a 1040-NR require Form 8833 in every case or only when the treaty benefit is above a certain threshold?

The Form 8833 instructions list exceptions where the form is not required — small amounts of otherwise taxable income are one exception. Read those instructions directly; the threshold and the exceptions are spelled out there and they're more reliable than any summary.

To pull this together for the original question: capital gains tax rate for foreign investors on non-ECI portfolio gains is generally zero if you weren't in the U.S. 183 days or more, subject to FIRPTA exceptions. Get your W-8BEN on file, check your treaty, sort out whether you have any filing requirement (you might not), and if you over-withheld you can file a 1040-NR to claim it back. Publication 519 is your main reference.