Tax loss harvesting is the deliberate realization of capital losses to offset capital gains and reduce tax liability. It does not eliminate the tax - it defers it by resetting the cost basis of the sold position to a lower number. Done correctly, the tax savings compound over time because the deferred tax is an interest-free loan from the government. Done incorrectly - by repurchasing the same or substantially identical security within 30 days - the loss is disallowed entirely under the wash sale rule.
Capital gains and losses are first categorized as short-term (held 12 months or less) or long-term (held more than 12 months). They are then netted within each category, and the resulting net short-term and net long-term amounts are combined under the capital gain and loss netting rules of IRC §1222.
| Netting Result | Tax Treatment |
|---|---|
| Net long-term gain + net short-term gain | LTCG taxed at 0%/15%/20% rates; STCG taxed as ordinary income |
| Net long-term gain + net short-term loss | Short-term loss offsets long-term gain; net is LTCG at preferential rates |
| Net long-term loss + net short-term gain | Long-term loss offsets short-term gain; net is STCG at ordinary rates (unfavorable) |
| Net capital loss (both categories) | Up to $3,000 deductible against ordinary income per year; excess carries forward indefinitely |
Net capital losses in excess of capital gains can offset up to $3,000 of ordinary income per year ($1,500 for married filing separately). This limit has not been adjusted for inflation since 1978 and is not indexed - $3,000 in 2026 is worth far less in purchasing power than it was when the limit was set. Unused capital losses carry forward indefinitely to future years and retain their short-term or long-term character.
The wash sale rule disallows a capital loss if the taxpayer sells a security at a loss and, within 30 days before or after the sale, purchases the same or substantially identical security. The 61-day window (30 days before through 30 days after the sale date) is the key timing constraint.
The wash sale rule does not permanently disallow the loss - it defers it. The disallowed loss is added to the basis of the replacement security purchased within the wash sale window. When the replacement security is eventually sold without triggering another wash sale, the deferred loss is recovered. The wash sale rule also extends the holding period of the replacement security by the holding period of the sold security.
Example: Sell 100 shares of XYZ at $5,000 loss (held 8 months). Buy 100 shares of XYZ 15 days later at $45. Wash sale: loss is disallowed. New basis = $45 + $50 loss per share = $95. New holding period: 8 months + counting from repurchase.
The IRS defines substantially identical broadly. Securities from the same issuer are identical. Stocks and convertible bonds or convertible preferred of the same company can be substantially identical. However:
The wash sale rule applies across all accounts owned by the same taxpayer - including IRAs. Selling a stock in a taxable account at a loss and buying the same stock in an IRA within 30 days triggers the wash sale rule, and the loss is permanently disallowed (not deferred - because the replacement purchase is in a tax-advantaged account where the basis adjustment is not tracked). Spouses filing jointly are treated as one taxpayer for wash sale purposes - a loss sale by one spouse is washed by a repurchase by the other.
Offset realized gains before year-end. If you have already realized capital gains during the year, harvesting losses before December 31 directly reduces the tax owed. Short-term losses should be matched against short-term gains first for maximum benefit.
Harvest without repurchasing. To avoid the wash sale rule, wait 31 days before repurchasing the sold security. During the 31-day window, hold cash or purchase a similar-but-not-substantially-identical security to maintain market exposure.
Accelerate gains in 0% years. Taxpayers in the 0% long-term capital gains bracket (income below approximately $98,900 MFJ in 2026) should consider deliberately realizing gains rather than harvesting losses. Selling appreciated positions and immediately repurchasing steps up the basis at zero tax cost - eliminating the embedded gain for future years when rates will be higher.
Crypto loss harvesting is available year-round. Because the wash sale rule does not apply to cryptocurrency (property, not securities), crypto positions can be sold at a loss and immediately repurchased without triggering the wash sale rule. This allows continuous loss harvesting on volatile crypto positions without the 31-day waiting requirement.