Last updated: July 2026
This article is for informational and educational purposes only and is not tax or investment advice. See our full Disclaimer for details.
We’ve referenced tax-loss harvesting and the wash-sale rule throughout this site — in our Best ETFs for a Taxable Brokerage Account guide and our Crypto ETFs Explained guide — without fully explaining the mechanics. This article covers the strategy directly: how it reduces your tax bill, the wash-sale rule that governs it, and the practical mistakes that most commonly trip up investors trying to use it.
The Basic Definition
Tax-loss harvesting is the practice of deliberately selling an investment that’s currently worth less than you paid for it, realizing that loss for tax purposes, and using it to offset capital gains elsewhere in your portfolio — reducing your overall tax bill for the year. It’s a strategy that applies specifically to taxable brokerage accounts; positions held inside a Roth IRA, traditional IRA, or 401(k), covered in our Best ETFs for a Roth IRA and What Is a 401(k)? guides, don’t generate a deductible capital loss when sold at a loss, since those accounts aren’t taxed on an annual, transaction-by-transaction basis in the first place.
How Realized Losses Offset Your Taxes
The IRS applies a specific ordering to how capital losses offset capital gains:
Step 1: Short-term losses offset short-term gains first. Short-term losses and gains (from assets held one year or less) are netted against each other.
Step 2: Long-term losses offset long-term gains. Similarly, long-term losses and gains (from assets held more than one year) are netted against each other separately.
Step 3: Any remaining net losses can cross over. If you have a net loss in one category and a net gain in the other, the remaining loss can be applied against the remaining gain, regardless of category.
Step 4: Excess losses offset a limited amount of ordinary income. If your net capital losses for the year still exceed your capital gains after the steps above, you can use up to $3,000 ($1,500 if married filing separately) of that excess to reduce your ordinary taxable income — such as your salary — for the year.
Step 5: Anything left over carries forward. Any losses beyond that $3,000 annual limit don’t disappear — they carry forward indefinitely into future tax years, retaining their original short-term or long-term character, until fully used against future gains or future ordinary income under the same $3,000 annual cap.
A Worked Example of Carryforward
Suppose you harvest $25,000 in losses in a single year, but only have $0 in capital gains to offset that year. You could apply $3,000 of that loss against your ordinary income that year, leaving $22,000 to carry forward. If, in a later year, you realize a $15,000 capital gain from selling an appreciated position, you could apply $15,000 of your carried-forward loss to fully offset that gain, tax-free, with the remaining $7,000 continuing to carry forward into subsequent years (or being partially used against ordinary income in the years in between, subject to the same $3,000 annual cap). Losses can, in principle, carry forward for the rest of your life if never fully used — there’s no expiration date, though you’re required to track and report the remaining balance on your tax return (typically via Schedule D) each year.
The Wash-Sale Rule: The Central Constraint

This is the single most important rule governing tax-loss harvesting, and getting it wrong disallows the loss you were trying to claim. Under IRC Section 1091, if you sell a security at a loss and then purchase a “substantially identical” security within 30 days before or after that sale — a 61-day window in total, counting both directions — the loss is disallowed for tax purposes. Instead of being deductible, the disallowed loss gets added to the cost basis of the replacement security, effectively deferring (not eliminating) the tax benefit until you eventually sell that replacement position.
A concrete example: if you sell a stock at a $4,000 loss on December 1, then repurchase that same stock (or a substantially identical one) on December 20, the wash-sale rule disallows the $4,000 loss for that tax year, since the repurchase falls within the 30-day window.
The rule applies more broadly than many investors expect:
- It applies across all of your accounts combined, including accounts at different brokerages, not just the specific account where you sold at a loss.
- It applies to purchases made by your spouse’s accounts as well, if you file jointly.
- It applies even if the repurchase happens inside a tax-advantaged account like an IRA or 401(k) — buying the same security in your IRA within the window can still trigger a wash sale disallowance on a loss realized in your separate taxable account.
What Counts as “Substantially Identical”? The Ambiguous Part
The IRS has never issued a comprehensive, precise ruling defining exactly which ETFs count as “substantially identical” to each other, which creates genuine gray areas that investors and tax professionals navigate carefully:
Clearly substantially identical: Selling shares of a specific stock and buying back the exact same stock. Selling one share class of a fund and buying a different share class of the same underlying fund.
Likely substantially identical (higher risk): Selling an S&P 500 index ETF from one issuer (say, Vanguard’s VOO) and immediately buying an S&P 500 index ETF from a different issuer (say, an equivalent fund tracking the identical S&P 500 Index) — since both funds track the exact same underlying index and would be expected to perform virtually identically, some tax professionals consider this combination at meaningful risk of being treated as substantially identical, even though no definitive IRS ruling has settled the question either way.
Generally considered safer (though not risk-free): Selling a fund tracking one index and buying a fund tracking a meaningfully different index — for example, selling an S&P 500 fund and buying a total U.S. stock market fund like VTI, covered in our VOO vs VTI guide, or selling shares of a specific company and buying a diversified sector ETF instead of that same company’s stock, maintaining similar sector exposure without holding the identical security.
Because this area involves genuine interpretive ambiguity rather than a bright, well-defined line, working with a tax professional — particularly for larger transactions — is worth the cost of avoiding an disallowed-loss surprise.
A Notable Exception: Cryptocurrency
As covered in our Crypto ETFs Explained guide, the wash-sale rule under current IRS guidance applies specifically to “stock and securities,” and cryptocurrency has generally been treated as property rather than a security for tax purposes — meaning direct cryptocurrency holdings have not, as of current rules, been subject to the wash-sale rule the way stocks and ETFs are. This has occasionally been proposed for legislative change, though as of current law it remains a genuine, distinct treatment from traditional securities. It’s worth noting this exception applies to directly held cryptocurrency specifically — spot crypto ETFs, discussed in that same guide, are themselves SEC-registered securities and are generally understood to be subject to the standard wash-sale rule like any other ETF.
Specific Lot Identification: A Related Practical Detail
When you own multiple “lots” of the same fund purchased at different times and different prices, you generally have a choice in which specific shares you’re selling when you place a sell order — a choice that directly affects how much gain or loss you realize. By default, many brokerages assume a first-in-first-out (FIFO) approach, selling your oldest shares first, unless you specifically identify a different lot. For tax-loss harvesting purposes, you’d generally want to specifically identify and sell your highest-cost-basis lots (the ones purchased at the highest price, and therefore showing the largest loss relative to the current price) rather than automatically defaulting to whichever lot the broker would otherwise select — most modern brokerage platforms allow you to make this specific-lot selection at the time of sale.
Common Mistakes
Accidentally triggering a wash sale through automatic dividend reinvestment. If a fund you’re trying to harvest a loss on has automatic dividend reinvestment enabled, covered in our What Is a Dividend? guide, that automatic reinvestment could itself count as a “purchase” that triggers the wash-sale rule if it falls within the 30-day window — worth checking and potentially disabling DRIP temporarily around a harvesting transaction.
Forgetting the rule applies across a spouse’s accounts. As noted above, a joint household’s combined accounts are treated as a single unit for wash-sale purposes — a repurchase in your spouse’s separate account can disqualify a loss you realized in your own account.
Treating tax-loss harvesting as a reason to exit the market. The strategy is specifically designed to maintain your market exposure while capturing a tax benefit — selling a losing position and simply holding cash defeats much of the purpose, and reintroduces the market-timing risk covered throughout this site, including our What Is Dollar-Cost Averaging? guide’s discussion of how costly sitting in cash can be. The standard approach is to immediately reinvest the proceeds into a similar (but not substantially identical) replacement fund, maintaining comparable market exposure throughout.
Failing to track and report carryforward losses accurately. Since carryforward losses can persist for years, accurate record-keeping matters — most tax software handles this automatically once entered correctly, but errors compound over time if the carryforward balance isn’t tracked precisely from year to year.
When Does Tax-Loss Harvesting Make the Most Sense?
Larger taxable account balances generally see more absolute dollar benefit from harvesting, simply because there’s more invested capital available to generate meaningful losses to harvest during a downturn.
Higher tax brackets benefit more from each dollar of harvested loss, since the tax savings scale with your marginal rate — and for high earners, losses can also help reduce exposure to the additional 3.8% Net Investment Income Tax on investment income above certain income thresholds.
Periods of market volatility naturally create more harvesting opportunities, since meaningful, temporary losses are more likely to exist across a portfolio’s various holdings during a downturn than during a steadily rising market.
Smaller accounts or accounts with minimal unrealized losses see proportionally less benefit, and the added complexity and record-keeping burden may not be worth the modest tax savings involved for very small positions.
Automated Tax-Loss Harvesting
Many robo-advisors and some full-service brokerages now offer automated tax-loss harvesting as a built-in feature, continuously monitoring a portfolio for harvesting opportunities and executing the swap-and-replace process automatically, including wash-sale rule compliance across the accounts the platform can see. This automation can capture harvesting opportunities more consistently than manual, once-a-year reviews (commonly done around November-December, sometimes called “tax-loss harvesting season”), though it’s worth confirming exactly which accounts a given automated service monitors, since — as covered above — the wash-sale rule can be triggered by transactions in accounts the automated service doesn’t have visibility into, such as a spouse’s account at a different institution.
The Flip Side: Tax-Gain Harvesting
Less commonly discussed than tax-loss harvesting, but a related concept worth knowing, is tax-gain harvesting — deliberately realizing capital gains in a year when doing so would trigger little or no tax, rather than waiting. This can make sense for investors whose taxable income falls low enough in a given year to qualify for the 0% long-term capital gains bracket, covered in our Best ETFs for a Taxable Brokerage Account guide — selling an appreciated position and immediately repurchasing it (note that the wash-sale rule does not apply to gains, only to losses, so there’s no waiting period required to repurchase) effectively “resets” the cost basis higher at no current tax cost, which can reduce a future tax bill if the position is eventually sold in a year when your income (and therefore your capital gains rate) is higher. This strategy is less commonly used than loss harvesting, since it depends on specific, often narrow income circumstances, but it illustrates that “harvesting” as a concept isn’t limited only to losses.
Year-Round vs. Year-End Harvesting
Many investors and advisors concentrate tax-loss harvesting activity in November and December, sometimes informally called “tax-loss harvesting season,” reviewing the year’s positions for harvesting opportunities before the tax year closes. This concentrated approach is straightforward but can miss opportunities that arose and reversed earlier in the year — a position that showed a meaningful loss in March but recovered by December offers no harvesting opportunity if you only review your portfolio once, at year-end. Some investors and automated platforms instead monitor for harvesting opportunities continuously throughout the year, capturing losses whenever they occur rather than waiting for a single annual review. Neither approach is universally “correct” — a once-a-year review is considerably simpler to execute manually, while continuous monitoring (more practical through an automated platform) can capture more of the available opportunities across a volatile year.
Frequently Asked Questions
Is tax-loss harvesting worth doing in a small taxable account? It can still provide some benefit, but the absolute dollar savings scale with account size and the magnitude of losses available to harvest — for a very small account, the tax savings may be modest enough that the added complexity isn’t clearly worthwhile. This is a personal calculation that depends on your specific account size, tax bracket, and available losses.
Can I tax-loss harvest inside my Roth IRA or 401(k)? No — tax-loss harvesting specifically applies to taxable brokerage accounts, since positions inside a Roth IRA, traditional IRA, or 401(k) aren’t subject to annual capital gains taxation in the first place, meaning there’s no tax benefit to realizing a loss inside those accounts.
What happens if I accidentally trigger a wash sale? The loss isn’t permanently lost — it’s disallowed for the current tax year and instead added to the cost basis of your replacement shares, effectively deferring the tax benefit to whenever you eventually sell those replacement shares (assuming no further wash sale occurs at that point). It’s a timing deferral, not a complete forfeiture, though it does delay the benefit you were originally trying to capture.
Do I need to use a tax professional for tax-loss harvesting? It’s not strictly required for straightforward cases, but given the genuine ambiguity around “substantially identical” securities and the cross-account complexity of the wash-sale rule, many investors — particularly those harvesting larger losses or holding multiple accounts — find it worthwhile to consult a tax professional to confirm a specific harvesting strategy is executed correctly.
Is there a maximum amount of losses I can harvest in a single year? There’s no limit on how much loss you can realize and use to offset capital gains dollar-for-dollar. The $3,000 annual limit applies specifically to using excess losses (beyond your capital gains) to offset ordinary income — any amount beyond that continues to carry forward to future years rather than being capped or forfeited.
Does tax-loss harvesting apply to cryptocurrency the same way it applies to stocks and ETFs? As covered in our Crypto ETFs Explained guide, directly held cryptocurrency has generally not been subject to the wash-sale rule under current IRS guidance, since it’s treated as property rather than a security — a notable exception that some investors have used for more flexible loss-harvesting timing than securities allow. Spot crypto ETFs, by contrast, are SEC-registered securities and are generally understood to be subject to the standard wash-sale rule.
This article is provided for general informational and educational purposes only and is not personalized tax or investment advice. Tax rules, limits, and thresholds referenced above reflect current IRS guidance as of the “last updated” date above and are subject to change. Always verify current rules directly with the IRS and consult a licensed tax professional before implementing a tax-loss harvesting strategy specific to your situation. Read our full Disclaimer and Privacy Policy for more information.
