Skip to content

General education, not advice for your situation.

Carry Forward Learning Search the site

Capital Gains and the Wash-Sale Rule

Capital gains and wash sales: related rules

Same facts. Pro adds the full authority stack under each answer.

Does the net investment income tax apply to my gain?

Possibly. It's an extra 3.8% tax on net investment income, which includes most capital gains, for people whose modified adjusted gross income is above $200,000 (single and head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). It applies to the smaller of your investment income or the amount you're over the line. It's figured on Form 8960.
Sources

Authority, strongest first

  1. Code I.R.C. § 1411
1411(a)(1) and (b); 1411(c)(1)(A)(iii) includes net gain attributable to the disposition of property other than property held in a trade or business that is neither passive nor a trading business. The hub on stock pay explains why wages are not net investment income but the later sale gain is.

What if I'm selling my home?

A home sale can qualify to exclude up to $250,000 of gain ($500,000 on a joint return) if you meet the ownership and use tests. That's a separate rulebook with its own hub on this site. Gain that isn't covered by the exclusion is a capital gain reported on Form 8949 and Schedule D like any other.
Sources

Authority, strongest first

  1. Code I.R.C. § 121
  2. Form instructions Instructions for Schedule D (Form 1040) (2025)
  3. Form instructions Instructions for Form 8949 (2025)
The Schedule D instructions (Sale of Your Home) say to report a home sale on Form 8949 if you cannot exclude all the gain or received a Form 1099-S. The exclusion rules (section 121) are covered in the home sale hub.

What about swapping one property for another?

A like-kind exchange of business or investment real property can defer the gain if it follows strict rules and deadlines. That's covered in its own hub. If you take cash or other property along with the swap, that part can be taxed now.
Sources

Authority, strongest first

  1. Code I.R.C. § 1031
  2. Code I.R.C. § 1001
1001(c) recognizes the whole gain 'except as otherwise provided'; section 1031 is such a provision for qualifying exchanges. The like-kind exchange hub covers the rules, the deadlines and the boot.

My shares came from an employer stock plan. What's different?

The income from a vest, a purchase discount or an exercise is taxed first as pay, and that pay becomes part of your basis. The capital gain or loss comes later, on the change in price. Brokers often report that basis wrong. The hub on stock pay and the hub on ESPPs and ISOs cover the details.
Sources

Authority, strongest first

  1. Code I.R.C. § 1012
  2. Form instructions Instructions for Form 1099-B (2026)
  3. Form instructions Instructions for Form 8949 (2025)
For stock compensation the basis includes the amount included in income; brokers cannot always add it, so the Form 1099-B basis can be too low, and the fix is Form 8949 with code B. The hubs on RSUs and equity compensation and on ESPPs, ISOs and the AMT cover the rules.

Are trades inside an IRA or Roth IRA taxed?

Not when you make them. Buying and selling inside an IRA doesn't create capital gains on your return. The tax comes (or doesn't, for a qualified Roth withdrawal) when you take money out. The one trap is the wash sale rule if your IRA buys what you sold at a loss. Our Roth hub covers the withdrawals.
Sources

Authority, strongest first

  1. Code I.R.C. § 1091
  2. Revenue ruling Rev. Rul. 2008-5, 2008-3 I.R.B. 271
Rev. Rul. 2008-5 notes that an IRA is generally exempt from tax under 408(e)(1) and that amounts distributed are taxed under 408 and 72, and 408A for Roth IRAs; the Roth hub covers distributions.

More questions

Where the numbers come from

Checked

Every figure above comes from the source listed here, with the date we checked it and the date it is due for a re-check.