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
I sold at a gain and want to know the taxShort or long term, the rates and the extra tax on large gains
I have a loss and want to know how much I can useNetting, the yearly limit and the carryover
- How do my gains and losses net against each other?
- How much of a capital loss can I deduct?
- What happens to the part of the loss I can't use?
- We filed jointly in the past and file separately now. Whose carryover is it?
- What if a stock becomes worthless?
- Can I deduct a loss on something I used personally?
I sold at a loss and bought it back, or my IRA or spouse didThe window, what counts and where the loss goes
I have a Form 1099-B or 1099-DA and need to fill in Form 8949The boxes, the codes and what Schedule D does
I sold or traded cryptoBasis, which units you sold and the new Form 1099-DA
I'm selling something I was given or inherited, or my homeGift and inherited basis, and where the home sale goes
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
The holding-period question
The basis question
The netting question
In pictures
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.
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.
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
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
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)
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)
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
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
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
- The same gain, one day apart
- Four piles, one result
- A big loss, spread over years
- A gain that starts in the zero-rate band
- Selling at a loss, then buying some back
- The IRA that bought the same stock
- Her account bought what his account sold
- Shares from an estate
- A gift with two bases
- Which coins did I sell?
- A large gain and the net investment income tax
Mistakes and traps
- Forgetting the IRA and your spouse in the wash-sale window
- Trusting a blank or low basis on the Form 1099-B
- Misreading the one-year line
- Forgetting the loss carryover
- Using the donor's basis for a loss on a gift
- Using the decedent's cost for inherited property
- Not reporting crypto because no form arrived
- Not identifying which crypto units you sold
- Assuming a loss on personal-use property is deductible
- Missing the net investment income tax in a big sale year
Compare
Side by side has its own page, so this one stays quick to load.
Rules in depth
Quick recap
Quick recap has its own page, so this one stays quick to load.
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.
Timeline
Timeline has its own page, so this one stays quick to load.
The playbook, start to finish
The playbook, start to finish has its own page, so this one stays quick to load.
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.
Calculators and workbooks
Try your numbers. No sign-up, nothing leaves your browser.
- 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.
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)
Short-term, long-term and the holding period (4)
Basis: purchases, gifts and inheritances (7)
Rates and how a gain stacks (7)
Netting gains and losses (3)
Losses, the limit and the carryover (5)
Forms: 1099-B, 8949 and Schedule D (7)
The wash-sale rule (10)
Crypto and digital assets (8)
Related rules: NIIT, home sales and stock pay (5)
Common questions from real situations (11)
Test yourself
- 15 questions, each with the answer and the rule behind it.
Words used here
Words used here has its own page, so this one stays quick to load.
The law3The law · Authority · Forms
The law
The law, section by section has its own page, so this one stays quick to load.
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.
- Code I.R.C. § 1 Tax rates, including the maximum capital gains rate in 1(h)
- Code I.R.C. § 1001 Determination of amount of and recognition of gain or loss
- Code I.R.C. § 1012 Basis of property: cost
- Code I.R.C. § 1014 Basis of property acquired from a decedent
- Code I.R.C. § 1015 Basis of property acquired by gifts
- Code I.R.C. § 1031 Exchange of real property held for productive use or investment
- Code I.R.C. § 1091 Loss from wash sales of stock or securities
- Code I.R.C. § 121 Exclusion of gain from sale of principal residence
- Code I.R.C. § 1211 Limitation on capital losses
- Code I.R.C. § 1212 Capital loss carrybacks and carryovers
- Code I.R.C. § 1221 Capital asset defined
- Code I.R.C. § 1222 Short-term and long-term capital gains and losses, and the netting terms
- Code I.R.C. § 1223 Holding period of property
- Code I.R.C. § 1411 Net investment income tax
- Code I.R.C. § 165 Losses
- Code I.R.C. § 6045 Returns of brokers
- Final regulation Treas. Reg. § 1.1012-1 Basis of property: identifying what you sold, average basis, and digital assets
- Final regulation Treas. Reg. § 1.1091-1 Losses from wash sales of stock or securities
- Final regulation Treas. Reg. § 1.1211-1(b) Limitation on capital losses of taxpayers other than corporations
- Final regulation Treas. Reg. § 1.1223-1(d) Holding period of replacement shares after a wash sale
- Final regulation Treas. Reg. § 1.6045-1 Broker reporting, including digital assets and wash sales
IRS forms and publications
IRS forms and publications has its own page, so this one stays quick to load.
More2Read · Changes
Read more
Articles
- What is basis, and how does a wash sale change it?
- Selling your home: how the home-sale exclusion works
- Year-End Tax Checklist 2026: Train or Mailbox?
- A tax credit vs. a deduction: which is worth more?
- The kiddie tax in 2026: when a child's investment income is taxed at your rate
- Your pay stub: the one line that is income tax
What changed in the law
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 monthsIRC 1222(3) checked 2026-10-19, review by 2027-01-19
cf-2026:capital_gains.long_term_holding_more_than_months - Digital assets: broker reporting start datesTreas. Reg. 1.6045-1(q) checked 2026-10-22, review by 2027-01-19
cf-2026:digital_assets.broker_reporting_start_dates - Digital assets: per wallet basis dateTreas. Reg. 1.1012-1(j) checked 2026-10-22, review by 2027-01-19
cf-2026:digital_assets.per_wallet_basis_date - Equity comp: wash sale window daysIRC 1091(a) checked 2026-10-19, review by 2027-01-19
cf-2026:equity_comp.wash_sale_window_days - Capital gains: fifteen rate maximum taxable income, married filing jointly and surviving spouseRev. Proc. 2025-32 sec. 4.03 checked 2026-09-24, review by 2027-01-22
federal-2026:capital_gains.fifteen_rate_max_taxable_income.married_filing_jointly_and_surviving_spouse - Capital gains: fifteen rate maximum taxable income, singleRev. Proc. 2025-32 sec. 4.03 checked 2026-09-24, review by 2027-01-22
federal-2026:capital_gains.fifteen_rate_max_taxable_income.single - Capital gains: rates26 U.S.C. sec. 1(h) checked 2026-09-24, review by 2027-01-22
federal-2026:capital_gains.rates - Capital gains: zero rate maximum taxable income, married filing jointly and surviving spouseRev. Proc. 2025-32 sec. 4.03 checked 2026-09-24, review by 2027-01-22
federal-2026:capital_gains.zero_rate_max_taxable_income.married_filing_jointly_and_surviving_spouse - Capital gains: zero rate maximum taxable income, singleRev. Proc. 2025-32 sec. 4.03 checked 2026-09-24, review by 2027-01-22
federal-2026:capital_gains.zero_rate_max_taxable_income.single - Itemized deductions: capital loss limit vs ordinary income26 U.S.C. sec. 1211(b) checked 2026-09-24, review by 2027-01-22
federal-2026:itemized_deductions.capital_loss_limit_vs_ordinary_income - Payroll and SE tax: niit rate26 U.S.C. sec. 1411(a)(1) checked 2026-09-24, review by 2027-01-22
federal-2026:payroll_and_se_tax.niit_rate_pct - Payroll and SE tax: niit threshold MAGI, single and head of householdIRS Net Investment Income Tax page; 26 U.S.C. sec. 1411(b)(3) checked 2026-10-12, review by 2027-02-09
federal-2026:payroll_and_se_tax.niit_threshold_magi.single_and_head_of_household