Stock investors have been highly successful over the past decade. Even the coronavirus bear market in early 2020 didn't hold the market down for long.

The only downside to having big profits in stocks is that you often have to share them with the IRS at tax time. But what millions of taxpayers don't realize is that there's a provision in the tax laws that lets you sell stocks at a profit without having to pay any income tax. Below, we'll reveal how you can find out if you qualify for this strategy and what you have to do to use it.

Person whispering in the ear of a shocked-looking person.

Image source: Getty Images.

Think long term to get the IRS off your back

Taxpayers with long-term investing mindsets have gotten rewards from the IRS for a long time. Traditionally, there's been a distinction between the treatment of profits on long-term investment holdings versus profits on shorter-term investments.

Specifically, under current law, taxpayers get a tax break if they hold onto a stock or other investment for longer than one year. Sell before you've held a stock that long, and you'll pay whatever your ordinary income tax rate happens to be on any profits from the sale. Sell after, and you'll get a lower tax rate.

That long-term capital gains tax rate is lower for just about everyone. Those in the current top tax bracket of 37% only have to pay 20% on their long-term capital gains. Those in the 24% to 35% brackets get an even lower tax rate on long-term stock profits of just 15%.

But those who are in the lowest two tax brackets get the biggest break of all. Thanks to the current tax laws, these individuals don't have to pay any tax whatsoever on their long-term capital gains.

Tax-free stock profits

The tax laws include a 0% tax bracket on long-term capital gains up to a certain amount of total income. If you're single and all your taxable income adds up to $40,000 or less in 2020, then you won't have to pay any tax on your long-term capital gains. For joint filers, that amount is $80,000. Those who qualify for head of household status can have up to $53,600 in taxable income before they have to pay any taxes on their long-term capital gains.

That range covers a large number of Americans. About 19 million families made less than $40,000  in total income, according to the latest data from the Census Bureau. More than half of families -- 42 million -- had total income of less than $80,000.

Moreover, keep in mind that the break applies to taxable income. That number is less than total income because taxpayers generally get either a standard deduction or an itemized deduction that reduces their taxable income.

Use it or lose it

However, there's one thing to keep in mind: Your taxable income will include your profits from stock sales. Therefore, if you have so much in long-term capital gains that it takes you over the income limit, then you'll end up paying some tax on the excess. Again, though, the rate you pay will be lower than the corresponding rate on ordinary income. That takes some of the sting out of it.

2020 will be a highly popular year for this strategy. Many people's incomes are temporarily low because of coronavirus-related layoffs and work furloughs. That'll put them in lower income tax brackets that could let them fall into the 0% long-term capital gains tax range.

To use the strategy, all you have to do is sell stock at a gain. If you want, you can even buy it back right away in the hopes of seeing even more gains. Unlike with tax losses, there's no rule making you wait in order to claim gains -- even tax-free ones.

As you consider your year-end tax planning, you'll want to look at whether you can cash in on stock profits tax-free. If you can, it could save you money by avoiding higher taxes down the road.