If you sell an investment that you've owned for more than a year and it's gone up in value, then you'll owe taxes on your long-term capital gains. The tax laws favor long-term investors over those who trade in and out of stocks on a more frequent basis by charging lower tax rates on long-term gains.

The IRS just announced how long-term capital gains in 2020 will get taxed, and in many ways, it looks a lot like it did in past years. There will still be three tax brackets -- 0%, 15%, and 20% -- but the income thresholds at which each bracket will apply will go up slightly from 2019 levels. Below, we'll run through the process for figuring your long-term capital gains and then calculating the tax you'll owe.

How to figure out your long-term capital gains

Most of the time, determining how much you have in long-term capital gains is pretty straightforward. Take the amount of money you received when you sold your investment and subtract the amount you paid for it, and the net profit represents capital gains. If you sell both winning and losing investments in a given year, then you net out the gains and losses to come up with a final figure.

Three piles of coins with plants growing out of them.

Image source: Getty Images.

Sometimes, there's more work involved in figuring out your taxable gain. That's because some transactions that happen while you own an investment reduce what's known as its cost basis. As a result, your capital gain might end up being higher than it otherwise would. The IRS website provides some examples and other useful information about capital gains.

How much tax you'll pay

The next step to figure out your tax liability is to look at your overall income. You'll never pay more than the tax rate that applies to your ordinary income under the regular 2020 tax brackets. However, maximum tax rates apply to long-term capital gains that can reduce your tax burden. The chart below shows how those rates match up with income levels.

Filing Status

0% rate applies when taxable income is

15% rate applies when taxable income is

20% rate applies when taxable income is

Single

Less than $40,000

$40,000 to $441,450

More than $441,450

Married Filing Jointly

Less than $80,000

$80,000 to $496,600

More than $496,600

Head of Household

Less than $53,600

$53,600 to $469,050

More than $469,050

Married Filing Separately

Less than $40,000

$40,000 to $248,300

More than $248,300

Source: IRS.

There are some important things to keep in mind about these numbers:

  • The rates above act like brackets, so parts of your capital gains can get taxed at different rates. For instance, if you're single and your taxable income is $50,000, of which $20,000 is long-term capital gains, then you start by taking your regular income of $30,000. You then have $10,000 left before you hit the top of the 0% capital gains bracket, so you pay no tax on the first $10,000. The remaining $10,000 kicks you into the 15% bracket, so you'd pay 15% of $10,000 or $1,500. That works out to an effective rate of 7.5% on your capital gains.
  • High-income taxpayers are subject to a 3.8% surtax on net investment income. Long-term capital gains are included in the definition of such income and are therefore subject to that tax.
  • These figures apply only for federal tax purposes. States with income taxes have their own rules about capital gains.

Finally, the most important thing investors can remember is that the key to minimizing capital gains is to avoid selling when possible. That doesn't mean you should let taxes determine your investing strategy, and there are often good reasons to sell an investment even if it'll create a big tax bill. However, the threat of capital gains taxes should make you pause before selling out a position arbitrarily.

Be smart with your capital gains

Making money on your investments is great, but paying taxes isn't. Knowing about the taxes you'll pay when you sell a winning investment can help you plan more effectively and minimize what you have to give to the IRS.