Skip to content

General education, not advice for your situation.

Carry Forward Learning Search the site

Topic hub

Capital Gains and the Wash-Sale Rule: A Clear Guide

How a sale is taxed: short-term or long-term, your basis, how losses net and carry forward, and how to stay clear of a wash sale.

Pick your situation

Pick your situation

In 60 seconds

  • Selling at a gain: hold more than 12 months and the gain is long-term, taxed at 0%, 15% or 20%. Hold less and it's taxed like wages.
  • Selling at a loss: losses net against gains first, then up to $3,000 a year comes off other income. The rest carries forward with no end date.
  • Wash sale: buy the same thing within 30 days before or after a loss sale, in any of your accounts or your IRA (and, the IRS says, your spouse's), and the loss is postponed. In an IRA it's lost.
2 more points
  • Basis depends on how you got it: cost if bought, the giver's basis if given, date-of-death value if inherited. The broker's basis can be blank or wrong.
  • You report on Form 8949 and Schedule D. Crypto is property and now has its own Form 1099-DA.
Learn it9Numbers · Basics · Pictures · Steps · Examples · Mistakes

Key numbers

Capital loss you can deduct per year
$3,000Against other income, beyond your gains; half that if married filing separately. The rest carries forward.26 U.S.C. sec. 1211(b)
Holding period for long-term, in months
12You need to hold it more than this. Counting starts the day after you acquire it.IRC 1222(3)Checked
Income up to which long-term gains pay no federal tax (single filer)
$49,450Taxable income up to this amount: 0% on long-term gain. Joint filers: $98,900.Rev. Proc. 2025-32 sec. 4.03
Income up to which long-term gains pay the middle rate (single filer)
$545,500Above it the top rate of 20% applies. Joint filers: $613,700.Rev. Proc. 2025-32 sec. 4.03
Days before and after a sale that can disallow your loss (wash-sale window)
30Before and after a loss sale, in all of your accounts and your IRA. The IRS says your spouse's purchases count too.IRC 1091(a)Checked
Income above which an extra tax on investment income applies (single filer)
$200,000Modified adjusted gross income over this; the tax is 3.8% of the smaller of the excess or your net investment income.IRS Net Investment Income Tax page; 26 U.S.C. sec. 1411(b)(3)Checked

Figures checked against the source unless a card says otherwise.

The short explainer

When you sell an investment, your gain or loss is what you received minus your basis, roughly what you paid. How long you held it sets the label: more than 12 months and it's long-term, taxed at 0%, 15% or 20% depending on your taxable income; 12 months or less and it's short-term, taxed like wages. Those two facts, holding period and basis, drive almost every question on this page.

Gains and losses net against each other: short-term with short-term, long-term with long-term, then the two results against each other. If you end up with a net loss, you can deduct up to $3,000 a year against other income (half that if married filing separately), and the rest carries forward with no end date.

The wash-sale rule postpones a loss when you buy the same or a substantially identical investment within 30 days before or after the sale. A purchase in your IRA counts, and the IRS says a purchase by your spouse counts too (that second point is less settled). The loss is added to the basis of the new shares, except in an IRA, where it simply disappears. Your broker only catches matches inside one account.

Basis depends on how you got the asset. A purchase uses cost; a gift keeps the giver's basis (with a lower value for losses); inherited property generally takes its value on the date of death. Crypto is property and follows the same rules, and Form 1099-DA now reports it: gross proceeds for sales on or after January 1, 2025, and basis for digital assets a broker acquired for you on or after January 1, 2026.

You report sales on Form 8949 and Schedule D. The Form 1099-B or Form 1099-DA basis is sometimes blank or wrong, and you fix it with a code B adjustment. A big gain can also trigger the 3.8% net investment income tax above $200,000 of modified adjusted gross income for a single filer. Selling a home, a like-kind exchange and stock pay each have their own hub.

As of Dec 1, 2026. Editorial review: Carry Forward Learning (AI-assisted) Oct 22, 2026.

The basics

What it is

A capital gain or loss is the result of selling or swapping a capital asset: stocks, bonds, funds, crypto, your home, a collectible. Gain is what you received minus your adjusted basis; loss is the reverse. Nothing is taxed until you sell, though dividends and interest are taxed as they are paid.

The holding-period question

Count from the day after you acquired the asset, including the day of the sale. More than 12 months is long-term and gets the lower rates; anything less is short-term and is taxed as ordinary income. Gifts, inheritances and wash sales have special rules for the count.

The basis question

Basis is your tax cost: what you paid plus the costs of buying, adjusted for things like splits and return of capital. For a gift or an inheritance the starting point is different. The Form 1099-B often shows the wrong basis or none, and the correction is yours to make.

The netting question

Short-term gains and losses net against each other, long-term against long-term, and then the two results offset each other. A net long-term gain gets the capital gains rates. A net loss is deductible up to $3,000 a year against other income, with the rest carried forward.

In pictures

This chart shows how gains and losses net into one result, and how that result is taxed.
Net within each pile first, then combine.
Describe this diagram

This chart shows how gains and losses net into one result, and how that result is taxed. Flow chart of how gains and losses net. Two piles: short-term (held a year or less) and long-term (held more than a year), each gains minus losses, combined into one result. Arrows are labelled if the result is a gain or if the result is a loss. A net gain: the long-term part is taxed at the capital gains rates (higher maximums apply to collectibles and some property gain) and any short-term gain is taxed at your regular income tax rates; the net investment income tax can also apply at higher incomes. A net loss: up to the yearly limit (half if married filing separately) comes off other income, the yearly amount comes out of short-term losses first, and the rest carries forward for the rest of your life, keeping its short-term or long-term character.

This timeline shows the wash-sale window of days before and after a loss sale.
The same number of days either side, in every account.
Describe this diagram

This timeline shows the wash-sale window of days before and after a loss sale. A timeline of the wash-sale window drawn on a day ruler with one tick per day: the loss sale in the middle, the same number of days before and after, and purchase dots inside and outside the window. A purchase of the same or a substantially identical investment inside the window, or an option to buy it, makes the loss a wash sale for as many shares as you bought back. It counts in any of your accounts at any firm, in your IRA or Roth IRA, and, on the IRS's view and the less settled point, in your spouse's account; a purchase outside the window does not count. In a taxable account the disallowed loss is added to the basis of the new shares and the holding period carries over. In an IRA the loss is not added anywhere. A footnote says the rule is written for stock and securities, shares of a crypto fund are covered, whether it reaches a coin held directly is not settled, and a bill to extend it has not passed.

Comparison of how basis and the holding period start, by how you got the asset.
Four ways to get an asset, four starting points for basis.
Describe this diagram

Comparison of how basis and the holding period start, by how you got the asset. Bought: cost plus the costs of buying. Given to you: the donor's basis, or the lower value at the date of the gift for a loss, with neither gain nor loss if you sell in between; part of any gift tax the donor paid is added, never above value. Inherited: value at the date of death, long-term in every case, with a line that inherited retirement accounts and income in respect of a decedent follow different rules. Crypto received as pay: its dollar value the day you received it. A note says the Form 1099-B can show wrong or no basis.

Step by step

  1. List every sale

    Gather your Forms 1099-B and 1099-DA, plus any sale that came without a form (private sales, older records, a wallet you control). The IRS has copies of the forms.

    Where it goes: Form 1099-B; Form 1099-DA

  2. Check the dates

    Use trade dates. Count from the day after you acquired the asset; more than 12 months is long-term. Gifts, inheritances and wash sales change the start date.

    Where it goes: Form 8949, columns (b) and (c)

  3. Check the basis, lot by lot

    Compare the basis on the form with your own records. A blank or low basis is common for older shares, shares from pay and crypto. Correct it with code B.

    Where it goes: Form 8949, columns (e) to (g)

  4. Look for wash sales across all accounts

    For each loss sale, check 30 days before and after in every account, including your IRA and your spouse's. Add what your broker could not see with code W.

    Where it goes: Form 8949, code W

  5. Fill in Form 8949 and Schedule D

    Use the box that matches each Form 1099-B or Form 1099-DA, then total each part onto Schedule D. Skip Form 8949 only for sales that fit Exception 1.

    Where it goes: Form 8949; Schedule D

  6. Carry forward and check the extra tax

    A net loss beyond $3,000 carries to next year: keep this year's Schedule D. If your income is high, check the 3.8% net investment income tax.

    Where it goes: Schedule D carryover worksheet; Form 8960

Worked examples

Mistakes and traps

Compare

Side by side has its own page, so this one stays quick to load.

Open side by side

Rules in depth

Quick recap

Quick recap has its own page, so this one stays quick to load.

Open quick recap

Do it7Walk me through · Timeline · Playbook · Checklist · Scenarios · Calculators

Walk me through it: what did you sell, and what do you do next?

Answer up to 3 quick questions and get the steps for your situation. Nothing is sent anywhere.

Step 1 of 3 What are you trying to sort out?

The tax on a sale turns on two things, how long you held it and your basis. This question points you to the part of the page that deals with your situation.

Step 2 of 3 What did you sell?

Stocks, funds and bonds go through the broker's Form 1099-B. Crypto has its own forms and its own lot-tracking rules. Business and rental property follow other rules.

Step 2 of 3 Which describes your loss?

A loss you can use depends on your gains, the yearly limit, and whether the loss is allowed at all (wash sales and personal-use property are not).

Step 2 of 3 How did you get it?

Basis and the holding period start from different places for a gift, an inheritance and a purchase.

Step 3 of 3 Did you sell any of it at a loss and buy the same thing again close to the sale, in any account including an IRA or your spouse's?

A purchase of the same or a substantially identical investment within 30 days before or after a loss sale is a wash sale. Your broker only sees matches inside one account.

Step 3 of 3 Where were the coins when you sold them?

A broker or platform that holds your coins sends a Form 1099-DA and applies its own lot method. Coins in a wallet you control are identified by your own records. Wallet-by-wallet tracking applies from January 1, 2025.

Timeline

Timeline has its own page, so this one stays quick to load.

Open timeline

The playbook, start to finish

The playbook, start to finish has its own page, so this one stays quick to load.

Open the playbook, start to finish

Do this next

  • List every sale for the year, including ones that came without a form: private sales, a wallet you control, an old account.
  • For each, find the dates and the basis in your own records. Count the holding period from the day after you acquired it; more than 12 months is long-term.
  • Selling at a loss? Check 30 days before and after for a purchase of the same thing in any account, your IRA and your spouse's.
  • Compare each Form 1099-B or Form 1099-DA with your records. Where the basis is blank or wrong, adjust it on Form 8949 with code B.
  • Add any wash sale loss your broker did not catch with code W.
  • Run Schedule D, and save the carryover worksheet if you have a loss beyond the limit.
  • Bought crypto? Record the units you sell at or before the sale, and keep dates, units and dollar values for every trade.
  • If your income is high, estimate modified adjusted gross income before a big sale for the net investment income tax.

Start to finish, with numbers

Start to finish, with numbers has its own page, so this one stays quick to load.

Open start to finish, with numbers

Calculators and workbooks

Try your numbers. No sign-up, nothing leaves your browser.

Open the Federal income tax estimator

  • Federal income tax estimator A planning estimate of your federal income tax, self-employment and other taxes, child credit and refund or balance due for the year.

Notices and key dates

Notices and key dates has its own page, so this one stays quick to load.

Open notices and key dates

Questions3Q&A · Quiz · Words

Questions and answers

72 questions, each answered in a few sentences with the authority behind it. Pick a group, or search.

The basics (5)

Read the 5 answers

Short-term, long-term and the holding period (4)

Read the 4 answers

Basis: purchases, gifts and inheritances (7)

Read the 7 answers

Rates and how a gain stacks (7)

Read the 7 answers

Netting gains and losses (3)

Read the 3 answers

Losses, the limit and the carryover (5)

Read the 5 answers

Forms: 1099-B, 8949 and Schedule D (7)

Read the 7 answers

The wash-sale rule (10)

Read the 10 answers

Crypto and digital assets (8)

Read the 8 answers

Related rules: NIIT, home sales and stock pay (5)

Read the 5 answers

Common questions from real situations (11)

Read the 11 answers

Test yourself

  • 15 questions, each with the answer and the rule behind it.

Take the quiz

Words used here

Words used here has its own page, so this one stays quick to load.

Open words used here

The law3The law · Authority · Forms

The law

The law, section by section has its own page, so this one stays quick to load.

Open the law, section by section

Authority stack

33 sources, ranked by weight: the Code first, then session laws and regulations, IRS guidance, cases, then publications and forms. The Code, session laws and regulations are here; the rest, with what each one says paragraph by paragraph, is on the full authority page.

IRS forms and publications

IRS forms and publications has its own page, so this one stays quick to load.

Open irs forms and publications

More2Read · Changes

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

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.

  • Capital gains: long term holding more than months
    IRC 1222(3) checked 2026-10-19, review by 2027-01-19
  • Digital assets: broker reporting start dates
    Treas. Reg. 1.6045-1(q) checked 2026-10-22, review by 2027-01-19
  • Digital assets: per wallet basis date
    Treas. Reg. 1.1012-1(j) checked 2026-10-22, review by 2027-01-19
  • Equity comp: wash sale window days
    IRC 1091(a) checked 2026-10-19, review by 2027-01-19
  • Capital gains: fifteen rate maximum taxable income, married filing jointly and surviving spouse
    Rev. Proc. 2025-32 sec. 4.03 checked 2026-09-24, review by 2027-01-22
  • Capital gains: fifteen rate maximum taxable income, single
    Rev. Proc. 2025-32 sec. 4.03 checked 2026-09-24, review by 2027-01-22
  • Capital gains: rates
    26 U.S.C. sec. 1(h) checked 2026-09-24, review by 2027-01-22
  • Capital gains: zero rate maximum taxable income, married filing jointly and surviving spouse
    Rev. Proc. 2025-32 sec. 4.03 checked 2026-09-24, review by 2027-01-22
  • Capital gains: zero rate maximum taxable income, single
    Rev. Proc. 2025-32 sec. 4.03 checked 2026-09-24, review by 2027-01-22
  • Itemized deductions: capital loss limit vs ordinary income
    26 U.S.C. sec. 1211(b) checked 2026-09-24, review by 2027-01-22
  • Payroll and SE tax: niit rate
    26 U.S.C. sec. 1411(a)(1) checked 2026-09-24, review by 2027-01-22
  • Payroll and SE tax: niit threshold MAGI, single and head of household
    IRS Net Investment Income Tax page; 26 U.S.C. sec. 1411(b)(3) checked 2026-10-12, review by 2027-02-09