Tax-loss harvesting offsets capital gains with investment losses — here's how the wash-sale rule, the $3,000 annual limit, and loss carryforwards work.
Tax-loss harvesting is the deliberate sale of losing investments to offset taxable capital gains — and up to $3,000 per year of ordinary income. The wash-sale rule prohibits repurchasing substantially identical securities within 30 days before or after the sale. Unused losses carry forward indefinitely. This strategy applies only in taxable brokerage accounts, not inside IRAs or 401(k)s.
Tax-loss harvesting is the deliberate sale of an investment that has declined below its purchase price — its cost basis — in order to realize a capital loss that offsets taxable capital gains elsewhere in your portfolio.
The mechanics are straightforward. Say you sold a stock position in March for a $12,000 gain. Elsewhere in your portfolio, a broad-market ETF is now worth $5,000 less than you paid for it. Selling that ETF before December 31 creates a $5,000 capital loss that reduces your taxable gain to $7,000. At a 15% long-term capital gains rate, that's $750 in avoided taxes from a single trade.
IRS Topic 409 — Capital Gains and Losses classifies capital gains and losses as either short-term (assets held 12 months or less) or long-term (assets held more than 12 months). Short-term gains are taxed as ordinary income — at rates up to 37%. Long-term gains are taxed at preferential rates: 0%, 15%, or 20% depending on your taxable income. See 2026 federal income tax brackets for current thresholds. The rate gap is why tax-loss harvesting is most powerful against short-term gains: you may be saving 37 cents on the dollar instead of 15 or 20.
The IRS requires capital losses and gains to net by type first:
After same-type netting, any remaining net loss crosses over to the other category. A net short-term loss can offset a net long-term gain, and vice versa. You cannot choose the order — the IRS-mandated sequence applies.
When total capital losses exceed total capital gains for the year, the net capital loss can offset ordinary income — but only up to $3,000 per year under IRS Publication 550 — Investment Income and Expenses. For married couples filing jointly, the combined limit is still $3,000, not $3,000 per spouse.
The remaining unused loss does not disappear. Capital losses carry forward to future tax years with no expiration — applied against future gains or ordinary income ($3,000 per year) until fully absorbed. A large single-year loss from a volatile market can generate a carryforward that shelters income for years.
Capital gains and losses are reported on Schedule D (Form 1040). Your brokerage will issue a Form 1099-B each year summarizing every sale, the reported cost basis, and the holding period — the inputs that feed directly into Schedule D. Tax software aggregates the gains and losses, performs the netting, calculates the allowable deduction against ordinary income, and computes the carryforward.
For investors with multiple accounts or assets transferred between brokerages, review your Form 1099-B for cost-basis accuracy before filing. Errors in reported basis are common, especially for reinvested dividends or shares acquired through employee stock purchase plans.
The strategy's primary pitfall is the wash-sale rule. IRS Publication 550 defines it: a capital loss is disallowed if, within 30 days before or after the sale, you buy or acquire a "substantially identical" security. The 60-day wash-sale window runs from 30 days before the sale date through 30 days after.
The disallowed loss is not permanently lost — it is added to the replacement security's cost basis, deferring (not eliminating) the tax benefit. But the immediate tax offset is gone, which defeats the purpose of harvesting in the current tax year.
What typically triggers the wash-sale rule: - Selling an S&P 500 index ETF at a loss and buying another S&P 500 index ETF from a different fund family within 30 days (same index, substantially identical) - Selling individual stock XYZ at a loss and repurchasing XYZ within 30 days - Selling a mutual fund and buying a comparable mutual fund with substantially similar holdings within 30 days
What generally does not trigger the wash-sale rule: - Selling a total U.S. stock market ETF and buying a total international stock market ETF (distinct markets, non-identical securities) - Selling one broad-market index ETF and buying an ETF tracking a different index with distinct methodology and constituent holdings — though the IRS applies a facts-and-circumstances test, so consult a tax professional before relying on fund-family differences alone
Critical: The wash-sale rule applies across all accounts you own — including your spouse's accounts and your IRA. Selling a security at a loss in your taxable account and repurchasing it inside your IRA within the 30-day window can disallow the loss in the taxable account.
Tax-loss harvesting is only meaningful in taxable brokerage accounts. IRAs, 401(k)s, SEP-IRAs, and other tax-advantaged accounts are already tax-deferred or tax-free — there are no capital gains taxes inside them to offset. Realizing a loss inside a retirement account produces no current-year tax benefit and no carryforward.
The strategy delivers the most value for investors who: - Hold substantial assets in taxable accounts and realized capital gains earlier in the current year - Are in the 22% ordinary income bracket or higher (where short-term gain savings are meaningful) - Received a large one-time capital gain: sale of a business, vested RSU payout, or sale of investment real estate - Are approaching the 3.8% Net Investment Income Tax (NIIT) threshold — reducing net investment income through loss harvesting also reduces NIIT exposure for earners above the applicable MAGI threshold
Investors whose taxable income places long-term gains in the 0% bracket have less immediate incentive to harvest — those gains are not taxed in the current year. However, a capital loss carryforward still has value in future years when income may be higher.
December 31 is the annual deadline to realize a capital loss for a given tax year. Trade date, not settlement date, determines the tax year per IRS Topic 409.
Rather than scrambling at year-end, review your taxable portfolio in early Q4 (October–November). A mid-year market correction creates harvesting windows even earlier: sell the losing position, immediately purchase a comparable (but not substantially identical) fund to maintain your market exposure, and bank the loss. The key is staying invested through the replacement — sitting in cash for 31 days waiting to repurchase the original security costs you market exposure.
After the 30-day wash-sale window passes, you can repurchase the original holding if you prefer it. Many investors simply keep the replacement fund permanently if it tracks a sufficiently similar index.
Tax-loss harvesting defers taxes rather than eliminates them. When you sell a losing position and replace it with a comparable security, the replacement security carries a lower cost basis. When you eventually sell the replacement, the gain calculated from that lower basis is proportionally larger than it would have been from the original position.
The economic benefit is the time value of money: taxes paid later are worth less than taxes paid now. A dollar of tax avoided in 2026 and invested for a decade compounds before it comes due. For investors executing Roth conversions in lower-income years, combining tax-loss harvesting with a Roth conversion strategy can shift deferred gains into a tax-free account before they are realized.
For a broader view of how capital gains interact with your taxable portfolio, see Index Funds Explained: 2026 Guide and ETFs vs. Mutual Funds: Key Differences (2026).
---
*This content is for educational purposes only and does not constitute tax or investment advice. Tax rules change; verify current rules at irs.gov. Consult a qualified CPA or tax professional before making tax-loss harvesting decisions based on your specific situation.*
No. Tax-advantaged retirement accounts are already tax-deferred or tax-free — there are no capital gains taxes to offset inside them. Selling an investment at a loss in an IRA or 401(k) produces no current tax benefit and no capital loss carryforward. Tax-loss harvesting is a strategy for taxable brokerage accounts only.
The wash-sale rule, defined in IRS Publication 550, disallows a capital loss if you buy or acquire a substantially identical security within 30 days before or after the sale. The disallowed loss is added to the replacement security's cost basis rather than being permanently lost, but you cannot use it in the current tax year — which defeats the purpose of harvesting. The rule applies across all accounts you own, including your spouse's accounts.
Capital losses can offset capital gains dollar-for-dollar with no annual cap. The $3,000 annual limit applies only to the portion of net capital losses used against ordinary income — so a $50,000 loss can fully offset a $50,000 capital gain with no cap, but can only reduce ordinary income (wages, interest, etc.) by $3,000 in a single year. Remaining losses carry forward to future tax years.
No. Under IRS Publication 550, net capital losses that exceed both current-year capital gains and the $3,000 ordinary-income deduction carry forward to future tax years indefinitely. They can be applied against future capital gains and up to $3,000/year of ordinary income in every subsequent year until the loss is fully absorbed.
December 31 of each tax year. The trade date — not the settlement date — determines which tax year a sale falls into. For most taxable brokerage accounts, trades now settle in one business day (T+1). To be safe, complete harvesting trades at least two to three business days before December 31 to account for any delays.