Congratulations! You just sold an investment and made some money. But just like when you make money at your 9-to-5 job, the government wants a piece of your earnings.

The tax you pay on your investment income is called capital gains tax, and the rules are different from your standard income taxes. Understanding how capital gains taxes work is an essential part of learning how to invest. With some thoughtful planning, you can minimize the impact of capital gains taxes and keep more of your investment gains.

An adding machine and pencil on top of a pile of tax forms.
Image source: Getty Images.

Short-term vs. long-term capital gains tax on stocks

Short-term vs. long-term capital gains tax on stocks

The first thing you need to know about capital gains tax is that they come in two flavors: Short-term and long-term.

Long-term isn't really that long in this context. If you hold an investment for one year and a day, any gains on your holdings when you sell are considered long-term capital gains. If you hold for a year or less, the gains are considered short-term capital gains.

Importantly, you only get taxed on the gain from your investment, which is your selling price minus your original investment. You already paid taxes on the money you used to buy your original investment, so you don't need to pay taxes again.

Long-term capital gains receive preferential tax treatment, so if you're considering selling a stock for a big gain and it's been held for almost a year, you might consider holding off on the sale. That said, don't let taxes be the sole determining factor on when you sell an investment.

Short-term capital gains tax rates on stocks

Short-term capital gains tax rates on stocks

Short-term capital gains are taxed at the same rate as your income. When calculating your taxable income, there's no differentiation between your regular income and short-term capital gains. They all get lumped together and taxed at your standard income tax rate.

Here are the federal income/short-term capital gains tax rates for 2023.

Table source: Author. Data source: IRS.
Rate Single Married Filing Jointly Head of Household
10% $0-$11,000 $0-$22,000 $0-$15,700
12% $9,951-$44,725 $22,001 - $89,450 $15,701-$59,850
22% $44,726-$95,375 $89,451-$$190,750 $59,851-$95,350
24% $95,376-$182,100 $190,751-$364,200 $95,351-$182,100
32% $182,101-$231,250 $364,201-$462,500 $182,101-$231,250
35% $231,251-$578,125 $462,501-$693,750 $231,251-$578,100
37% >$578,125 >$693,750 >$578,100

Long-term capital gains tax rates on stocks

Long-term capital gains tax rates on stocks

Once you've held an investment for more than a year, you're in long-term capital gains territory.

Unlike short-term gains, long-term gains aren't lumped in with the rest of your income. They're on a separate tier and receive preferential tax rates. To determine your long-term capital gains tax bracket, you need to add up your regular income and short-term gains first. Your long-term capital gains tax bracket is based on how much your long-term gains add on top of those.

For example, if you file an individual tax return and had an adjusted gross income of $50,000, plus a $10,000 long-term capital gain, the entirety of your gain would get taxed in the 15% bracket. If you only had $30,000 of income before adding in your long-term capital gains, you'd be able to pay taxes in the 0% tax bracket.

Here are the long-term capital gains tax rates for 2023:

Table source: Author. Data source: IRS.
Rate Individual Married Head of Household
0% $0-$44,625 $0-$89,250 $0-$59,750
15% $44,626-$492,300 $89,251-$553,850 $59,751-$523,050
20% >$492,300 >$553,850 >$523,050

Capital gains tax by state

Capital gains tax by state

Most states tax capital gains — both short-term and long-term — at the same rate as regular income. However, nine states offer tax breaks for capital gains by either providing preferential tax treatment to long-term gains or allowing investors to exclude some of their gains from their taxable income.

The following nine states have preferential capital gains tax rates:

  • Arizona
  • Arkansas
  • Hawaii
  • Montana
  • New Mexico
  • North Dakota
  • South Carolina
  • Vermont
  • Wisconsin

Some states also offer preferential treatment, but only for investments in certain industries or for in-state investments.

There are nine states with no income tax that also don't tax capital gains:

  • Alaska
  • Florida
  • Nevada
  • New Hampshire
  • South Dakota
  • Tennessee
  • Texas
  • Washington
  • Wyoming

The five states taxing capital gains the most (based on their top income tax bracket) are:

  • California (13.3%)
  • New York (10.9%)
  • New Jersey (10.75%)
  • Oregon (9.9%)
  • Minnesota (9.85%)

Pros and cons of long- and short-term capital gains tax

Pros and cons of long- and short-term capital gains tax

Capital gains taxes are very different from income taxes, and both long-term and short-term gains can provide some benefits. They also come with a few drawbacks.

Pros

Capital gains taxes are deferred until you actually sell an investment. So, if you have a $50,000 gain on paper, you don't actually have to pay taxes on that gain until you sell the investment. Importantly, you can sell just part of the investment every year to keep your annual tax burden low if you don't mind holding it for a long time. 

This can be a benefit for short-term capital gains. If you make an investment mid-year and it goes straight up, you can defer selling until January and may not have to pay any capital gains taxes until April of the following year.

Another advantage is the preferential tax rates for long-term capital gains. Investors who buy and hold are rewarded with significantly lower tax rates on their gains. Over time, those savings add up.

Cons

A big negative of capital gains taxes is that they cut into your return on investment. You may have just sold a stock for a 20% gain, but, after state and federal taxes, your gain may be significantly lower.

The lower tax rate for long-term capital gains can provide a perverse incentive to hold investments for too long. If you make an investment and your holdings appreciate quickly, you may want to take some money off the table regardless of the tax consequences.

You also may require an extra level of tax planning for capital gains to minimize taxes, or capital gains taxes could force you to pay more for tax preparation.

Strategies for minimizing capital gains tax on stocks

There are several strategies you can use to minimize your capital gains taxes.

  1. Buy stocks you plan to hold for at least one year. Long-term capital gains tax rates are always lower than taxes on short-term gains. Pushing more of your capital gains into the long-term tax brackets will allow you to keep more of your investments.
  2. Offset your gains with losses. If you have losing investments, you can sell them and use the losses to offset your capital gains. You must be mindful of the wash sale rule, especially if you plan to buy back the losing investment.
  3. Take full advantage of the 0% long-term capital gains tax bracket. If you have a low enough income in any year to pay 0% on capital gains, you should be selling investments. Even if you plan to stay invested in an asset, you can sell and rebuy an investment since the wash sale rule doesn't apply to capital gains. That allows you to lock in a higher cost basis, reducing your capital gains tax liability in the future.
  4. Donate your most-appreciated assets to charity. You get to write off the full value of the stock at the time of donation, and you don't have to pay capital gains taxes on the appreciation.
  5. Only for the advanced: Borrow against your portfolio. You can defer capital gains taxes by borrowing against your holdings and using a margin account for your spending. You could, in fact, defer your taxes all the way until you die, at which point your heirs will receive your stock holdings at a stepped-up cost basis, reducing the tax liability to $0. They could then sell some of the assets and pay off your debt.

All about capital gains taxes

No matter what, the government requires you to pay taxes on your capital gains. If you're more aware of how capital gains are taxed and how your other income affects their tax rate, you can plan better and keep more of your investment gains. Minimizing the taxes on your investments could help you reach your financial goals a lot sooner, so it pays to know about capital gains taxes.

Related investing topics

FAQ

What is a capital gains tax?

angle-down angle-up

A capital gains tax is a tax on the appreciation of an investment. The tax is incurred upon the sale of an asset.

How much is the capital gains tax? 

angle-down angle-up

Short-term (one year or less) capital gains are taxed at your regular income tax rate. Long-term capital gains are taxed between 0% and 20%, with most individuals paying 15%. Many states will tax capital gains at your ordinary income tax rate, but a few offer preferential treatment for long-term capital gains.

How can I legally reduce my capital gains taxes?

angle-down angle-up

Holding your investments for at least a year and one day allows you to pay the lower long-term capital gains tax rates. You can also offset capital gains with capital losses. Donating appreciated assets allows you to write off the full value of the asset, and you also won't have to pay any capital gains tax.

How does the capital gains tax work?

angle-down angle-up

When you sell an investment for a gain, you pay taxes on the amount of appreciation. You won't pay any taxes on the cost basis (what you paid for the original investment).

When do you pay the capital gains tax?

angle-down angle-up

You pay capital gains tax in the year you sell the investment. You may have to make an estimated tax payment in the quarter you make the sale to avoid an underpayment penalty.

The Motley Fool has a disclosure policy.