With the market rallying in recent months -- even as coronavirus cases continue spiking and lawmakers keep failing to provide more COVID-19 stimulus money -- there's ample reason to believe stocks are in a bubble right now. And that's a problem, because bubbles burst

For long-term investors, a potential market crash is nothing to fear -- especially if you've done your research and built a diversified portfolio full of shares of rock-solid companies. But even the best investors could find themselves with some losers, which are likely to perform especially poorly during a market downturn.

The good news is, there is one silver lining if the bubble bursts and the market plummets: It could help you save on taxes.

1040 form with pen and calculator sitting on it.

Image source: Getty Images.

How a market bubble burst could help you lower your IRS bill

So, how could a stock market bubble burst help you reduce the amount you send to Uncle Sam? It's simple: It presents an opportunity for tax loss harvesting

Tax loss harvesting involves selling losing investments and claiming those losses on your taxes. They can be used to offset capital gains taxes, if you owe them on successful investments. They can also reduce other taxable income. However, while there is no limit on the value of capital losses you can deduct from capital gains, your losses can only reduce other taxable income by $3,000 per year. The good news is that the losses can carry over. That means if the market crashes and you sell a stock you lost $5,000 on, you could reduce any capital gains you're claiming by up to the full amount of that $5,000. Or, if you have no capital gains this year, you could deduct $3,000 from your other taxable income, and carry over the remaining $2,000 and deduct it next year. 

Of course, you don't have to wait for a market crash to sell investments at a loss and benefit from tax loss harvesting -- you can sell them any time. And, in fact, if you have a poorly performing investment you don't believe will recover, you may not want to wait for a crash to sell, as falling share prices after a bubble burst could mean even bigger losses. While that would increase the tax savings from tax loss harvesting, it makes little sense to absorb a larger loss than you need just to reduce your IRS bill. 

You also don't want to panic sell solid investments during a market crash, even if the share price falls temporarily, as recoveries inevitably follow downturns. You don't want to make those losses permanent if you still feel confident the investment is a good one and you're content to hold it long-term through the crash. And while you can sell at a loss and buy the stock back if you still want to own the asset, the "wash sale rule" requires you to wait at least 30 days before repurchasing or you can't harvest the loss. 

However, if a crash exposes weaknesses in your portfolio and you suffer losses on stock shares for companies you no longer believe in because economic conditions or business fundamentals have changed, tax loss harvesting is the bright spot in a bad situation. And if you have losing investments you feel will perform especially poorly when the market bubble bursts, you can always sell them at a loss at the start of the downturn, score your tax savings, and buy back in after 30 days have passed -- when, hopefully, the crash has sent the share price plummeting to even lower depths and you can rebuy your shares at a bargain.