Capital Gains and the Wash-Sale Rule
Capital gains and wash sales: what each source says
Code
- Code I.R.C. § 1 Tax rates, including the maximum capital gains rate in 1(h)Net capital gain is taxed at lower rates than ordinary income: 0%, 15% or 20%, depending on where your taxable income falls, with higher maximums for unrecaptured section 1250 gain (25%) and for collectibles and section 1202 gain (28%). Qualified dividends are taxed the same way as net capital gain. For years after 2017 section 1(j)(5) sets the taxable income bands for the lowest two rates, adjusted for inflation each year.
5 paragraphs
- 1(h)(1) If you have a net capital gain, your tax can be no more than the sum of the tax on the rest of your income at ordinary rates, plus the tax on the net capital gain at the capital gains rates.
- 1(h)(5) Collectibles gain is gain on the sale of a collectible (as defined in section 408(m)) held more than a year; it is taxed at the higher maximum rate.
- 1(h)(6) Unrecaptured section 1250 gain is the part of gain on real property attributable to depreciation that is not ordinary income; it has its own maximum rate.
- 1(h)(11) Qualified dividend income (dividends from domestic corporations and qualified foreign corporations) is added to net capital gain for the rate computation, subject to a holding-period rule borrowed from section 246(c): more than 60 days in the 121-day period around the ex-dividend date for common stock.
- 1(j)(5) For taxable years after 2017 the zero-rate and fifteen-percent bands are defined by dollar amounts of taxable income (with the amounts for joint filers, heads of household, other individuals and estates), increased for inflation after 2018.
- Code I.R.C. § 1001 Determination of amount of and recognition of gain or lossGain is the amount realized over your adjusted basis; loss is the adjusted basis over the amount realized. The amount realized is money plus the fair market value of other property received. The whole gain or loss is recognized unless another provision says otherwise.
3 paragraphs
- 1001(a) Gain is the excess of the amount realized over the adjusted basis; loss is the excess of the adjusted basis over the amount realized.
- 1001(b) The amount realized is the sum of any money received plus the fair market value of the property (other than money) received.
- 1001(c) Except as otherwise provided, the entire amount of the gain or loss on the sale or exchange of property is recognized.
- Code I.R.C. § 1012 Basis of property: costThe basis of property is generally its cost. For specified securities (including digital assets) the conventions in the regulations apply account by account, and stock bought through a dividend reinvestment plan has its own average-basis rule.
2 paragraphs
- 1012(a) The basis of property is its cost, except as otherwise provided in the Code.
- 1012(c)(1) For specified securities sold on or after the applicable date, the conventions prescribed by the regulations are applied on an account-by-account basis.
- Code I.R.C. § 1014 Basis of property acquired from a decedentThe basis of property you get from a decedent is generally its fair market value at the date of death (or the alternate valuation date, if the estate chose it). The value cannot exceed the final estate tax value where that value has been determined and the property increased the estate tax. Property you gave the decedent within a year of death comes back at the decedent's basis.
4 paragraphs
- 1014(a) The basis is the fair market value at the date of the decedent's death, or the alternate valuation date or special-use value if the estate elects those.
- 1014(b)(9) Property acquired from the decedent by reason of death, form of ownership or other conditions (including property held in joint tenancy) is treated as acquired from or passing from the decedent.
- 1014(e) Appreciated property that the decedent received as a gift within a year of death and that goes back to the donor (or the donor's spouse) takes the decedent's adjusted basis, not fair market value.
- 1014(f) For property whose inclusion in the estate increased the estate tax, the basis cannot exceed the value finally determined for estate tax purposes.
- Code I.R.C. § 1015 Basis of property acquired by giftsA gift keeps the donor's basis (carryover basis). But if that basis is higher than the property's fair market value at the time of the gift, then for figuring a loss the basis is the lower fair market value. Part of any gift tax paid on the gift can add to basis, never above fair market value.
2 paragraphs
- 1015(a) For property acquired by gift, the basis is the donor's basis, except that for determining loss the basis is the fair market value at the time of the gift when that is lower.
- 1015(d) For gifts made after September 1, 1958, the basis is increased (but not above fair market value at the time of the gift) by gift tax paid on the gift; for gifts after 1976 only the part of the tax tied to the gift's net appreciation counts (1015(d)(6)).
- Code I.R.C. § 1031 Exchange of real property held for productive use or investmentNo gain or loss is recognized on an exchange of real property held for productive use in a trade or business or for investment solely for like-kind real property; the property to be received must be identified within 45 days and received within 180 days (or by the return due date, if earlier). This hub only points to the rule; the like-kind exchange hub covers it.
1 paragraphs
- 1031(a)(1) No gain or loss is recognized on the exchange of real property held for productive use in a trade or business or for investment if exchanged solely for real property of like kind to be held for productive use in a trade or business or for investment.
- Code I.R.C. § 1091 Loss from wash sales of stock or securitiesNo loss deduction is allowed on a sale of stock or securities if, in the period from 30 days before to 30 days after the sale, you acquire (by purchase or a fully taxable exchange) substantially identical stock or securities, or enter into a contract or option to acquire them. The disallowed loss is added to the basis of the replacement shares, and the old holding period carries over to them. The statute speaks of 'stock or securities'; it does not mention IRAs or spouses, and it does not mention digital assets.
5 paragraphs
- 1091(a) No deduction under section 165 for a loss on the sale or disposition of shares of stock or securities when, within the period beginning 30 days before and ending 30 days after the sale, the taxpayer acquires substantially identical stock or securities, or a contract or option to acquire them. Dealers selling in the ordinary course of business are excepted. 'Stock or securities' includes contracts or options to acquire or sell them.
- 1091(b) If less stock is acquired than was sold, regulations decide which of the shares sold carry the nondeductible loss.
- 1091(c) If at least as much stock is acquired as was sold, regulations decide which of the acquired shares are the ones that caused the loss to be disallowed.
- 1091(d) The basis of the replacement stock is the basis of the stock sold, increased or decreased by the difference between the price at which the replacement was acquired and the price at which the old stock was sold.
- 1091(e) Rules like those of subsection (a) apply to losses on closing a short sale if substantially identical stock was sold, or another short sale was entered into, in the same period.
- Code I.R.C. § 121 Exclusion of gain from sale of principal residenceGross income does not include gain on the sale of a principal residence you owned and used for periods adding up to at least 2 years in the 5 years before the sale, up to a dollar limit ($250,000, or $500,000 for many joint filers). This hub only points to the rule; the home sale hub covers it.
2 paragraphs
- 121(a) Gain from the sale or exchange of property is excluded if, during the 5 years ending on the date of sale, it was owned and used as the taxpayer's principal residence for periods adding up to 2 years or more.
- 121(b)(1) The amount of gain excluded may not exceed the statutory limit ($250,000); 121(b)(2) substitutes the larger joint-return limit ($500,000) if its conditions are met.
- Code I.R.C. § 1211 Limitation on capital lossesFor individuals, capital losses are allowed only up to capital gains, plus the lower of $3,000 (half that if married filing separately) or the excess of losses over gains.
1 paragraphs
- 1211(b) A taxpayer other than a corporation may deduct capital losses only to the extent of capital gains, plus the lower of $3,000 (half that for a married individual filing a separate return) or the excess of the losses over the gains.
- Code I.R.C. § 1212 Capital loss carrybacks and carryoversA net capital loss that an individual cannot use this year carries forward to the next year, keeping its short-term or long-term character, with no time limit. In working out the carryover, the amount you were allowed to deduct against other income is treated as a short-term gain.
2 paragraphs
- 1212(b)(1) A net short-term capital loss over net long-term capital gain becomes a short-term loss next year; a net long-term loss over net short-term gain becomes a long-term loss next year.
- 1212(b)(2) In figuring those excesses, the lesser of the amount allowed under section 1211(b) or adjusted taxable income is treated as a short-term capital gain for the year.
- Code I.R.C. § 1221 Capital asset definedA capital asset is any property you hold, whether or not connected with a business, except the listed exclusions: inventory and property held for sale to customers, depreciable business property and real property used in a business, certain creative works, certain receivables and a few others.
1 paragraphs
- 1221(a) 'Capital asset' means property held by the taxpayer (whether or not connected with the taxpayer's trade or business), but does not include the eight listed categories, such as inventory, depreciable business property, and accounts receivable from the ordinary course of business.
- Code I.R.C. § 1222 Short-term and long-term capital gains and losses, and the netting termsLong-term means a capital asset held for more than a year; short-term means a year or less. The section also defines net short-term, net long-term and 'net capital gain' (net long-term gain over net short-term loss).
5 paragraphs
- 1222(1) Short-term capital gain is gain from the sale or exchange of a capital asset held for not more than 1 year.
- 1222(3) Long-term capital gain is gain from the sale or exchange of a capital asset held for more than 1 year.
- 1222(5) Net short-term capital gain is the excess of short-term capital gains over short-term capital losses for the year.
- 1222(7) Net long-term capital gain is the excess of long-term capital gains over long-term capital losses for the year.
- 1222(11) Net capital gain is the excess of the net long-term capital gain for the year over the net short-term capital loss.
- Code I.R.C. § 1223 Holding period of propertyYou tack on the period someone else held the property when your basis carries over from them (a gift). A replacement purchase that caused a wash sale takes the holding period of the stock sold. Property you get from a decedent and sell within a year of death is treated as held more than a year.
4 paragraphs
- 1223(1) In an exchange, you include the period you held the property exchanged if the property received has the same basis in your hands in whole or in part.
- 1223(2) You include the period another person held the property if your basis is the same as it would be in that person's hands (for example, a gift at the donor's basis).
- 1223(3) For stock or securities whose acquisition caused a wash sale loss to be disallowed, the holding period includes the period you held the stock whose loss was disallowed.
- 1223(9) If your basis in property acquired from a decedent is determined under section 1014 and you sell it within a year of the decedent's death, you are treated as having held it more than a year.
- Code I.R.C. § 1411 Net investment income taxA 3.8% tax on the lesser of net investment income or the amount by which modified adjusted gross income exceeds $200,000 (single and head of household), $250,000 (joint) or $125,000 (married filing separately). Net investment income includes net gain from the disposition of property other than property held in an active trade or business.
2 paragraphs
- 1411(a)(1) The tax is 3.8% of the lesser of net investment income or the excess of modified adjusted gross income over the threshold amount.
- 1411(c)(1) Net investment income is interest, dividends, annuities, royalties and rents (outside the ordinary course of an active business), income from passive businesses and trading businesses, and net gain attributable to the disposition of property (other than property held in a business that is not passive or trading), less properly allocable deductions.
- Code I.R.C. § 165 LossesSection 165(f) says losses from sales or exchanges of capital assets are allowed only to the extent allowed in sections 1211 and 1212. Section 165(g) treats a security that becomes worthless as sold on the last day of the year.
3 paragraphs
- 165(c) An individual's loss deduction is limited to losses incurred in a trade or business, losses in a transaction entered into for profit, and (apart from subsection (h)) casualty and theft losses of other property.
- 165(f) Losses from sales or exchanges of capital assets shall be allowed only to the extent allowed in sections 1211 and 1212.
- 165(g) A security that is a capital asset and becomes worthless during the year gives a loss treated as from a sale or exchange on the last day of the taxable year.
- Code I.R.C. § 6045 Returns of brokersBrokers file returns showing each customer's gross proceeds and, for covered securities (stock, debt, certain commodities and, from the applicable date, digital assets), the adjusted basis and whether gain or loss is long-term or short-term. Without an adequate identification from the customer, the broker uses first-in, first-out. A broker applies the wash sale rule only to identical securities in the same account. Statements to customers are due on or before February 15 of the next year (February 16, 2027 for 2026 sales after the weekend and holiday rule).
3 paragraphs
- 6045(a) Every person doing business as a broker must, when required, make a return showing each customer's name and address, gross proceeds and other information the forms or regulations require.
- 6045(b) The broker must give each customer a written statement of the same information on or before February 15 of the following year (February 16, 2027 for 2026 sales after the weekend and holiday rule); a consolidated reporting statement may carry items otherwise due earlier.
- 6045(g) For covered securities the return includes adjusted basis and whether the gain or loss is long-term or short-term. Basis follows first-in, first-out unless the customer makes an adequate identification, and wash sale adjustments are made only for identical securities in the same account.
Session law
IRS guidance
Case
Form or publication
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: qualified dividend common stock holdingIRC 1(h)(11)(B)(iii)(I) checked 2026-10-22, review by 2027-01-19
cf-2026:capital_gains.qualified_dividend_common_stock_holding - Deadlines: form 1099 b 2026IRC 6045(b) checked 2026-10-19, review by 2027-02-16
cf-2026:deadlines.form_1099_b_2026 - 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 - Like kind 1031: deadlines daysIRC 1031(a)(3) checked 2026-10-19, review by 2027-01-19
cf-2026:like_kind_1031.deadlines_days - 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 - 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, married filing jointly and surviving spouseIRS Net Investment Income Tax page; 26 U.S.C. sec. 1411(b) checked 2026-10-12, review by 2027-02-09
federal-2026:payroll_and_se_tax.niit_threshold_magi.married_filing_jointly_and_surviving_spouse - Payroll and SE tax: niit threshold MAGI, married filing separatelyIRS Net Investment Income Tax page; 26 U.S.C. sec. 1411(b)(2) checked 2026-10-12, review by 2027-02-09
federal-2026:payroll_and_se_tax.niit_threshold_magi.married_filing_separately - 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