Capital Gains and the Wash-Sale Rule
Capital gains and wash sales: walk me through it
Your path
Selling your home
- A sale of your main home can qualify to exclude up to $250,000 of gain ($500,000 on many joint returns) if you owned and used it as your main home for at least 2 of the last 5 years.
- The home sale hub on this site walks through the tests, partial exclusions and the records to gather.
- Report the sale on Form 8949 if you cannot exclude all of the gain or you received a Form 1099-S. Gain you cannot exclude is a capital gain taxed under the rules on this page.
- Basis includes the purchase price, costs of buying and improvements. Keep the closing statements from the purchase and the sale.
Read next
Your path
Rentals, business assets and collectibles
- Property used in a business, or real property used in a rental business, is excluded from the capital asset definition. Its sale is reported on a different form from the one in this hub's main flow.
- Collectibles (art, coins, some metals) held more than 12 months are taxed at up to 28%. The part of a real property gain that comes from depreciation is taxed at up to 25%. The Schedule D instructions have worksheets for both.
- A swap of business or investment real property for like-kind real property may defer the gain if it follows the deadlines. The like-kind exchange hub covers that.
- This hub does not cover these sales in depth. Use it for the holding period, basis and netting rules they share with other sales.
Read next
Your path
A loss sale and a close purchase: the wash-sale rule
- If you sell stock or securities at a loss and buy substantially identical ones within 30 days before or after the sale, the loss is disallowed for now and added to the basis of the new shares.
- A purchase in your IRA or Roth IRA counts, and then the loss disappears because the IRA's basis does not go up. The IRS says a purchase by your spouse counts too, though that point is less settled. A scheduled investment or a dividend reinvestment is a purchase.
- Your broker is required to report a wash sale only when the sale and purchase are in the same account for the same security. You catch the rest.
- Report the disallowed loss on Form 8949 with code W, with the amount as a positive number in column (g).
- The holding period of the replacement shares includes the time you held the shares you sold.
Read next
- What is the wash-sale rule?
- How long is the wash-sale window?
- What counts as 'substantially identical'?
- What happens to a loss that's disallowed?
- Does a purchase in my IRA count?
- Does my spouse's purchase count?
- Will my broker catch a wash sale?
- I sold a fund at a loss in December and my automatic investment bought it again two weeks later. Is that a problem?
- Worked example: Selling at a loss, then buying some back
- Worked example: The IRA that bought the same stock
- Worked example: Her account bought what his account sold
- Form 1099-b: the lines to watch
- Form 8949: the lines to watch
- Go to mistakes and traps
Your path
Report your sales and fix the basis
- Gather the Form 1099-B (and Form 1099-DA, if any) for each account. The IRS has the same copies.
- Check the dates and count the holding period from the day after you acquired it; more than 12 months is long-term.
- Compare the basis on each form with your own records. If it is blank or wrong, fix it on Form 8949 with code B. Shares from an employer plan usually need this fix.
- Use the Form 8949 box that matches the form: A, B or C for short-term, D, E or F for long-term. Add any wash sale loss with code W.
- Total each part onto Schedule D. A net capital loss over the yearly limit carries forward; keep the worksheet.
Read next
- What's the difference between short-term and long-term?
- How do I count the holding period?
- What is basis?
- I bought the same stock at different times. Which shares did I sell?
- How do the boxes on Form 8949 work?
- What do codes B and W mean on Form 8949?
- Why is the basis blank or missing on my Form 1099-B?
- My Form 1099-B shows nothing for the cost basis. What do I put?
- Worked example: The same gain, one day apart
- Worked example: Four piles, one result
- Form 1099-b: the lines to watch
- Form 8949: the lines to watch
- Form schedule-d: the lines to watch
- Go to irs forms and publications
Your path
Crypto held with a platform that sends a Form 1099-DA
- Brokers report gross proceeds from digital asset sales on or after January 1, 2025. They report basis only for digital assets they acquired for you in a custodial account on or after January 1, 2026. Older units are noncovered, so the basis may be blank.
- Compare the form with your own records. The basis is the cost of the units, including fees. If the form shows no basis or a wrong one, adjust it on Form 8949.
- Use the digital asset boxes: G, H or I for short-term, J, K or L for long-term. Use G or J when the form shows basis reported to the IRS, and H or K when it does not.
- If you have units in more than one account, tell each broker which units to sell. Without that, the broker uses its default, which is first-in, first-out.
- Answer the digital assets question on Form 1040. Totals go to Schedule D.
Read next
- What is Form 1099-DA, and when does it start?
- What's my basis in crypto?
- Where does crypto go on my return?
- Which units did I sell if I bought at different prices?
- Does the wash-sale rule apply to crypto?
- Worked example: Which coins did I sell?
- Form 1099-da: the lines to watch
- Form 8949: the lines to watch
- Go to questions and answers
Your path
Crypto in a wallet you control
- Crypto is property. Selling it, trading it for other coins and spending it are all dispositions that produce a gain or a loss. Moving coins between wallets you own is, on our reading, not a disposition.
- For units not held with a broker, record which units you sell no later than the date and time of the sale, with an identifier like purchase date and price. If you do not, the oldest units are treated as sold first. Tracking is wallet by wallet or account by account from January 1, 2025.
- Your basis is what you paid, including fees. If you received coins as pay, it is their dollar value on the day you received them.
- Report each disposition on Form 8949 in box I (short-term) or L (long-term) when no Form 1099-DA came, and total on Schedule D.
- Mining or staking payouts create income when received; that is a separate question this hub does not cover.
Read next
- How is crypto taxed?
- What counts as selling crypto?
- What's my basis in crypto?
- Which units did I sell if I bought at different prices?
- Where does crypto go on my return?
- What about staking, mining and airdrops?
- I paid for a laptop with crypto. Is that a taxable sale?
- Worked example: Which coins did I sell?
- Form 8949: the lines to watch
- Form schedule-d: the lines to watch
- Go to questions and answers
Your path
Using a capital loss
- Capital losses first offset capital gains, short-term against short-term and long-term against long-term, then the two results against each other.
- If you still have a net loss, you can deduct up to $3,000 against other income this year (half that if married filing separately).
- The rest carries forward with no end date and keeps its short-term or long-term label. Keep this year's Schedule D and the carryover worksheet.
- Losses on personal-use property (a car, furniture, your own home) are not deductible, and a wash sale loss is postponed. A security that becomes completely worthless is treated as sold on the last day of the year.
- If you filed jointly before and file separately now, a carryover from the joint return can be deducted only by the spouse who had the loss.
Read next
- 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 lost a lot in the market this year. Can I deduct all of it?
- Worked example: Four piles, one result
- Worked example: A big loss, spread over years
- Form schedule-d: the lines to watch
- Form 8949: the lines to watch
- Go to worked examples
Your path
A gift or an inheritance: your starting point
- A gift generally keeps the donor's basis, and you add the donor's holding period. If the gift was worth less than the donor's basis and you sell at a loss, your basis for the loss is the lower value on the day of the gift. A sale in between gives neither gain nor loss.
- Inherited property generally takes its fair market value on the date of death (or the alternate valuation date). Its holding period is long-term in every case, and Form 8949 asks for INHERITED where the date acquired goes.
- Ask the donor for the cost records, the date of the gift and its value that day. Ask the executor for the date-of-death values and Schedule A of Form 8971, if one was sent.
- Report the sale on Form 8949 and Schedule D like any other sale. Keep the records that support your basis.
Read next
- What's my basis in something I was given?
- What's my basis in something I inherited?
- How long did I hold shares I received as a gift?
- How long did I hold inherited shares?
- My mother left me shares she bought in the 1980s. What's my basis?
- My grandfather gave me shares worth less than he paid. I want to sell them.
- Worked example: A gift with two bases
- Worked example: Shares from an estate
- Form 8949: the lines to watch
- Go to compare
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 - Home sale: ownership use test yearsIRC 121(a) checked 2026-10-19, review by 2027-01-19
cf-2026:home_sale_121.ownership_use_test_years - Capital gains: rates26 U.S.C. sec. 1(h) checked 2026-09-24, review by 2027-01-22
federal-2026:capital_gains.rates - Home sale exclusion: maximum gain excluded26 U.S.C. sec. 121(b) checked 2026-09-24, review by 2027-01-22
federal-2026:home_sale_exclusion.max_gain_excluded - 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