For nonresident aliens earning income from investments or selling property in the United States, understanding capital gains tax obligations is crucial. U.S. tax law is complex, particularly when it involves cross-border transactions. If you are a nonresident selling real estate, trading U.S. stocks, or holding other capital assets, your tax exposure depends on several variables where the asset is located, how long you’ve been in the U.S., and whether tax treaties apply.
This guide explains the fundamental rules surrounding capital gains tax for nonresident aliens and outlines how different types of income are treated for tax purposes. It also explores thresholds, forms, and exceptions that can influence whether tax is due and how much.
What Is Capital Gains Tax?
Capital gains tax is applied to the profit earned from selling capital assets. In the United States, capital assets include investment property, real estate, stocks, bonds, mutual funds, cryptocurrency, and certain types of personal property. When you sell one of these assets for more than you paid for it, the profit is considered a capital gain. If you sell it for less, you may incur a capital loss.
Capital gains are categorized into two main types:
- Short-term capital gains: realized from the sale of assets held for one year or less
- Long-term capital gains: earned from assets held for more than one year
Long-term capital gains usually benefit from more favorable tax rates than short-term gains. However, for nonresidents, the distinction can be irrelevant in certain cases, as a flat tax rate may apply depending on the circumstances.
How the U.S. Treats Nonresident Aliens for Tax Purposes
A nonresident alien is someone who is neither a U.S. citizen nor a resident alien. You are classified as a nonresident for tax purposes if you do not pass the substantial presence test or hold a green card. This classification affects which income is taxable in the United States.
Generally, nonresident aliens are taxed only on income that is effectively connected with a U.S. trade or business or fixed, determinable, annual, or periodic income from U.S. sources. Capital gains are subject to taxation under specific rules based on your physical presence in the U.S., the source of the income, and your ties to the asset.
The 183-Day Substantial Presence Rule
One of the key determinants of whether a nonresident owes U.S. capital gains tax is the number of days spent in the country. If you are physically present in the U.S. for 183 days or more during a calendar year, you may be subject to a 30 percent flat tax on your net capital gains from U.S. sources.
This rule applies even if the income is not connected to a U.S. trade or business. The 183-day rule affects students, temporary workers, and tourists alike. Once that threshold is reached, capital gains earned from U.S. sources become taxable, even if you are still officially considered a nonresident for tax purposes.
On the other hand, if you are in the U.S. for fewer than 183 days during the tax year, capital gains from certain assets such as stocks and securities may not be taxed unless they are effectively connected with a U.S. trade or business or relate to real property.
U.S. Real Property and FIRPTA Requirements
A major exception to the general rule involves U.S. real estate. Under the Foreign Investment in Real Property Tax Act (FIRPTA), nonresident aliens are subject to U.S. tax on the gain from the sale or disposition of U.S. real property interests. This includes not only residential or commercial buildings but also shares in certain real property holding corporations.
When a nonresident sells real estate in the U.S., the buyer is generally required to withhold 15 percent of the gross sale price and send it to the Internal Revenue Service. This withholding acts as a prepayment toward the seller’s actual tax liability, which must be calculated and reported later through Form 1040NR.
If you believe that your tax liability will be less than the amount withheld, you can request a withholding certificate from the IRS to reduce the required payment. This process can take several weeks and should be initiated before the closing of the sale.
Investing in U.S. Stocks and Securities as a Nonresident
Nonresident aliens often invest in U.S. stocks and securities due to the size and global influence of U.S. financial markets. Fortunately, capital gains from the sale of stocks, mutual funds, and bonds by nonresident aliens are typically not subject to U.S. tax, provided the individual has not exceeded the 183-day presence threshold and the gain is not connected with a U.S. trade or business.
To ensure that tax is not incorrectly withheld, nonresidents must submit Form W-8BEN to the financial institution handling their investments. This form certifies foreign status and, when applicable, allows you to claim tax treaty benefits.
Failing to submit this form may result in backup withholding or misclassification as a U.S. resident for tax purposes, both of which could lead to unnecessary taxation or reporting requirements.
Tax Treaty Benefits and Capital Gains
The United States maintains tax treaties with more than 60 countries. These agreements are designed to prevent double taxation and may reduce or eliminate U.S. taxes on capital gains, depending on the type of income and the terms of the treaty.
Many treaties include provisions that exempt capital gains from U.S. taxation if the individual resides in the treaty country and meets specific criteria. For example, a resident of a treaty country who is not present in the U.S. for more than 183 days may be exempt from capital gains tax on U.S. stocks.
To take advantage of tax treaty benefits, you must identify the applicable treaty article and include the necessary disclosures with your tax return. Documentation such as a certificate of residence from your home country may also be required.
Interest Income vs. Capital Gains
While capital gains result from the sale of assets, interest income is considered a separate category and is typically treated as ordinary income for tax purposes. Most interest income earned by nonresident aliens from U.S. sources is subject to a flat 30 percent withholding tax, unless reduced by a treaty.
Common sources of interest income include bank accounts, bonds, and certificates of deposit. Although this type of income is passive, it is still taxable under U.S. law. It is important to distinguish interest income from capital gains when filing your return, as each is reported separately and taxed differently.
Are FICA and Medicare Taxes Applied to Capital Gains?
FICA taxes, which fund Social Security and Medicare, generally apply only to earned income. Capital gains are categorized as passive income and are not subject to these payroll taxes for nonresident aliens.
In most cases, nonresidents are exempt from paying FICA taxes altogether unless they become resident aliens or work in specific positions that require contributions. Similarly, Medicare taxes do not apply to capital gains earned by nonresident aliens. These exemptions, however, do not extend to all types of income, and exceptions exist for certain work or visa categories.
State-Level Capital Gains Tax Considerations
While federal tax law establishes the overarching rules, state income tax laws vary and can significantly influence your overall liability. Some states, such as California and New York, treat capital gains as ordinary income and tax them at the same rate. These states may tax nonresidents on gains from property or business conducted within their borders.
Other states, like Florida, Texas, and Washington, do not levy any state income tax, meaning capital gains are generally not taxed at the state level. Some states have specific rules that exempt nonresidents from capital gains tax altogether, especially when the income is not sourced from within the state. It is important to determine the location of the asset or business activity that generated the gain, as this will influence whether a state has the authority to tax you.
Forms Required for Capital Gains Reporting
Nonresident aliens must use Form 1040NR to report taxable U.S.-source capital gains. If withholding has occurred due to the sale of U.S. real property, the buyer or settlement agent will issue Form 8288-A to the IRS and the seller.
Form 1042-S is used when U.S. income has been subject to withholding, including certain types of capital gains or real estate income. This form includes specific income codes to identify the nature of the gain:
- Code 24: Capital gains
- Code 25: Real property gains under FIRPTA
- Code 26: Other gains subject to withholding
Properly classifying and reporting income using the correct codes is essential for compliance. Inaccurate reporting can result in delays, penalties, or audits. Keeping records of all transactions, including acquisition and sale prices, dates, and documentation, can help support your filings.
Additional Factors That Affect Tax Liability
Aside from federal rules and state laws, several other factors may influence how your capital gains are taxed in the U.S.
- Currency exchange differences: Gains must be calculated in U.S. dollars. Currency fluctuations between the time of purchase and sale may affect your taxable amount and potentially trigger tax obligations in your home country.
- Entity structure: If you earn capital gains through a U.S. partnership, LLC, or other pass-through entity, you may be considered to have effectively connected income, even if you do not meet the substantial presence test.
- Inherited or gifted property: The tax basis and holding period of inherited or gifted assets may differ from those acquired by purchase, which could impact your gain calculation.
These nuances emphasize the importance of understanding the full scope of your financial situation and the nature of each transaction.
How Capital Gains Are Calculated
Capital gains are calculated by subtracting the adjusted basis of the asset from the amount you received from its sale. The adjusted basis is usually the original purchase price, plus any costs incurred to acquire, improve, or sell the asset.
For example, if a nonresident purchases U.S. real estate for $300,000 and later sells it for $450,000, the capital gain is $150,000, assuming there are no adjustments. However, improvements made to the property and certain transaction costs may reduce the amount of taxable gain. Capital losses, if realized, can offset capital gains. In most cases, only U.S.-source capital gains and losses should be included on a nonresident’s U.S. tax return.
Determining Whether the Gain Is U.S.-Sourced
For nonresident aliens, only income sourced in the United States is generally subject to U.S. tax. Determining the source of capital gain depends on the type of asset:
- Gains from the sale of real property located in the U.S. are U.S.-sourced
- Gains from stocks and securities generally are not considered U.S.-sourced for nonresidents, unless they are effectively connected with a U.S. trade or business or the seller meets the substantial presence test
- Gains from tangible personal property located in the U.S. are usually U.S.-sourced
- Cryptocurrency gains depend on how and where the transaction is executed and whether the income is connected to a U.S. trade or business
The source of income is crucial because only U.S.-sourced capital gains are potentially taxable for nonresident aliens under most scenarios.
When Is a Gain Effectively Connected with a U.S. Trade or Business?
If a capital gain is effectively connected with a U.S. trade or business, it becomes taxable even if the nonresident alien does not meet the substantial presence test. This often happens when the gain is derived from property or business operations actively managed from within the U.S.
For example, if you run a business in the U.S. and sell an asset used in that business, the gain is likely considered effectively connected income. Such income must be reported on Form 1040NR and is taxed at graduated rates rather than the flat 30 percent applied to non-effectively connected income. Real estate gains are also usually treated as effectively connected income under FIRPTA regulations, and the sale may trigger automatic withholding.
Overview of Key Tax Forms for Reporting Capital Gains
Nonresident aliens must use specific IRS forms to report capital gains and comply with withholding requirements. Here are the most commonly required forms and their purposes:
Form 1040NR
Form 1040NR is the nonresident tax return used to report all U.S.-source income, including capital gains. You will use Schedule NEC (for non-effectively connected income) to report gains taxed at flat rates, and Schedule D if your gains are effectively connected and subject to graduated tax rates.
Schedule D should also be used when reporting gains or losses on capital assets held for more than one year, while Schedule NEC is used for items subject to fixed statutory rates, such as the 30 percent flat rate on certain gains.
Form 1042-S
This form is used to report income paid to nonresidents that was subject to withholding. If your capital gain was subject to withholding—such as through the sale of real estate under FIRPTA—you will receive Form 1042-S from the withholding agent. This form shows the gross income, the tax withheld, and the applicable income code.
Income codes on Form 1042-S that relate to capital gains include:
- Code 24: Capital gains from the sale of personal property
- Code 25: Gains from the disposition of U.S. real property interests
- Code 26: Other gains subject to withholding
Retain this form as supporting documentation and include it when filing your Form 1040NR.
Form 8288 and Form 8288-A
These forms are associated with FIRPTA withholding when U.S. real estate is sold. The buyer of the property (or the buyer’s agent) must withhold 15 percent of the gross sales price and submit Form 8288 to the IRS, along with Form 8288-A for each seller.
If you are the seller, the IRS will send you a stamped copy of Form 8288-A to confirm the withholding. You should include this stamped form with your 1040NR to claim credit for the amount withheld.
Form W-8BEN
This form is used to certify your foreign status and, if applicable, claim benefits under a tax treaty. Submitting this form to your financial institution prevents incorrect backup withholding and ensures that treaty rates are applied to capital gains or interest income where appropriate.
Applying the Correct Tax Rates
Capital gains are taxed differently depending on whether they are effectively connected with a U.S. trade or business and how long the asset was held.
- For non-effectively connected gains: A flat rate of 30 percent applies if the nonresident alien is present in the U.S. for 183 days or more. If not, and the gain is not from real property or another taxable source, no tax may apply.
- For effectively connected gains: These are taxed at the same graduated tax rates as those for U.S. residents. Long-term capital gains (held over one year) may be taxed at preferential rates, typically 0, 15, or 20 percent depending on income.
Gains from U.S. real estate are treated as effectively connected income and therefore taxed at graduated rates. However, the 15 percent FIRPTA withholding is applied as an advance against that tax liability.
Keeping Proper Documentation
Accurate records are crucial when reporting capital gains. You should maintain documentation that supports both the acquisition and disposition of the asset, including:
- Purchase agreement or settlement statement
- Proof of payment and purchase price
- Documentation of improvement costs
- Broker transaction records
- Sale agreement and closing statement
- FIRPTA withholding statements (if applicable)
In case of an audit, having detailed and well-organized records will help you substantiate your gains and cost basis.
Real Property Gains and Early FIRPTA Refunds
If you believe the 15 percent FIRPTA withholding exceeds your actual tax liability, you may apply for a withholding certificate from the IRS using Form 8288-B. This application can request a reduced withholding rate or even full exemption from withholding if you can show that no tax is ultimately due.
It’s important to apply for this certificate before the transaction closes. The IRS takes several weeks to process the request, and without the certificate, full withholding is mandatory. If withholding has already occurred and you are due a refund, you must file a 1040NR to claim it. Include all FIRPTA-related documents to expedite the refund process.
Special Considerations for Cryptocurrency
Cryptocurrency trading by nonresidents may or may not be subject to U.S. tax, depending on whether the activity is conducted through a U.S. exchange or is connected to a U.S. trade or business.
In most cases, the IRS treats cryptocurrency as property, so gains from selling it are subject to capital gains rules. If you hold crypto for investment purposes and conduct transactions outside the U.S., those gains may not be taxable under U.S. law.
However, using a U.S.-based exchange or operating a crypto-related business from within the U.S. may subject the gains to U.S. taxation. It’s critical to determine the status of the asset and the source of the income before excluding it from your tax return.
Tax Implications for Foreign Partnerships and Trusts
If you earn capital gains through a foreign partnership, trust, or estate with U.S. investments, you may be allocated a share of capital gains that must be reported on your 1040NR. U.S. tax law requires that pass-through entities with U.S. source income report those allocations to foreign partners or beneficiaries.
The partnership or trust will usually issue a Schedule K-1 or a similar statement detailing the income allocated to each participant. Depending on how the entity is structured, the capital gain may be considered effectively connected income, making it taxable to you as a nonresident. Failing to report this income may trigger penalties or denial of treaty benefits in future years, especially if the IRS identifies the gain through matching programs.
Treaty Benefits and Disclosure Requirements
Claiming a reduced tax rate or exemption under a tax treaty requires correct documentation and disclosure. You must reference the specific article of the treaty under which you’re claiming benefits and include this information in your 1040NR.
In some cases, you may need to provide a certificate of residence issued by your home country’s tax authority to prove eligibility. Treaties vary in scope and conditions, so it’s essential to read the provisions carefully and apply only if you meet all the requirements. Tax treaty positions should also be disclosed on Form 8833 in certain cases, particularly if the treaty benefit overrides U.S. tax rules or if disclosure is required by the treaty itself.
Reporting Capital Gains as a Nonresident Alien
If you’re a nonresident who earned U.S.-sourced capital gains subject to taxation, those must be reported to the Internal Revenue Service. Nonresident aliens are required to file Form 1040-NR to report U.S. income, including capital gains.
Unlike U.S. citizens or residents, nonresidents do not use Form 1040. Instead, they complete Form 1040-NR, which is specifically designed for those with limited U.S. connections. If you had U.S.-source capital gains and meet the filing thresholds, you must report those on Schedule NEC (Non-Effectively Connected Income) or Schedule D, depending on how the gains were generated and whether they are connected to a U.S. business or trade.
When to Use Schedule NEC vs. Schedule D
Schedule NEC is used when your capital gains are not effectively connected with a U.S. trade or business and are taxed at a flat 30% rate, or a lower rate if a tax treaty applies. This typically includes gains from real estate or securities by nonresidents who don’t meet the substantial presence test.
Schedule D is appropriate when the gain is effectively connected with a U.S. trade or business, such as capital gains earned through a U.S.-based brokerage account actively managed by you or an agent. Gains reported on Schedule D may be subject to progressive tax rates rather than flat withholding.
Forms You May Need to File
- Form 1040-NR: Nonresident Alien Income Tax Return
- Schedule NEC: For flat-taxed capital gains
- Schedule D: For effectively connected gains
- Form 8949: Used to detail capital gain or loss transactions
- Form W-8BEN: Must be provided to withholding agents to claim treaty benefits and exempt status
- Form 1042-S: Received when taxes are withheld at the source by a U.S. institution or entity
Filing requirements differ depending on your type of investment, source of income, and duration of stay in the U.S. Keeping accurate documentation for each transaction, such as the purchase price, sale proceeds, and associated costs, is critical for substantiating your tax return.
FIRPTA: Foreign Investment in U.S. Real Property
If you are a nonresident who has sold real estate located in the U.S., the Foreign Investment in Real Property Tax Act, or FIRPTA, will likely apply to your transaction. FIRPTA is a federal law that imposes a withholding requirement on the buyer of U.S. property sold by a foreign person.
What FIRPTA Requires
Under FIRPTA, the buyer or transferee must withhold 15% of the gross sales price when a nonresident alien sells U.S. real estate. This is not a tax itself, but a prepayment toward any tax liability you may owe on the capital gain. This amount is reported on Form 8288 and Form 8288-A, which are submitted to the IRS.
You will also receive a copy of Form 1042-S from the withholding agent showing the amount withheld. The IRS requires you to file a U.S. tax return (Form 1040-NR) for the year of the sale to reconcile the withheld amount with the actual tax due.
How to Reduce or Avoid FIRPTA Withholding
You can apply for a withholding certificate from the IRS to reduce or eliminate the 15% withholding if you expect to owe less tax than the amount withheld. This is done by submitting Form 8288-B. The IRS will review your application and may approve a lower withholding rate based on the anticipated capital gain.
However, the application must be submitted before or at the time of the sale. Processing delays can result in withholding occurring anyway, so this option is best pursued well in advance of the transaction.
Understanding Form 1042-S and Income Codes for Capital Gains
If you are a nonresident who has had U.S.-source capital gains withheld by a financial institution or buyer (in the case of real estate), the IRS will require the payer to issue a Form 1042-S. This document reports the income paid to a nonresident and the tax withheld.
There are specific income codes to identify the type of capital gain:
- Code 24: Capital gains from securities or similar investments
- Code 25: Gains from U.S. real property interests
- Code 26: Other gains subject to tax withholding
This form will also show the amount withheld, your country of residence, and the type of income. You’ll use this information to complete your Form 1040-NR and determine whether you’re due a refund or owe additional taxes. Always verify the accuracy of the Form 1042-S before using it to file your return. Mistakes in the income code or amount can delay your refund or lead to compliance issues.
Tax Treaties and Reduced Withholding on Gains
Tax treaties can significantly impact how much tax you owe on capital gains and whether withholding is required. Over 60 countries have tax treaties with the U.S., and many of them exempt capital gains from U.S. tax if specific conditions are met. To benefit from a treaty provision, you must file Form W-8BEN with your financial institution, brokerage, or withholding agent. This certifies your foreign residency and treaty eligibility.
Each treaty is different. Some exempt all capital gains for nonresidents who do not maintain a U.S. permanent establishment. Others may offer a reduced rate only for specific types of property. Refer to the IRS’s publication of U.S. income tax treaties to confirm your country’s treatment.
Treatment of Capital Gains by U.S. States
Even if you’re exempt from federal capital gains tax, individual states may have separate tax rules. Unlike federal law, many states do not recognize foreign treaties, and some states tax nonresidents on income sourced to that state.
Common State Policies on Capital Gains for Nonresidents
- California: Treats capital gains as ordinary income and applies state tax to nonresidents who sell property or generate gains from California-sourced investments.
- New York: Also taxes capital gains earned from New York sources, including real estate or businesses located within the state.
- Florida and Texas: Do not impose a state income tax, so there is no state capital gains tax either.
- Pennsylvania: Applies a flat tax rate of 3.07% on both income and capital gains but generally does not tax nonresidents unless they have a Pennsylvania source connection.
If you sell real estate located in a state with an income tax, you may be required to file a state return in addition to the federal return. Each state has its own definitions of source income, filing thresholds, and treatment of capital gains.
Withholding on State-Level Sales
Some states also impose withholding on real estate sales by nonresidents, similar to FIRPTA at the federal level. For instance, California requires withholding of 3.33% of the sale price or the actual capital gain, whichever is higher. These withheld amounts are credited toward the nonresident’s final tax due on the state return.
Importance of Recordkeeping for Capital Gains
Good documentation is essential for reporting capital gains correctly. The IRS requires detailed reporting of cost basis, acquisition and sale dates, and transaction expenses when calculating your gain or loss.
Key documents to keep include:
- Closing statements for real estate transactions
- Purchase and sale confirmations for stocks or other investments
- Records of fees paid, such as brokerage or legal fees
- Copies of Form 1042-S and Form 8288-A, if withholding was applied
These records will not only help with preparing your tax return but will also serve as proof in the event of an audit or if you need to amend a past return.
What If You Fail to Report Your Capital Gains?
Failure to report capital gains as a nonresident can lead to serious consequences. The IRS may assess penalties for underpayment, late filing, or failure to report foreign status correctly. Additionally, refunds of any withheld tax will be denied if you do not file Form 1040-NR.
If you failed to submit a tax return in a prior year for a reportable gain, you should consider filing a delinquent return as soon as possible. The IRS does not automatically refund FIRPTA or other withholding unless you request it by filing the appropriate tax return. Interest and penalties may accrue until you file.
When You May Not Owe U.S. Capital Gains Tax
In many cases, nonresidents do not owe capital gains tax if they:
- Were present in the U.S. for fewer than 183 days in the year of the sale
- Earned gains from U.S. stocks and are exempt under treaty provisions
- Sold investments not considered U.S.-sourced under IRS definitions
- Held the investment through a foreign entity or fund with no U.S. trade or business connection
However, real estate remains an exception to most of these rules due to FIRPTA. Even short-term presence in the U.S. does not remove the obligation to withhold and file when real property is sold.
Conclusion
Understanding the U.S. capital gains tax system as a nonresident is essential to ensure compliance and avoid unexpected tax liabilities. While many nonresidents may not be subject to capital gains tax, especially when investing from abroad, the situation becomes more complex when real property, prolonged U.S. presence, or business involvement is involved.
For nonresidents investing in U.S. stocks or securities, tax obligations are often minimal, particularly if they stay outside the country and file proper documentation like Form W-8BEN. However, the sale of U.S. real estate is subject to strict rules under FIRPTA, requiring withholding and IRS reporting, even when the gain might ultimately be exempt or taxed at a favorable rate. State-level taxation further adds complexity, varying by jurisdiction and the source of the income.
It’s also crucial to distinguish capital gains from other forms of income such as interest or dividends, which are subject to different taxation rules. Moreover, tax treaties between the U.S. and other countries can offer significant relief if claimed properly, but only when the taxpayer has a clear understanding of their residency status and treaty eligibility.
Given the intricate nature of U.S. tax law and the potential for both federal and state-level obligations, nonresidents dealing with capital gains should maintain accurate records and remain proactive about compliance. When necessary, seeking assistance from professionals experienced in nonresident taxation can help navigate the requirements efficiently and legally, minimizing tax exposure while avoiding penalties.
Ultimately, whether or not you owe capital gains tax in the U.S. as a nonresident depends on various factors, your physical presence, the nature of your investments, treaty eligibility, and state law. Taking a careful, informed approach is the key to managing your U.S. capital gains responsibly.