Capital Gains and the Wash-Sale Rule
Capital gains and wash sales: the law, section by section
The law
Primary sources first
The law itself is open to read here, paragraph by paragraph. Pro view adds planning points.
Code sections
- § 1 Tax imposedNet 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%). (h)(1) (h)(5) (h)(6) (h)(11) (j)(5)
- § 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. (a) (b) (c)
- § 1012 Basis of property—costThe basis of property is generally its cost. (a) (c)(1)
- § 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). (a) (b)(9) (e) (f)
- § 1015 Basis of property acquired by gifts and transfers in trustA gift keeps the donor's basis (carryover basis). (a) (d)
- § 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. (a) (b) (c) (d) (e)
- § 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. (b)
- § 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. (b)(1) (b)(2)
- § 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. (a)
- § 1222 Other terms relating to capital gains and lossesLong-term means a capital asset held for more than a year; short-term means a year or less. (1) (3) (5) (7) (11)
- § 1223 Holding period of propertyYou tack on the period someone else held the property when your basis carries over from them (a gift). (1) (2) (3) (9)
- § 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. (c) (f) (g)
- § 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). (a)(1) Our note, made clear
- § 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). (a) (b)(1) Our note, made clear
- § 1411 Imposition of 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). (a)(1) (c)(1)
- § 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. (a) (b) (g)
Regulations
- 26 CFR § 1.1-1 Income tax on individuals.
- 26 CFR § 1.1-2 Limitation on tax.
- 26 CFR § 1.1-3 Change in rates applicable to taxable year.
- 26 CFR § 1.1(h)-1 Capital gains look-through rule for sales or exchanges of interests in a partnership, S corporation, or trust.
- 26 CFR § 1.1(i)-1T Questions and answers relating to the tax on unearned income certain minor children (Temporary).
- 26 CFR § 2.1-1 Definitions.
- All 52 regulations under § 1
- 26 CFR § 1.1001-1 Computation of gain or loss.
- 26 CFR § 1.1001-2 Discharge of liabilities.
- 26 CFR § 1.1001-3 Modifications of debt instruments.
- 26 CFR § 1.1001-4 Modifications of certain derivative contracts.
- 26 CFR § 1.1001-5 European Monetary Union (conversion to the euro).
- 26 CFR § 1.1001-6 Transition from certain interbank offered rates.
- All 7 regulations under § 1001
- 26 CFR § 1.1012-1 Basis of property.
- 26 CFR § 1.1012-2 Transfers in part a sale and in part a gift.
- 26 CFR § 1.1014-0 Table of contents.
- 26 CFR § 1.1014-1 Basis of property acquired from a decedent.
- 26 CFR § 1.1014-2 Property acquired from a decedent.
- 26 CFR § 1.1014-3 Other basis rules.
- 26 CFR § 1.1014-4 Uniformity of basis; adjustment to basis.
- 26 CFR § 1.1014-5 Gain or loss.
- All 11 regulations under § 1014
- 26 CFR § 1.1015-1 Basis of property acquired by gift after December 31, 1920.
Treasury and IRS guidance
- Revenue ruling Rev. Rul. 2008-5 A purchase by your IRA or Roth IRA is a wash sale.
- Notice Notice 2014-21 Virtual currency is property.
- Revenue procedure Rev. Proc. 2024-28 Allocating unused digital asset basis to each wallet or account.
- Final regulation Treas. Reg. 1.1091-1 Wash sales: the window, matching and examples.
- Final regulation Treas. Reg. 1.1012-1 Identifying what you sold, average basis, digital assets.
- Final regulation Treas. Reg. 1.6045-1 Broker reporting, including digital assets.
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.
- 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