If you've been investing for any length of time, you've probably experienced the sting of watching a position lose value. While losing money is never fun, there's a silver lining that savvy investors have been using for decades: tax loss harvesting. Understanding the rules around this strategy can save you thousands of dollars in taxes each year — but get them wrong, and you could end up with an unexpected tax bill and disallowed losses. This guide breaks down everything you need to know about tax loss harvesting rules, including the critical wash sale rule and the 30 day rule that trips up so many investors.
Tax loss harvesting is the practice of selling investments that have declined in value to realize a capital loss, which can then be used to offset capital gains elsewhere in your portfolio. In simple terms, you're turning a paper loss into an actual, reportable loss that reduces your tax liability. The IRS allows investors to use these losses to offset capital gains dollar for dollar, and if your losses exceed your gains, you can even deduct up to $3,000 of net capital losses against ordinary income each year.
For example, imagine you have a $10,000 gain from selling shares of a tech company in 2024. If you also have another investment sitting at a $6,000 loss, you could sell that losing position to offset $6,000 of your gain. Instead of paying taxes on $10,000, you'd only owe taxes on $4,000. That could represent savings of anywhere from $600 to over $2,000 depending on your tax bracket and whether the gain is short-term or long-term.
The IRS doesn't hand out free tax breaks without conditions. There are several important tax loss harvesting rules that govern how and when you can use this strategy. Violating these rules — even unintentionally — can result in disallowed losses and missed savings opportunities.
Not all losses are created equal, and this is one of the most important tax loss harvesting rules to internalize. Capital losses are categorized as either short-term (assets held for one year or less) or long-term (assets held for more than one year). These categories matter because they must first offset gains of the same type before they can cross over.
This structure means that harvesting short-term losses is typically more valuable because it offsets income that would otherwise be taxed at the highest rates. A $5,000 short-term loss for someone in the 32% bracket could save $1,600 in federal taxes, while the same long-term loss might only save $750 if it offsets long-term gains at the 15% rate.
If your capital losses exceed your capital gains in a given year, you can deduct up to $3,000 of the remaining net loss from your ordinary income. This limit applies to both single filers and married filing jointly. For married filing separately, the limit drops to $1,500 per person. Any losses beyond $3,000 don't disappear — they carry forward indefinitely to future tax years, where they can offset future gains or be used against that year's income limit.
No discussion of tax loss harvesting rules would be complete without a thorough explanation of the wash sale rule, which is the regulation most likely to catch investors off guard. The wash sale rule is an IRS provision designed specifically to prevent investors from claiming artificial losses while maintaining essentially the same investment position.
Under the wash sale rule, if you sell a security at a loss and then buy a "substantially identical" security within a specific window of time, the IRS will disallow the loss. You won't be able to claim it on your taxes that year. This sounds straightforward, but the details can get complicated quickly.
The IRS has never provided a precise legal definition of "substantially identical," which creates some gray areas. However, there are clear-cut cases and common interpretations that investors rely on.
The wash sale rule also applies across different account types. If you sell a losing position in your taxable brokerage account and then buy the same security in your IRA within the wash sale window, the loss is still disallowed — and in this case, the disallowed loss is permanently lost because it can't be added to the IRA's cost basis.
The 30 day rule is really a "61-day window" that often gets shortened in casual conversation. Here's the precise rule: you cannot buy the substantially identical security 30 days before the sale or 30 days after the sale. That creates a total window of 61 days during which the wash sale rule can be triggered — 30 days before, the day of the sale itself, and 30 days after.
Let's walk through a concrete example. Say you purchased 100 shares of XYZ Corp at $50 per share ($5,000 total) and the stock has dropped to $35 per share ($3,500 total). You decide to harvest the $1,500 loss on November 15th. Under the 30 day rule:
This 30 day rule creates a particular challenge near the end of the calendar year. Many investors want to harvest losses in late December for the current tax year, but the 30-day waiting period means they can't repurchase until late January. During that month, the market could move significantly, and you might miss out on a recovery in the position you sold.
If you do trigger the wash sale rule, the disallowed loss doesn't disappear permanently in most cases. Instead, it gets added to the cost basis of the replacement shares you purchased. This effectively defers the loss until you eventually sell the replacement shares in a qualifying transaction.
For example, if you sell shares at a $2,000 loss and then repurchase within the 30 day window at $35 per share, that $2,000 disallowed loss gets added to your new cost basis. So if you paid $35 per share and had a $2,000 disallowed loss spread across 100 shares, your adjusted cost basis would become $55 per share instead of $35. The loss isn't gone — it's just deferred. However, if the repurchase happens in an IRA, as mentioned earlier, the loss is gone for good.
Understanding the rules is one thing; implementing a strategy that works around them is another. Here are proven approaches that investors use to harvest losses effectively while navigating tax loss harvesting rules.
One of the most popular strategies is selling a losing investment and immediately buying something similar but not substantially identical. This keeps your market exposure intact while locking in the tax loss. For example:
This approach lets you maintain your overall investment strategy and market exposure while still capturing the tax benefit. After the 30 day window passes, you can switch back to your original holding if you prefer it.
Many investors make the mistake of treating tax loss harvesting as an end-of-year activity. In reality, the most effective practitioners monitor their portfolios throughout the year and harvest losses whenever a significant decline occurs. Market corrections, sector-specific downturns, and individual stock drops all create opportunities that may not exist in December if the market recovers.
Proper record-keeping is essential when implementing tax loss harvesting. You need to track purchase dates, purchase prices, sale dates, and sale prices across all your accounts to avoid accidentally triggering the wash sale rule. Most modern brokerage platforms do this automatically, but it's wise to maintain your own records as well, especially if you invest across multiple platforms or account types.
Tax loss harvesting isn't equally valuable for everyone. The strategy provides the greatest benefit to investors in higher tax brackets, particularly those with significant short-term capital gains taxed at ordinary income rates. If you're in the 10% or 12% tax bracket, your long-term capital gains rate may already be 0%, meaning you have little to gain from harvesting losses against those gains.
High-income investors, active traders, and anyone who has sold a business, property, or large stock position in a given year are typically the best candidates for tax loss harvesting. That said, even moderate-income investors can benefit from building up loss carryforwards that offset future gains as their wealth grows over time.
For investors who don't want to actively monitor their portfolios, robo-advisors and automated investing platforms now offer automated tax loss harvesting as a feature. Services like Betterment and Wealthfront scan portfolios daily for harvesting opportunities and execute trades automatically while staying within the wash sale rule guidelines. While these services charge fees, the tax savings they generate can often exceed their cost for investors with taxable accounts of $100,000 or more.
Tax loss harvesting, when executed correctly with a thorough understanding of the wash sale rule and 30 day rule, is one of the most powerful tax planning tools available to individual investors. It doesn't require market timing, stock picking, or exotic financial products — just discipline, good record-keeping, and a solid understanding of the rules outlined here. Whether you're managing a $50,000 portfolio or a $5 million one, taking the time to implement these strategies can meaningfully improve your after-tax returns over time.
Use our free tax loss harvesting calculator to see exactly how much you could save.
Try the Calculator →This article is for educational purposes only and does not constitute tax or investment advice. Consult a qualified tax professional before making investment decisions.