The goal of every investor is to make money on their investments. However, when you sell an investment at a profit, you'll discover who else has an interest in sharing in your success: the tax man. The federal government imposes taxes on most capital gains from winning investments, and that means that you'll usually have to split your profits with the Internal Revenue Service.

Capital gains taxes are more complicated than you'd think, because a host of special tax law provisions apply to them. You'll find tax rates and brackets for capital gains income that differ from the rates and brackets that apply to most other types of income, due in part to an oddity in the tax reform laws that passed in late 2017. Moreover, even within the realm of capital gains, different tax rates apply to various types of investments. Below, we'll give you the complete picture of everything you need to know to understand capital gains taxes and what you can do to pay as little as you can.

Keyboard with blue tax button.

Image source: Getty Images.

What are capital gains?

Capital gains are the profits that you earn when you sell a piece of property or an investment for a higher price than you paid for it. With most publicly traded investments, such as shares of stock, mutual funds, or exchange-traded funds, it's pretty easy to determine whether you'll have a capital gain upon their sale. If the price has gone up since you bought your shares, you'll have a capital gain, and if the price has gone down, you'll have a capital loss.  

For instance, say that you paid $90 per share for 100 shares of a stock. Subsequently, the share price goes to $100, and you decide to sell. In that case, you'd have a capital gain of $10 per share, or $1,000 for your entire position.

What are capital gains taxes?

Capital gains taxes are the tax liability that the federal government charges on capital gains. Some state income tax agencies also levy capital gains taxes at the local level, adding to your total tax burden.

Capital gains taxes have some features that are different from the way that many other taxes work. The most valuable for investors is that you don't have to pay capital gains taxes until you actually sell your investment. Put another way, no matter how much an investment that you own has risen in value, you won't have to pay any taxes on those gains for as long as you hold onto the investment. That's a lot different from how investment income like interest and dividends gets treated, with investors typically having to pay tax right away on that income even if they end up reinvesting it back into the same investment. This favorable treatment of capital gains taxes gives investors a lot of flexibility in timing their sales in a manner that can produce less tax liability.

In addition, as you'll see in more detail below, the tax rates that apply to capital gains tend to be lower than the rates on other types of income, such as wages and salaries or interest income. That hasn't always been the case, but tax law changes over time have sought to give investors preferential treatment in order to encourage participation in the financial markets and provide businesses with access to investment capital.

What types of investments are subject to capital gains taxes?

There are two big categories of assets that are subject to taxes on capital gains. The first encompasses the broad range of investment assets. Just about anything that you can invest in with an aim toward selling it to another investor at a higher price at some point in the future is later subject to capital gains tax.

The other category is real estate. Some people make investments in real estate, in which case it falls into both categories. However, even those who only own a personal residence that they live in are still subject to potential capital gains tax liability when they sell their home. Fortunately, most homeowners qualify for exemptions that allow them to pay no tax on capital gains of up to $250,000 for single filers and $500,000 for joint filers.

The primary exception to capital gains tax treatment involves those who are in the business of selling a particular type of asset. For them, any profits are treated as ordinary business income rather than capital gains. For example, if you're a real estate developer, you generally can't claim capital gains tax treatment on your profits when you sell a piece of property. Similarly, owners of a gold coin dealership have to treat the profit on coins they hold in inventory as regular income rather than capital gains.

What tax rates apply to different types of capital gains?

To make things even more complicated, different tax rates apply in different situations involving capital gains. The first and most important factor in determining the appropriate tax rate is how long you held the investment in question. If you own an investment for a year or less, then the IRS classifies it as a short-term capital gain. Own it for at least a year and a day or longer, and you'll have a long-term capital gain instead.

The tax treatment of short-term capital gains is relatively simple, because there's a rule that applies in every instance: Short-term capital gains are taxed at the same rates as any other type of ordinary income. In other words, there's no preferential treatment for short-term capital gains. Whatever tax bracket you fall into based on your total income is what you'll end up paying on your capital gains, because those short-term gains will essentially just get added directly to your other income. That's because lawmakers wanted to give investors an incentive to make longer-term investments -- and even though many would quibble about whether a year and a day is truly "long term" from an investment perspective, it's good enough for the IRS.

For long-term capital gains rates, though, lower rates are available. For most people, three potential tax rates -- 0%, 15%, or 20% -- apply to long-term capital gains, depending on the taxpayer's overall income level for the particular year in question. The table below gives the appropriate taxable income levels depending on tax filing status for 2018.

Long-term capital gains taxes for 2018

Filing Status

0% Rate Applies

15% Rate Applies

20% Rate Applies

Single

Up to $38,600

$38,600 to $425,800

Above $425,800

Married Filing Jointly

Up to $77,200

$77,200 to $479,000

Above $479,000

Head of Household

Up to $51,700

$51,700 to $452,400

Above $452,400

Married Filing Separately

Up to $38,600

$38,600 to $239,500

Above $239,500

Data source: IRS. Rate thresholds are based on taxable income.

From this table, there are a few particularly useful pieces of information you can learn:

  • For those with relatively low income levels, capital gains can actually be tax-free to the extent that the 0% rate applies.
  • Capital gains can actually get taxed at different rates. For example, say that you have $40,000 in taxable income in a given year, all from capital gains. In that case, the first $38,600 would be subject to the 0% rate, with the remaining $1,400 having the 15% rate apply.
  • Under previous tax law, the amounts above roughly corresponded to what's currently the 10% to 12% ordinary income tax bracket, the 22% to 35% bracket, and the 37% bracket. The threshold numbers are actually off by as much as a few hundred dollars, however, because the capital gains thresholds are still derived from laws from before lawmakers passed tax reform.

However, not all capital gains get to use the table above. There are two main categories of assets that get different treatment. The first involves collectibles, including art, antiques, jewelry, precious metals, and similar items. For profits from the sale of collectibles, the taxpayer's ordinary income tax rate applies, subject to an overall maximum of 28%. So if you're in a lower bracket than 28%, then that's the tax rate you'll pay, but those in a higher bracket will see their capital gains taxes limited to the 28% rate.

The other special situation involves real estate and depreciation. When investors own real estate, they're often allowed to take depreciation deductions against income to reflect the steady deterioration in the value of property as it ages. The way the tax laws work, because you're allowed to deduct depreciation, it reduces the amount that you're treated as having paid for the property in the first place. For example, if you paid $100,000 for a building and you're allowed to claim $5,000 in depreciation, then you'll be treated subsequently as if you'd paid $95,000 for the building.

If you then go on to sell the real estate, then a portion of the capital gains is treated as recapturing those depreciation deductions. The tax rate that applies to the recaptured amount is 25%. So in the example above, if the person sold the building for $110,000, then there'd be total capital gains of $15,000, $5,000 of which would be treated as recapture and taxed at 25%. The remaining $10,000 would be taxed at the 0%, 15%, or 20% indicated above.

How are capital gains taxes calculated?

In order to calculate capital gains taxes, you have to go through several steps:

  • Identify positions in which you have a capital gain or capital loss.
  • Sort out the gains and losses by whether they're short- or long term.
  • In each category, use losses to offset gains and come up with a net gain or loss. Then if you have a gain in one category and a loss in the other, come up with an overall net figure across both short- and long-term gains and losses.
  • Apply the appropriate tax rate to the result.

The first step involves taking all the investments and real estate that you sold during the year and figuring the capital gain or loss on each position. You'll also need to gather information on when you purchased the investment, because that will help you with the next step of sorting each gain or loss by whether it's short-term or long-term.

Once you've done this, you'll have up to four categories: short-term gains, short-term losses, long-term gains, and long-term losses. First, take the gains and losses from each category and come up with a net figure. So if you had short-term gains of $1,000 and short-term losses of $800, then you'd have a net short-term gain of $200. Similarly, if you had total long-term gains of $800 and long-term losses of $900, you'd finish with a net long-term loss of $100.

If one figure is a loss while the other is a gain, then you'll take the further step of coming up with an overall net number. In the example above, the $100 long-term loss could cancel part of the $200 short-term gain, leaving an overall short-term gain of $100. If you have gains in both categories, then you'll need to keep both separate, because the tax rate on each will be different.

The final step is to take whatever gains are remaining and calculate the tax. When it comes to preparing your tax return, this requires the use of a capital gains worksheet, because even though you include capital gains in your overall adjusted gross income, the worksheet is the vehicle by which you get to apply favorable tax rates. Although the worksheet is long, the net impact is to impose the tax rates mentioned above, depending on the category into which your particular capital gains fall.

How can I reduce my capital gains taxes?

Now that you know the ins and outs of capital gains taxes, the obvious question is what you can do to reduce them. Fortunately, there are several tactics you can use to reduce the amount of tax you'll have to pay on any capital gains.

The first and easiest that any investors can use is to be smart about timing when you decide to sell a winning investment. Remember, as long as you continue to hold onto the stocks, bonds, funds, or other assets on which you have a paper gain, you won't have to pay any capital gains tax on the increase in their value. It's only when you cash in that you'll have to face the tax man, and that decision almost always rests solely with you.

Second, do whatever you can to earn favorable long-term capital gains tax treatment by holding on to your investments for longer than one year. In particular, if you've held an investment for nearly a year, it can often be worth it to delay selling it until you've gone over the one-year mark -- especially if doing so qualifies you for the extremely favorable 0% rate on long-term capital gains. That said, if something has fundamentally changed with your investment and you no longer have confidence that it will remain a winner in the long run, then it can be dangerous to hold on and risk losses if something bad happens to the investment. As much as you don't want to pay taxes unnecessarily, it's better to pay a higher tax rate on a profit than to lose the profit entirely if the stock drops.

Third, take full advantage of the ability to offset capital losses against capital gains. Especially toward the end of the year, many investors look for losing investments that they can sell in order to cash in the tax losses and use them to save on potential capital gains tax. This strategy, known as tax-loss harvesting, has to be done by the end of the year in order to be effective for the current tax year. In addition to generating a nice tax benefit, selling losing investments can also serve to get you out of positions that didn't turn out the way you had initially hoped.

Fourth, coordinate your capital gains with your other taxable income. If you can wait to sell winning investments until a year in which your other income is relatively low, then your total income will let you qualify for lower capital gains tax rates. Selling in a high-income year, on the other hand, could force you to pay higher rates -- even though they'll still be more favorable on long-term capital gains than on your other income.

Finally, make sure to take maximum advantage of tax-favored investments accounts that offer tax-free or tax-deferred treatment. When you hold investments in retirement accounts like IRAs or 401(k) plans, the sales of investments you make inside those accounts don't incur capital gains tax. Instead, any tax is deferred until you actually withdraw money out of the retirement account -- and with a Roth IRA or Roth 401(k), even those withdrawals can be free of tax. Paying a lower capital gains tax rate is nice, but it's even nicer not to have to pay tax at all when you sell -- and tax-favored investment accounts let you do exactly that.

Enjoy your capital gains!

There's nothing better than a winning investment, and even though you'll likely have to share some of your profits with the IRS, you shouldn't let capital gains taxes get you down. By taking steps to minimize the impact of capital gains taxes, you'll be able to put yourself in position to keep as much of your hard-won investment gains as you possibly can.