Tax-loss harvesting allows investors to intentionally sell investments at a loss to offset investment gains and reduce their taxable income. When you sell a stock, mutual fund, or other security at a loss, you can use that loss to decrease your tax bill by offsetting capital gains from profitable investments sold earlier in the same year. For example, if you sold Microsoft shares for a $5,000 gain in January and Apple shares for a $3,000 loss in November, you could use that Apple loss to reduce your taxable gains from $5,000 to $2,000, potentially saving hundreds of dollars in taxes.
This strategy is available to individual investors through self-directed brokerage accounts and is one of the few ways taxpayers can actively control their tax liability. The strategy works because the IRS allows you to use capital losses to offset capital gains in a specific order: first against gains in the same category (long-term against long-term, short-term against short-term), then against gains in the other category. If your losses exceed your gains, you can also use up to $3,000 of remaining losses to offset ordinary income like wages and salary in a single tax year. Any unused losses can be carried forward indefinitely to future years.
Table of Contents
- What Is Capital Gain and Why the Tax Difference Matters
- The Wash-Sale Rule: The Critical Limitation You Must Know
- How the $3,000 Excess Loss Deduction Works
- Carrying Forward Unused Losses to Future Years
- Advanced Consideration—The Net Investment Income Tax (NIIT)
- Practical Mechanics: When to Harvest Losses During the Year
- Tax-Loss Harvesting for Index Funds and ETF Portfolios
What Is Capital Gain and Why the Tax Difference Matters
Capital gains are the profits you make when you sell an investment for more than you paid for it. The IRS taxes capital gains differently depending on how long you held the investment: long-term capital gains (assets held over one year) typically receive preferential tax rates of 0%, 15%, or 20% depending on your income, while short-term capital gains (assets held one year or less) are taxed as ordinary income at your regular tax bracket, which can be as high as 37%. This difference is significant. A $10,000 short-term capital gain for someone in the 24% tax bracket costs $2,400 in federal taxes, while the same $10,000 long-term gain might cost only $1,500 at the 15% preferential rate, saving $900.
Tax-loss harvesting exploits this system by timing the realization of losses. When you harvest a tax loss, you’re essentially moving a paper loss into a realized loss that the IRS recognizes. The unrealized loss in your portfolio becomes a tool you can use strategically. Many investors hold losing positions hoping they’ll recover, but tax-loss harvesting suggests that if a position has lost significant value and you’ve lost confidence in it, selling it to capture a loss and then repurchasing a similar investment is a rational move. It converts what might otherwise be a passive holding into an active tax management strategy.
The Wash-Sale Rule: The Critical Limitation You Must Know
The IRS imposes a wash-sale rule that prevents investors from simply selling a security at a loss and immediately buying it back to harvest the tax benefit without truly exiting the position. Specifically, you cannot claim a tax loss if you repurchase the same security within 30 days before or 61 days after the sale—that’s a 61-day window total (30 days before the sale, the day of the sale, and 30 days after). If you violate this rule, the loss is disallowed and added to your cost basis of the new shares instead, deferring the tax benefit until you eventually sell the replacement shares. The wash-sale rule applies to substantially identical securities, which includes the same stock or ETF.
However, you can immediately replace a position with a similar but different investment. If you own the Vanguard S&P 500 ETF (VOO) and sell it at a loss, you cannot buy VOO again within the wash-sale window, but you can immediately purchase the iShares Core S&P 500 ETF (IVV) or another broad-market index fund that tracks the same index. Your portfolio maintains similar market exposure while you capture the tax loss. This substitution strategy is legal and commonly used, though you must be careful that the IRS doesn’t consider the replacement security “substantially identical,” which is rare but possible in niche situations like funds from the same provider tracking identical indexes.
How the $3,000 Excess Loss Deduction Works
If your capital losses exceed your capital gains in a given year, you can use up to $3,000 of the remaining loss to offset ordinary income—wages, salary, interest, or dividends. This is valuable because it lets you reduce your taxable income below your adjusted gross income (AGI). For someone in the 24% federal tax bracket, a $3,000 loss deduction saves $720 in federal income tax. Your state income tax might add another $150-$300 in savings depending on where you live.
Consider a real example: Sarah had $8,000 in long-term capital gains from selling Tesla shares and $5,000 in short-term losses from a failed biotech startup investment. She first uses the $5,000 loss to offset $5,000 of the gains, leaving her with $3,000 in taxable gains. She still has $0 in remaining losses, so she can’t use the $3,000 ordinary income deduction that year. However, if Sarah had $9,000 in losses instead, she would offset the full $8,000 in gains and then use the $3,000 ordinary income deduction to eliminate $3,000 of her regular income, leaving $2,000 in unused losses to carry forward to the next year indefinitely.
Carrying Forward Unused Losses to Future Years
Unlike the $3,000 annual limit on excess loss deductions, there is no limit on how much capital loss you can carry forward to future years. These carried-forward losses have no expiration date and will reduce your taxable capital gains or ordinary income whenever they are needed. This feature is particularly valuable for investors who experience a major loss in one year but expect smaller gains in subsequent years. David sold a concentrated position in company stock he inherited and realized a $50,000 capital loss in 2024.
After using $3,000 to offset ordinary income, he has $47,000 in carried-forward losses remaining. If in 2025 David has $8,000 in capital gains, he can use $8,000 of his carried-forward losses to wipe out the entire gain and still have $39,000 in losses remaining for 2026 and beyond. Over several years, these losses can amount to substantial tax savings without expiration. However, this assumes David’s tax situation remains favorable for claiming losses, which is relevant for high-income investors subject to limitations on loss deductions.
Advanced Consideration—The Net Investment Income Tax (NIIT)
Investors with modified adjusted gross income above certain thresholds—$200,000 for single filers and $250,000 for married couples filing jointly in 2024—are subject to an additional 3.8% net investment income tax (NIIT) on capital gains, dividends, and interest. This tax compounds the effective rate on long-term capital gains. At the 15% federal rate plus 3.8% NIIT, long-term capital gains can effectively cost 18.8% for high-income investors, compared to just 15% for those below the threshold.
Tax-loss harvesting becomes even more valuable for high-income investors because each dollar of loss used to offset gains saves 18.8% in federal tax plus state income tax, potentially reaching 25%+ total. However, the NIIT also complicates wash-sale planning: you must be especially careful to avoid accidentally triggering a disallowed loss and losing the benefit for high-dollar positions. Using substantially different replacement securities (not just similar ones) provides extra confidence that the IRS will not challenge the substitution.
Practical Mechanics: When to Harvest Losses During the Year
Most investors harvest losses opportunistically throughout the year whenever a position declines in value and they lose confidence in its recovery. However, year-end tax-loss harvesting is a common practice in December when investors review their positions and their full-year capital gains picture.
If you realize you’ll have significant capital gains from sales earlier in the year, you have an opportunity to strategically sell losing positions before December 31 to offset those gains. The mechanics are straightforward: log into your brokerage account, identify a losing position you’re willing to exit, sell it, realize the loss in your tax year, and then immediately purchase a replacement investment with similar characteristics if you want to maintain your desired asset allocation. Your broker will typically provide year-to-date gain/loss data to help you assess which positions are underwater.
Tax-Loss Harvesting for Index Funds and ETF Portfolios
Tax-loss harvesting is particularly practical for investors holding multiple index funds and ETFs because numerous similar products exist for nearly every market segment. If the Vanguard Total Stock Market ETF (VTI) is down 15%, you can sell it and immediately buy the iShares Core S&P 500 ETF (IVV) or the Schwab U.S. Broad Market ETF (SWTSX) to maintain your market exposure while capturing the loss. These funds track overlapping but not identical indexes, so the IRS has never challenged such swaps as wash sales.
For international exposure, similar flexibility exists. The Vanguard FTSE Developed Markets ETF (VEA) and iShares Core MSCI Developed Markets ETF (IEMG) track nearly identical market segments, making them acceptable substitutes for wash-sale planning. However, the closer the substitution (same fund provider, identical index), the higher the risk an aggressive IRS agent might challenge it, though this remains extremely rare in practice. Investors managing broadly diversified portfolios often harvest losses from a position and swap it for a fund with a slightly different weighting or slightly broader market exposure, which provides clear differentiation to the IRS.
- —




