Capital gains tax is the tax you owe when you sell an investment for more than you paid for it

When you buy a stock, bond, rental property, or other investment and sell it later for a profit, that profit is called a capital gain. The IRS taxes that gain as income. The amount you owe depends on how long you held the investment before selling it, your total income for the year, and your filing status. You do not owe capital gains tax on investments you still own — only on the ones you actually sell.

The tax applies to nearly any investment: individual stocks, mutual funds, real estate, cryptocurrency, collectibles, and business interests. It does not explore to money in a regular savings account or money market fund, because those are not considered investments for tax purposes. If you sell an investment at a loss, you cannot owe capital gains tax on that sale, though you may be able to use the loss to reduce taxes on other gains.

Key Takeaways

  • Capital gains tax applies only when you sell an investment for more than you paid for it, not while you own it.
  • Long-term capital gains (held over one year) are taxed at lower rates than short-term gains, which are taxed as ordinary income.
  • Your capital gains tax rate depends on your income level and filing status, not on how much profit you made.
  • You report capital gains on Schedule D of your tax return, which feeds into your Form 1040.

The difference between long-term and short-term capital gains

The IRS divides capital gains into two categories based on how long you owned the investment before selling it. If you held it for one year or less, it is a short-term capital gain. If you held it for more than one year, it is a long-term capital gain. This distinction matters because the tax rates are very different.

Short-term capital gains are taxed as ordinary income, using the same tax brackets as your wages or salary. If you are in the 24% tax bracket, your short-term gains are taxed at 24%. Long-term capital gains are taxed at lower rates: 0%, 15%, or 20%, depending on your income and filing status. These rates are much lower than ordinary income rates. For example, if you are in the 24% ordinary income bracket, your long-term capital gains might be taxed at only 15%.

The holding period starts the day after you buy the investment and ends the day you sell it. If you buy a stock on January 15 and sell it on January 16 of the next year, you have held it for more than one year, so it qualifies as a long-term gain.

How the tax rate is determined by your income level

Your capital gains tax rate is not based on how much profit you made. It is based on your total taxable income for the year and your filing status. The IRS sets income thresholds that determine which rate applies to you.

For long-term capital gains in 2024, the thresholds vary by filing status. A single filer pays 0% on long-term gains up to a certain income level, then 15% above that level, then 20% at a higher level. Married filing jointly filers have higher thresholds, so they can have more income before moving into the 15% or 20% bracket. The exact dollar amounts change each year because they are adjusted for inflation. You can find the current year's thresholds on the IRS website or in the instructions to Schedule D.

This means two people who sell the same stock for the same profit can owe different amounts of tax, depending on their other income. If one person has $40,000 in wages and the other has $150,000 in wages, they will fall into different capital gains brackets.

What counts as your cost basis and how to calculate your gain

Your cost basis is the original price you paid for the investment, plus any fees or commissions you paid to buy it. When you sell, you subtract your cost basis from the sale price to find your capital gain or loss. If you paid $5,000 for a stock (including a $50 commission) and sold it for $7,200, your cost basis is $5,050 and your gain is $2,150.

Cost basis gets more complicated if you received the investment as a gift or inheritance. If someone gave you stock, your cost basis is usually the price they paid for it, not the price on the day you received it. If you inherited stock, your cost basis is usually the market price on the date the person died, not what they originally paid. This is called a "step-up in basis" and can significantly reduce your tax bill.

If you own mutual funds or stocks and reinvest your dividends, each reinvestment increases your cost basis. Your brokerage firm tracks this and provides a cost basis report when you sell. Keep this report with your tax records.

How to report capital gains on your tax return

You report capital gains on Schedule D, which is a form that lists all your investment sales for the year. Schedule D separates short-term gains from long-term gains. For each sale, you list the date you bought it, the date you sold it, the sale price, your cost basis, and your gain or loss.

Your brokerage firm sends you a Form 1099-B after the year ends, which shows all the sales you made during the year. The information on this form should match what you put on Schedule D. If there are differences, the IRS will notice, so accuracy matters.

Once you complete Schedule D, the totals transfer to your Form 1040 (the main tax return form). Your short-term gains are added to your ordinary income and taxed at your regular rate. Your long-term gains are reported separately and taxed at the preferential long-term rates. If your total capital losses exceed your total capital gains, you can deduct up to $3,000 of the net loss against your ordinary income in that year. Any loss above $3,000 carries forward to future years.

State and local taxes on capital gains

The federal capital gains tax is only part of the picture. Most states also tax capital gains, usually as part of their ordinary income tax. A few states have no income tax at all, so residents pay only federal capital gains tax. A handful of states tax capital gains separately from ordinary income, sometimes at a different rate.

Some cities and counties also impose local income taxes that explore to capital gains. If you live in New York City or certain other municipalities, you will owe local tax in addition to state and federal tax. The total tax on a long-term capital gain can range from just the federal rate (if you live in a no-income-tax state) to the federal rate plus state plus local, which can add 10% or more to your bill.

Frequently Asked Questions

Do I owe capital gains tax if I sell an investment at a loss?

No. If you sell an investment for less than you paid for it, you have a capital loss, not a gain. You can use capital losses to reduce capital gains from other sales. If your losses exceed your gains, you can deduct up to $3,000 of the net loss against your ordinary income in that year.

What if I inherited stock or real estate?

Inherited investments receive a "step-up in basis," meaning your cost basis is the market value on the date the person died, not what they originally paid. If you sell the inherited investment shortly after inheriting it, you will owe little or no capital gains tax, even if the original owner bought it decades earlier at a much lower price.

Do I have to pay capital gains tax on my primary home?

No, if you meet certain requirements. If you are single, you can exclude up to $250,000 of gain from the sale of your primary home. If you are married filing jointly, you can exclude up to $500,000. You must have owned and lived in the home for at least two of the last five years before the sale.

What if I day-trade stocks — do I still pay capital gains tax?

Yes, but the IRS may classify you as a "trader" rather than an investor if you buy and sell frequently. Traders pay tax on short-term gains at ordinary income rates, just like other investors. However, traders can deduct trading expenses that regular investors cannot, and they may be able to use a different accounting method. Consult a tax professional if you trade actively.

Can I avoid capital gains tax by not selling?

Yes. You owe capital gains tax only when you sell. If you hold an investment until you die, your heirs receive it with a step-up in basis, and they owe no tax on the gain that occurred during your lifetime. However, this strategy only works if you can afford to hold the investment indefinitely.