How to sell losing investments to offset capital gains taxes -- the wash sale rule, step-by-step process, $3,000 deduction, and whether it is worth it for your portfolio.
Updated February 13, 2026
14 min read
Quick Answer
What is tax-loss harvesting? It is the strategy of selling investments at a loss to offset capital gains taxes. Here is what you need to know:
How it works: Sell a losing position, claim the loss, and reinvest in a similar (but not identical) asset
Offset gains: Capital losses offset capital gains dollar-for-dollar with no limit
Ordinary income deduction: Net losses above gains offset up to $3,000 of ordinary income per year ($1,500 if married filing separately)
Carry forward: Unused losses carry forward indefinitely to future tax years
Key constraint: The wash sale rule prevents buying the same security within 30 days before or after the sale
Taxable accounts only: Does not work in IRAs, 401(k)s, or other tax-advantaged accounts
Bottom line: A single investor who harvests $10,000 in losses at a 15% long-term capital gains rate saves $1,500 in taxes. Use our calculator to estimate your potential savings.
Tax-loss harvesting is a tax strategy where you sell investments that have declined below your purchase price (cost basis), realize the capital loss for tax purposes, and then use that loss to reduce your tax bill. The key is that you typically reinvest the proceeds in a similar -- but not identical -- investment, so your overall portfolio allocation stays roughly the same.
The Basic Mechanism
The process works in five steps:
Identify investments in your taxable brokerage account that have declined below your cost basis
Sell the losing position to realize the capital loss
Use the loss to offset capital gains from other investments you sold at a profit
Deduct excess losses -- if losses exceed gains, deduct up to $3,000 against ordinary income
Reinvest the proceeds in a similar (but not "substantially identical") investment to maintain your market exposure
Why Tax-Loss Harvesting Works: A Worked Example
Suppose you are a single filer with $100,000 in ordinary income. During the year, you sold Stock A for a $10,000 long-term capital gain. You also hold Stock B, which has a $6,000 unrealized loss.
Tax Impact: With vs. Without Tax-Loss Harvesting
Scenario
Without Harvesting
With Harvesting
Capital gains from Stock A
$10,000
$10,000
Harvested loss from Stock B
$0
-$6,000
Taxable capital gain
$10,000
$4,000
Tax rate (15% LTCG)
15%
15%
Capital gains tax owed
$1,500
$600
Tax savings from harvesting
--
$900
By selling Stock B to realize the $6,000 loss, you reduce your taxable gain from $10,000 to $4,000, saving $900 in federal taxes. You then reinvest the proceeds from Stock B into a similar investment, maintaining your portfolio strategy. For a full breakdown of the capital gains rates that determine your savings, see our 2026 Capital Gains Tax Brackets guide.
If your gains had been short-term (taxed at your ordinary income rate of 22%), the same $6,000 harvested loss would have saved you $1,320 instead of $900. This is why harvesting short-term losses to offset short-term gains generally provides the largest tax benefit.
Important: Taxable Accounts Only
Tax-loss harvesting works only in taxable brokerage accounts. Losses realized in tax-advantaged accounts such as IRAs, 401(k)s, and HSAs provide no tax benefit because gains in those accounts are already tax-deferred or tax-free. If you are looking for other ways to reduce your tax burden in retirement accounts, consider a Roth conversion strategy instead.
The Wash Sale Rule: The Critical Constraint
The biggest pitfall in tax-loss harvesting is the wash sale rule. Violating it means your loss gets disallowed, defeating the purpose of the strategy. Understanding this rule is essential before you harvest any losses.
What the Wash Sale Rule Says
Under IRC Section 1091, you cannot deduct a capital loss if you purchase a "substantially identical" security within 30 days before or after the sale. This creates a 61-day window: 30 days before the sale + the sale date itself + 30 days after.
If the wash sale rule is triggered:
The loss is disallowed for tax purposes in the current year
The disallowed loss is added to the cost basis of the replacement shares (so the loss is deferred, not permanently lost)
The holding period of the original shares carries over to the replacement shares
Critical details many investors miss:
The rule applies across all your accounts -- you cannot sell in your brokerage account and buy in your IRA
The rule applies to your spouse's accounts as well (IRS Revenue Ruling 2008-5)
Automatic dividend reinvestment (DRIP) purchases can trigger a wash sale if they occur within the 30-day window
What Is "Substantially Identical"?
The IRS has not published a precise definition of "substantially identical," but tax professionals generally apply these guidelines:
Wash Sale Rule: Substantially Identical or Not?
Swap
Substantially Identical?
Rationale
Sell and rebuy the same stock
Yes -- disallowed
Same security
Sell a mutual fund, buy the same fund
Yes -- disallowed
Same fund
Sell Investor shares, buy Admiral shares of same fund
Likely yes
Different share class, same portfolio
Sell S&P 500 ETF, buy Total Stock Market ETF
Generally no
Different index, different holdings
Sell Coca-Cola stock, buy PepsiCo stock
No
Different companies entirely
Sell one S&P 500 ETF, buy a different S&P 500 ETF
Gray area
IRS has not ruled definitively on this
! Watch Out for Automatic Reinvestment
Before selling a position for tax-loss harvesting, turn off dividend reinvestment (DRIP) for that security. A single DRIP purchase within the 30-day window can trigger a wash sale on the entire loss. Many investors overlook this and inadvertently disallow their harvested losses.
How to Avoid Wash Sale Violations
Wait 31+ days before buying back the same security
Buy a "similar but not identical" replacement immediately (see the swap table in Step 4 below)
Disable DRIP on the security you plan to sell at least 30 days in advance
Check all accounts -- including your spouse's IRA, your 401(k), and any other brokerage accounts
Step-by-Step Tax-Loss Harvesting Process
Follow these five steps to harvest losses correctly and avoid common mistakes.
Step 1: Identify Losing Positions
Review your taxable brokerage account for holdings with unrealized losses. Most brokerages show unrealized gain/loss in your portfolio view. Prioritize:
Short-term losses first: These offset short-term gains taxed at your ordinary income rate (up to 37%), providing the largest tax benefit per dollar
Larger losses: The tax savings must be meaningful relative to the time and complexity involved
Cost basis method: Check whether your broker uses FIFO, specific identification, or average cost. Specific identification gives you the most control over which shares to sell
Step 2: Check for Wash Sale Risk
Verify you have not purchased the same security in the past 30 days (in any account)
Turn off DRIP for the security you plan to sell
Decide your approach: wait 31 days to repurchase, or identify a replacement security now
Step 3: Sell the Losing Position
Execute the sale in your taxable brokerage account. Your broker will report the loss on Form 1099-B at tax time. Document the loss amount and whether it is short-term (held one year or less) or long-term (held more than one year).
Step 4: Reinvest in a Replacement
Immediately buy a similar but not substantially identical investment to maintain your market exposure. Here are common swap examples that most tax professionals consider safe:
Common Tax-Loss Harvesting Swaps
Sold (Loss Position)
Replacement (Not Identical)
Rationale
Vanguard S&P 500 ETF (VOO)
Schwab U.S. Large-Cap ETF (SCHX)
Similar large-cap exposure, different provider and index
iShares Core Bond ETF (AGG)
Vanguard Total Bond Market ETF (BND)
Similar bond exposure, different provider
Vanguard Total International (VXUS)
iShares Core MSCI International (IXUS)
Similar international exposure, different provider
Individual stock (e.g., META)
Technology sector ETF (XLK)
Maintains sector exposure without buying the same stock
After 31 days, you can switch back to your original fund if you prefer it. The important thing is to stay invested during the waiting period so you do not miss market gains.
i These are educational examples, not investment recommendations.
The specific ETFs and stocks listed above are illustrative. Your replacement security should match your investment strategy and risk tolerance. Consult a qualified financial advisor for guidance specific to your portfolio.
Step 5: Track for Tax Filing
Keep records of the sale date, sale price, cost basis, loss amount, and replacement purchase details. At tax time:
Your broker generates Form 1099-B with wash sale flags if applicable
Report capital gains and losses on Schedule D and Form 8949
Net your short-term and long-term gains and losses separately before combining them
One of the most valuable aspects of tax-loss harvesting is the ability to deduct net capital losses against ordinary income. If your total capital losses exceed your total capital gains for the year, you can deduct up to $3,000 of the excess against wages, salary, and other ordinary income. If you are married filing separately, the limit is $1,500.
How the $3,000 Deduction Works
$3,000 Net Capital Loss Deduction Example
Item
Amount
Capital gains realized in 2026
$2,000
Capital losses harvested in 2026
-$8,000
Net capital loss
-$6,000
Deducted against ordinary income (2026)
-$3,000
Loss carried forward to 2027
$3,000
In this example, you offset the $2,000 in gains entirely, deduct $3,000 against ordinary income in 2026, and carry the remaining $3,000 forward to 2027. At a 22% marginal ordinary income rate, the $3,000 deduction saves you $660 in taxes -- on top of any savings from offsetting your capital gains.
The $3,000 limit has not been adjusted for inflation since it was established in 1978. However, unused losses carry forward indefinitely, so large losses harvested in a single year can benefit you across multiple future tax years. For a look at the current ordinary income brackets that determine your savings, see our 2026 Federal Tax Brackets guide.
Tax-Loss Harvesting and Cryptocurrency
Cryptocurrency is treated as property by the IRS (Notice 2014-21), which means the same capital gains and loss rules that apply to stocks generally apply to digital assets. Tax-loss harvesting is available for crypto gains and losses in taxable accounts.
Crypto-Specific Considerations
Taxable events: Every sale, trade, or exchange of cryptocurrency is a taxable event, including crypto-to-crypto swaps
Holding period: Crypto held more than one year qualifies for long-term rates (0%, 15%, or 20%); crypto held one year or less is taxed as ordinary income
Broker reporting: Starting in 2025, digital asset brokers are required to report transactions on Form 1099-DA under the Infrastructure Investment and Jobs Act
! Crypto Wash Sale Rules Are Evolving
Prior to 2025, the wash sale rule under IRC Section 1091 did not explicitly apply to cryptocurrency because digital assets are classified as property, not securities. However, recent legislation has extended broker reporting requirements to crypto, and the IRS may apply or extend wash sale rules to digital assets. Verify the current IRS guidance for 2026 before assuming the wash sale rule does not apply to your crypto transactions. Consult a qualified tax professional for your specific situation.
A common crypto tax-loss harvesting approach is to sell a losing crypto position and buy a different cryptocurrency to maintain exposure. For example, selling Ethereum at a loss and purchasing Solana keeps you invested in the crypto market while realizing the tax loss. Use our Capital Gains Calculator to estimate the tax impact of your crypto gains and losses.
Is Tax-Loss Harvesting Worth It?
Tax-loss harvesting can be a powerful tool, but it is not always the right move. Here is how to evaluate whether the strategy makes sense for your situation.
When Tax-Loss Harvesting Makes Sense
You have significant capital gains to offset -- especially short-term gains taxed at ordinary income rates of 22%-37%
You hold concentrated positions with large unrealized losses -- a market downturn creates natural harvesting opportunities
You actively manage a diversified taxable portfolio -- more holdings means more potential swap opportunities
You are in a high tax bracket -- the dollar savings are proportionally larger at higher marginal rates
You are rebalancing anyway -- harvesting gives you a tax benefit on trades you would have made regardless
When It May Not Be Worth the Effort
You are in the 0% long-term capital gains bracket -- with taxable income under $48,350 (single) or $96,700 (married filing jointly) for 2026, there is no long-term gains tax to offset
Your portfolio has few losing positions -- this is a good problem to have, but it limits harvesting opportunities
The losses are very small -- harvesting $200 in losses at a 15% rate saves only $30, which may not justify the effort of tracking wash sales
The complexity exceeds the benefit -- if you have trouble tracking the 30-day windows across multiple accounts, the risk of wash sale violations may outweigh the savings
Tax-Loss Harvesting vs. Buy and Hold
An important nuance: tax-loss harvesting does not eliminate taxes -- it defers them. When you sell a losing position and buy a replacement at a lower price, the replacement has a lower cost basis. When you eventually sell the replacement at a gain, you will owe taxes on the larger gain.
However, deferral has real value. A dollar of taxes deferred today is a dollar that can compound in the meantime. Over a long time horizon, consistent tax-loss harvesting can add an estimated 0.5% to 1.5% in annual after-tax returns, according to research from major financial institutions. The exact benefit varies based on portfolio size, turnover, and market volatility.
Buy-and-hold remains a sound strategy on its own. Tax-loss harvesting is best understood as an optimization layer on top of a disciplined long-term investment approach -- not a replacement for it. For more strategies to reduce your capital gains liability, see our Capital Gains Tax Strategies 2026 guide.
While many investors associate tax-loss harvesting with year-end tax planning, opportunities can arise throughout the year.
Year-End Harvesting (October - December)
The most common approach. By Q4, you have a clearer picture of your annual gains and losses, and you can make strategic decisions before the December 31 tax year cutoff. This allows you to target the exact amount of losses needed to offset your realized gains.
Opportunistic Harvesting (Throughout the Year)
Market downturns create natural harvesting opportunities. A significant market correction in March, for example, may offer larger unrealized losses than a mild December dip. Harvesting during downturns can lock in bigger losses while the opportunity exists -- markets may recover before year-end.
Key Timing Considerations
Trade settlement: Stock trades typically settle T+1 (one business day). Make sure your sale settles before December 31 to count for the current tax year
Mutual fund distributions: Many mutual funds distribute capital gains in December. Harvesting losses before the distribution can offset those gains
Year-end rebalancing: If you rebalance your portfolio annually, combine rebalancing with harvesting to minimize total trades
For context on what investment returns typically look like and when losses are most common, see our ROI Benchmarks by Investment Type guide. And to understand how your deferred tax savings can grow over time, try our Investment Calculator.
Frequently Asked Questions
What is tax-loss harvesting?
Tax-loss harvesting is the strategy of selling investments at a loss to offset capital gains taxes. You sell a losing position, claim the tax loss, and reinvest in a similar (but not substantially identical) investment to maintain your portfolio allocation. The realized loss offsets capital gains dollar-for-dollar, and up to $3,000 in net excess losses can be deducted against ordinary income each year.
What is the wash sale rule?
The IRS wash sale rule (IRC Section 1091) prevents you from claiming a tax loss if you buy the same or a "substantially identical" security within 30 days before or after the sale. This creates a 61-day total window. If triggered, the disallowed loss is added to the cost basis of the replacement shares -- it is deferred, not permanently lost. The rule applies across all your accounts, including your spouse's accounts.
How much can I deduct in capital losses?
You can offset unlimited capital gains with capital losses. If your total losses exceed your total gains for the year, you can deduct up to $3,000 of the net loss against ordinary income ($1,500 if married filing separately). Any remaining unused losses carry forward indefinitely to future tax years until fully used.
Can I tax-loss harvest in my IRA or 401(k)?
No. Tax-loss harvesting only works in taxable brokerage accounts. Losses realized in tax-advantaged accounts such as IRAs, 401(k)s, and HSAs have no tax benefit because gains in those accounts are already tax-deferred or tax-free. You need a taxable investment account to benefit from this strategy.
Does tax-loss harvesting work for crypto?
Yes. The IRS treats cryptocurrency as property, so capital gains and loss rules apply. You can sell a losing crypto position to realize a tax loss. However, starting in 2025, digital asset broker reporting rules took effect, and the wash sale rule may apply to crypto transactions in 2026. Check the latest IRS guidance or consult a tax professional for clarity on current crypto wash sale rules.
When is the best time to tax-loss harvest?
Year-end (October through December) is the most common time, as investors review their tax situation before December 31. However, harvesting throughout the year during market downturns can capture larger losses when they are available. There is no requirement to wait until year-end -- any time you have a meaningful unrealized loss in a taxable account is a potential opportunity.
Is tax-loss harvesting worth the effort?
For investors with significant taxable gains and diversified portfolios, tax-loss harvesting can save hundreds to thousands of dollars annually. A $10,000 harvested loss at a 15% long-term rate saves $1,500 in taxes. However, for investors with small portfolios, few losing positions, or those in the 0% capital gains bracket (taxable income under $48,350 single / $96,700 MFJ for 2026), the benefit may not justify the complexity of tracking wash sales.
Can I buy back the same stock after 30 days?
Yes. Once 31 days have passed since the sale, the wash sale window closes and you can repurchase the original security without losing the tax deduction. Many investors sell a position, buy a similar replacement fund for 31 days, then switch back to their original holding if desired.
See How Much Tax-Loss Harvesting Could Save You
Enter your capital gains, losses, holding periods, and filing status to calculate your exact tax liability. Compare scenarios with and without harvested losses to quantify your potential savings.