"/> Investment 10 min read

Tax-Loss Harvesting: A Strategy to Cut Investment Taxes

Selling losing investments can offset gains and reduce your tax bill by thousands. Here's how to do it right.

1g
1gb.icu Editorial Team
Reviewed by editorial team • Updated 2024

Tax-loss harvesting is the practice of deliberately selling investments at a loss to offset capital gains elsewhere in your portfolio, and even to offset a limited amount of ordinary income. For taxable brokerage account holders with diversified portfolios, the strategy can save $1,000–$5,000 per year in federal taxes—sometimes more in years with large realized gains. Done well, harvesting is one of the few "free lunches" in investing: you keep your market exposure, reduce your tax bill, and defer taxes on winning positions indefinitely.

This guide explains how tax-loss harvesting works, the $3,000 ordinary income offset, the wash sale rule that trips up many investors, the substantially identical security standard, cost basis methods, the long-term vs short-term matching rules, year-end planning, and tax-gain harvesting in the 0% long-term bracket. This is educational information only and not tax, legal, or financial advice—consult a qualified tax or financial professional about your specific situation.

How tax-loss harvesting works

The mechanics are simple. When you sell an investment in a taxable account for less than you paid, you realize a capital loss. Realized losses offset realized capital gains dollar for dollar. If your total losses exceed your total gains for the year, you can use up to $3,000 of the excess to offset ordinary income (wages, interest, self-employment income), and any remaining loss carries forward to future years indefinitely.

Example: You sell Stock A for a $20,000 long-term gain and Stock B for a $25,000 long-term loss. The gain is fully offset by the loss. The remaining $5,000 loss offsets $3,000 of salary income this year; the other $2,000 carries forward to offset gains or income next year. At the 24% bracket, the $3,000 ordinary income offset saves $720 in federal tax; the $20,000 gain offset saves $3,000 (assuming 15% long-term capital gains rate). Total savings: about $3,720.

The $3,000 ordinary income offset

The IRS allows individuals to use up to $3,000 of net capital losses per year to offset ordinary income ($1,500 for married filing separately). Above $3,000, the excess carries forward to future tax years and can be used to offset future gains or another $3,000 of ordinary income each year until exhausted.

The $3,000 cap is per tax return, not per person, so a married couple filing jointly gets only one $3,000 offset even if both spouses have separate brokerage accounts. The offset is applied first against short-term gains (which are taxed at ordinary rates), then long-term gains (which are taxed at preferential 0/15/20% rates), then ordinary income.

At the 24% federal bracket, $3,000 of ordinary income offset saves $720 in federal tax. Add 5% state tax in many states, and the savings approach $870. Multiplied over a decade of disciplined harvesting, $8,700 in tax savings is not unusual—real money that compounds when reinvested.

The wash sale rule: the biggest trap

The wash sale rule disallows a loss if you buy the same or a "substantially identical" security within 30 days before or 30 days after the sale that created the loss. The disallowed loss is added to the cost basis of the replacement shares, so you don't lose it permanently—you lose the immediate deduction and effectively defer it until you sell the replacement shares.

The 30-day window is a 61-day window total: 30 days before the sale, the sale date, and 30 days after. The rule applies to you, your spouse (if filing jointly), and any IRA you control—including a Roth IRA. Buying the same stock in your IRA within the window is a wash sale, and the loss is permanently disallowed (not just deferred) because IRAs do not have a cost basis to absorb the adjustment.

What counts as "substantially identical"

The IRS has never published a bright-line test, but the consensus is:

  • Same stock in a different account: Substantially identical. Selling Apple at a loss in your brokerage account and buying it back in your IRA is a wash sale.
  • Different share class of the same fund: Substantially identical. Selling Vanguard Total Stock Market Admiral Shares (VTSAX) and buying Vanguard Total Stock Market ETF (VTI) is a wash sale.
  • Different mutual funds tracking the same index: Generally NOT substantially identical. Selling Vanguard S&P 500 (VFIAX) and buying Fidelity S&P 500 (FXAIX) is generally safe—different fund families, different management.
  • Different but similar indexes: Not substantially identical. Selling S&P 500 and buying Total Stock Market, or selling Total International and buying Developed Markets, are common safe substitutions.
  • Different stocks in the same sector: Not substantially identical. Selling Microsoft and buying Apple is safe.
  • Options and the underlying stock: Generally substantially identical. Selling stock at a loss and buying a call option on the same stock within 30 days is a wash sale.

When in doubt, switch to a fund tracking a different but similar index. A Total Stock Market fund can be replaced with an S&P 500 fund or a Russell 3000 fund; a Total International fund can be replaced with a Developed Markets fund or an All-World ex-US fund. The market exposure is similar enough that your long-term return is not materially different.

Wash sales across brokers

If you trade at multiple brokers, wash sale tracking is your responsibility—the brokers report wash sales only within their own house. Selling at a loss at Fidelity and buying back at Schwab within 30 days is a wash sale that you must self-report on Form 8949. The IRS's automated matching systems increasingly catch these cross-broker wash sales.

Long-term vs short-term loss matching

Capital gains and losses are categorized as short-term (held one year or less) or long-term (held more than one year). Short-term gains are taxed at ordinary income rates (up to 37%); long-term gains are taxed at preferential 0/15/20% rates. Losses must be matched against gains in a specific order:

  1. Short-term losses offset short-term gains first.
  2. Long-term losses offset long-term gains first.
  3. Any remaining short-term loss offsets long-term gains, and vice versa.
  4. Any remaining net loss (up to $3,000) offsets ordinary income.
  5. Remaining losses carry forward.

The matching matters because short-term gains are taxed at higher rates. A $10,000 short-term loss offsetting $10,000 of short-term gains saves up to $3,700 in tax at the 37% bracket. The same $10,000 loss offsetting $10,000 of long-term gains saves only $2,000 at the 20% long-term rate. Harvesting short-term losses first maximizes savings when you have both.

Conversely, when harvesting losses, prefer to realize short-term losses (which offset high-taxed short-term gains) over long-term losses (which offset lower-taxed long-term gains), all else equal.

Cost basis methods

Brokers report cost basis on Form 1099-B using one of several methods you select. The choice matters for harvesting:

First-in, first-out (FIFO)

The oldest shares are sold first. FIFO typically produces the largest long-term gain in rising markets because the oldest shares have the lowest cost basis. Useful if you want long-term capital gains treatment, less useful for harvesting losses.

Specific share identification

You choose which tax lots to sell. This is the most flexible method for tax-loss harvesting—you can selectively sell the tax lots with the largest losses while holding lots with gains. Brokers supporting specific ID display each lot's cost basis and acquisition date at the time of sale. Most modern brokers offer this method by default.

Average cost

Available only for mutual funds (not ETFs or stocks), the average cost method averages the cost basis across all shares. Once elected, you must continue using average cost for that fund unless you formally change methods. Average cost limits tax-loss harvesting opportunities because every lot has the same basis.

For most investors, specific share identification is the right default. Switch cost basis methods at brokers where you currently use FIFO or average cost—but check that switching does not trigger a deemed sale under IRS rules.

A sample portfolio harvesting scenario

Consider a diversified taxable portfolio worth $200,000 at the start of the year, with the following holdings and unrealized gains/losses in November:

HoldingCurrent valueCost basisUnrealized gain/(loss)Character
Vanguard Total Stock Market (VTI)$80,000$70,000+$10,000Long-term
Vanguard Total International (VXUS)$40,000$55,000−$15,000Long-term
Apple (AAPL)$30,000$25,000+$5,000Long-term
Tesla (TSLA)$20,000$35,000−$15,000Short-term
Cash$30,000$30,000

You also sold Nvidia earlier in the year for a $20,000 long-term gain.

Harvesting plan in late November:

  1. Sell all VXUS shares, realizing the $15,000 long-term loss. Replace with Vanguard Developed Markets (VEA) to maintain international exposure without triggering a wash sale.
  2. Sell all TSLA shares, realizing the $15,000 short-term loss. Wait 31 days before repurchasing TSLA, or replace with a different automotive or technology ETF for the wash sale window.

Tax impact:

  • Short-term loss: $15,000. Used to offset short-term gains first (none), then long-term gains. The first $15,000 of the $20,000 Nvidia long-term gain is offset, leaving $5,000 long-term gain.
  • Long-term loss: $15,000. Used to offset the remaining $5,000 long-term gain, leaving $10,000 net long-term loss.
  • Of the $10,000 remaining net loss, $3,000 offsets ordinary income this year. The other $7,000 carries forward to future years.

Total federal tax savings at the 24% bracket: $3,000 × 24% (ordinary offset) + $20,000 × 15% (gains offset) = $720 + $3,000 = $3,720 in federal tax savings, plus state tax savings.

Tax-gain harvesting in the 0% bracket

The mirror-image strategy—tax-gain harvesting—applies to taxpayers in the 0% long-term capital gains bracket. In 2024, the 0% rate applies to taxable income (including long-term gains) up to $47,025 for single filers and $94,050 for married filing jointly.

A retired couple with $60,000 of taxable income has headroom under the $94,050 threshold. They can sell appreciated stock, realize up to $34,050 of long-term gains at 0% federal, and immediately repurchase the same stock (no wash sale rule on gains). This resets the cost basis upward, reducing future gains. Over multiple years, this strategy can systematically raise basis on a large portfolio.

Tax-gain harvesting is also relevant for investors temporarily in low brackets—sabbaticals, between jobs, grad students, early retirees before Social Security and RMDs begin.

Year-end planning

The last six weeks of the year are the prime harvesting window for most taxpayers because most gains and losses are already known. Steps:

  1. Review Form 1099-B and year-to-date realized gains in your brokerage accounts by mid-November.
  2. Identify unrealized losses that can be harvested to offset realized gains. Use specific share identification to target the largest loss lots.
  3. Execute sales before December 31 to count for the current tax year. Trade settlement rules changed to T+1 in May 2024, but the IRS uses the trade date for tax purposes.
  4. Avoid wash sales by switching to a different but similar security or waiting 31 days before repurchasing.
  5. Coordinate with retirement account contributions if reducing taxable income further (traditional 401(k), traditional IRA, HSA).
  6. Rebalance the portfolio using the harvesting trades—selling losing positions often aligns with rebalancing out of underperformers.

Watch for "mark-to-market" mutual fund distributions in December. Many mutual funds distribute realized capital gains to shareholders in early December, often 5–15% of NAV. If you hold the fund in a taxable account when the distribution hits, you owe tax on the gain even if you did not sell. Avoid buying funds in late November and early December—check the fund's distribution calendar before purchasing.

Run capital gains scenarios with our Capital Gains Tax Calculator to see exactly how harvesting affects your tax bill.

When harvesting does not make sense

Harvesting is not always the right move. Skip it when:

  • You have no realized gains and no plan for future gains. The $3,000 ordinary income offset is the only benefit, and the displaced basis means future gains may offset the savings. Mathematically the time value of money still favors harvesting, but the case is weaker.
  • The position is small. Selling $2,000 of stock at a $500 loss saves perhaps $120 in tax. The administrative cost exceeds the benefit.
  • You expect to donate the appreciated position. Donating long-term appreciated stock gives a fair market value deduction and avoids capital gains tax entirely—more valuable than harvesting the loss.
  • You have substantial NOL carryforwards. Excess losses already offset future gains; new harvesting adds little until the carryforward is exhausted.
  • The replacement security materially changes your asset allocation. Switching from VTI to a sector ETF to harvest a loss is poor portfolio management if the substitution tilts your allocation for months.

Common mistakes to avoid

First, do not trigger a wash sale by automatically reinvesting dividends. Many brokers offer "auto-reinvest" for dividends and capital gain distributions. If you sell a fund at a loss and a dividend reinvestment buys more of the same fund within 30 days, you have a partial wash sale. Disable auto-reinvest before harvesting.

Second, do not forget the wash sale rule across IRAs. A loss in your taxable account, repurchased in your IRA within 30 days, is permanently disallowed—not deferred. Coordinate harvesting decisions across all your accounts.

Third, do not switch cost basis methods casually. Changing from average cost to specific ID requires IRS notification in some cases and may have tax consequences. Consult your broker or tax advisor before changing.

Fourth, do not harvest losses in tax-advantaged accounts. IRAs, 401(k)s, and Roth accounts have no capital gains tax—there is nothing to harvest. Losses in these accounts are simply losses.

Fifth, do not let harvesting drive your investment strategy. The tax tail should not wag the investment dog. Maintain your target asset allocation; choose replacement securities that are similar enough to preserve your exposure; do not switch to a higher-cost or lower-quality fund just to harvest a loss.

Sixth, do not forget to track carryforward losses. Each year's Form 1040 Schedule D and the Capital Loss Carryforward Worksheet calculate the remaining carryforward. Switching tax software or accountants can lose this information—keep prior-year returns handy.

Seventh, do not harvest short-term gains to "lock in" profits. Short-term gains are taxed at ordinary rates up to 37%, much higher than long-term rates. Wait until the one-year mark for long-term treatment unless you have offsetting short-term losses.

FAQ

How much can I save with tax-loss harvesting?

For an investor in the 24% bracket with $20,000 of realized long-term gains and $15,000 of harvested long-term losses, federal tax savings are about $2,250 (the $5,000 net gain × 15% long-term rate, plus $3,000 of remaining loss × 24% on ordinary income). High-income investors with large taxable portfolios often save $3,000–$5,000 per year. Over decades, the savings compounded can add 0.3–0.7% to annual after-tax returns.

What is the wash sale rule in plain English?

If you sell an investment at a loss and buy the same or a substantially identical investment within 30 days before or after the sale, the IRS disallows the loss for current tax purposes. The disallowed loss is added to the cost basis of the replacement shares, so it is not lost forever—just deferred until you sell the replacement. The rule applies across all your accounts, including IRAs.

Can I harvest losses in my IRA?

No. IRAs and other tax-advantaged accounts do not have capital gains tax, so there is nothing to harvest. Losses in IRAs are simply losses. The wash sale rule does apply, however—if you sell a stock at a loss in your taxable account and buy it back in your IRA within 30 days, the loss is permanently disallowed.

Can I carry forward unused losses indefinitely?

Yes. Capital losses carry forward indefinitely until used up. Each year, you can use carried-forward losses to offset that year's capital gains, plus up to $3,000 of ordinary income. A $30,000 loss harvested this year can offset gains for the next decade if not used sooner.

Should I harvest gains in the 0% long-term bracket?

If your taxable income (including the gains) stays below $47,025 single / $94,050 married filing jointly in 2024, yes. Selling appreciated stock and immediately repurchasing it (no wash sale on gains) resets your cost basis upward, reducing future gains. This is particularly powerful for early retirees and retirees before RMDs begin.

This article is educational only and does not constitute tax, legal, or financial advice. Tax rules change annually. Always verify current rules on IRS.gov and consult a qualified tax or financial professional about your specific situation. To estimate the tax impact of harvesting decisions, try our Capital Gains Tax Calculator.

"/>

This article is for educational purposes only and does not constitute financial, legal, tax, or professional advice. Always consult a qualified professional before making decisions based on this information. Read full disclaimer.