Tax-Loss Harvesting: Save Thousands on Your Investment Taxes
Learn how tax-loss harvesting works, how it can save you thousands in taxes, and the wash sale rules you need to know to stay compliant with the IRS.
What Is Tax-Loss Harvesting?
Tax-loss harvesting (TLH) is the practice of selling investments that are at a loss to offset capital gains taxes on your winners. It is one of the most powerful and underused tax strategies available to individual investors.
Here is the basic concept: if you sold Stock A for a $5,000 profit and Stock B is currently down $3,000, you can sell Stock B to realize that $3,000 loss. The loss offsets your gain, so you only pay capital gains tax on $2,000 instead of $5,000.
How Much Can You Actually Save?
The savings depend on your tax bracket and the size of your gains and losses. At the federal level, long-term capital gains are taxed at 0%, 15%, or 20% depending on income. Short-term gains are taxed as ordinary income, which can be as high as 37%.
Consider this scenario: you have $20,000 in realized short-term gains and $15,000 in unrealized losses. By harvesting those losses, you reduce your taxable gains to $5,000. At a 32% tax bracket, that saves you $4,800 in federal taxes alone.
If your harvested losses exceed your gains, you can deduct up to $3,000 per year against ordinary income. Any remaining losses carry forward to future years indefinitely.
The Wash Sale Rule
The IRS has a rule to prevent abusive harvesting: the wash sale rule. It states that if you sell a security at a loss and buy a "substantially identical" security within 30 days before or after the sale, the loss is disallowed for tax purposes.
Key points about wash sales:
The 61-day window — The rule covers 30 days before and 30 days after the sale, creating a 61-day window total.
Substantially identical — This is not precisely defined by the IRS, but selling shares of the SPDR S&P 500 ETF and immediately buying the Vanguard S&P 500 ETF is risky. However, selling a broad US equity fund and buying an international equity fund is generally safe.
Across accounts — The wash sale rule applies across all your accounts, including IRAs. Buying the same stock in your IRA within 30 days of selling it at a loss in your brokerage account triggers a wash sale.
Crypto exception — As of 2025, cryptocurrency was brought under wash sale rules. Previously, crypto was exempt, but the IRS closed this loophole.
How to Implement TLH Effectively
Monitor your portfolio regularly — Losses are only useful if you harvest them before prices recover. Checking quarterly or using automated monitoring is essential.
Swap, do not exit — When you sell a losing position, replace it with a similar but not identical investment. This keeps your portfolio allocation intact while still capturing the tax benefit.
Prioritize short-term losses — Short-term losses offset short-term gains, which are taxed at higher rates. Harvest these first for maximum tax savings.
Keep records — Track your cost basis, sale dates, and any replacement purchases carefully. Tax software helps, but you need accurate data.
Consider the long-term picture — TLH defers taxes rather than eliminating them. When you sell the replacement investment later, your cost basis is lower, resulting in a larger gain. But the time value of money means deferring taxes is almost always beneficial.
Automating Tax-Loss Harvesting
Manually tracking every position for harvesting opportunities is tedious and error-prone. AI-powered platforms can monitor your entire portfolio continuously, identify optimal harvesting opportunities, execute the swaps, and keep track of wash sale windows automatically.
uptogAIn includes built-in tax-loss harvesting tools that scan your portfolio daily and alert you to harvesting opportunities, helping you keep more of what you earn.