What you owe depends on how long you held the asset and your total income

Capital gains tax is calculated as a percentage of your profit, but the rate changes based on two things: how long you owned the asset before selling it, and your total taxable income for the year. The IRS taxes long-term gains (assets held over one year) at lower rates than short-term gains (assets held one year or less). Short-term gains are taxed like ordinary income — at rates between 10% and 37% depending on your tax bracket. Long-term gains are taxed at 0%, 15%, or 20% depending on your income level.

Your actual tax bill also depends on state taxes, which vary widely. Some states charge no capital gains tax at all. Others tax capital gains as regular income. A few states have separate capital gains tax rates. You calculate federal tax first, then add your state's tax on top.

Key Takeaways

  • Short-term capital gains (assets held one year or less) are taxed at your ordinary income tax rate, which ranges from 10% to 37% federally.
  • Long-term capital gains (assets held over one year) are taxed at 0%, 15%, or 20% federally, depending on whether your income falls into the lower, middle, or upper bracket.
  • Your state may add its own capital gains tax on top of federal tax, ranging from 0% to over 13% depending on where you live.
  • The tax is calculated only on your profit (sale price minus what you paid), not on the full sale price.
  • You report capital gains on Schedule D of your tax return, and the IRS matches it against your brokerage records.

Long-term capital gains tax rates for 2024

Long-term gains are taxed at three federal rates. Which rate applies to you depends on your taxable income for the year. These income thresholds change annually and differ based on whether you file as single, married filing jointly, head of household, or another status.

For 2024, the long-term capital gains brackets are:

Tax RateSingle FilersMarried Filing JointlyHead of Household
0%Up to $47,025Up to $94,050Up to $62,975
15%$47,025 to $518,900$94,050 to $583,750$62,975 to $551,350
20%Over $518,900Over $583,750Over $551,350

These thresholds are based on your total taxable income for the year, including wages, interest, dividends, and other income. If you sell an investment and your total income for the year falls in the 0% bracket, you owe no federal capital gains tax on that sale. If your income spans two brackets, part of your gain is taxed at one rate and part at the other.

Short-term capital gains tax rates

Short-term gains are taxed as ordinary income, meaning they use the same tax brackets as your wages or salary. The federal rates for 2024 range from 10% to 37%, depending on your income level and filing status. Because short-term gains are added to your other income, they can push you into a higher tax bracket.

For example, if you earn $60,000 in wages and sell a stock you held for six months for a $20,000 profit, your taxable income is $80,000. That $20,000 gain is taxed at whatever rate applies to income between $60,000 and $80,000 in your bracket. If you are single, that is the 22% bracket for 2024.

This is why timing matters: holding an asset just long enough to may have access to for long-term treatment can cut your tax rate significantly. A $20,000 gain taxed at 22% costs $4,400. The same gain taxed at 15% (long-term rate) costs $3,000.

How state capital gains taxes work

Twenty-one states charge no capital gains tax at all. These include Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming. Nine states tax capital gains as ordinary income, meaning they use their regular income tax brackets. These include California, Connecticut, Illinois, Maine, New Jersey, New York, Oregon, Vermont, and Washington, D.C.

A smaller group of states — including Colorado, Delaware, Hawaii, Iowa, Kansas, Kentucky, Louisiana, Maryland, Mississippi, Missouri, Montana, Nebraska, New Hampshire, New Mexico, North Carolina, Ohio, Oklahoma, Rhode Island, South Carolina, Utah, and Virginia — tax capital gains at their regular income tax rates or have separate capital gains rates. Rates vary from about 3% to over 13% depending on the state and your income level.

If you live in a state with capital gains tax and sell an investment, you owe both federal and state tax. A $50,000 long-term gain might be taxed at 15% federally ($7,500) and 10% by your state ($5,000), for a combined $12,500 bill.

Calculating your actual tax bill

Start with your profit: the sale price minus your original cost (called your basis). If you bought 100 shares at $50 per share and sold them at $75 per share, your profit is $2,500. You owe tax only on that $2,500, not on the full $7,500 sale price.

Next, determine whether the gain is short-term or long-term. If you held the asset for more than one year before selling, it is long-term. One year or less is short-term. The holding period starts the day after you buy and ends the day you sell.

Then find your tax rate. For long-term gains, look up your filing status and total taxable income in the brackets above. For short-term gains, use your ordinary income tax bracket. Multiply your gain by the rate. If you have both types of gains in the same year, calculate each separately and add them together.

Finally, add your state tax if your state charges one. Check your state's tax department website for the current rate and brackets.

Special situations that change what you owe

If you have capital losses in the same year, you can subtract them from your gains. If your losses exceed your gains, you can deduct up to $3,000 of the net loss against your ordinary income. Any loss beyond $3,000 carries forward to future years.

If you inherit an investment, you receive a step-up in basis. This means your cost basis becomes the asset's value on the date of death, not what the original owner paid. If the original owner bought a stock for $10 and it was worth $100 when they died, your basis is $100. If you sell it immediately for $100, you owe no capital gains tax.

Certain investments receive preferential treatment. may have access to dividends are taxed at the same rates as long-term capital gains, even if you have not held the stock for a year. Collectibles (art, coins, precious metals) are taxed at a flat 28% federal rate regardless of holding period. Real estate used as your primary home can exclude up to $250,000 of gain if you meet specific ownership and use tests.

How the IRS tracks your gains and losses

When you sell an investment through a broker, the broker reports the sale to the IRS on Form 1099-B. This form includes the sale price and, in most cases, your cost basis. You report your capital gains and losses on Schedule D of your tax return. The IRS matches your Schedule D against the 1099-B forms it receives from brokers, so underreporting is quickly flagged.

If you sold an investment before 2014 or through a broker that does not track basis, you may need to calculate and report your basis yourself. Keep records of your original purchase price, date of purchase, date of sale, and sale price. If you cannot find the original purchase price, the IRS allows you to use a reasonable estimate, but having documentation is safer.

If you made a mistake on a prior year's return, you can file an amended return using Form 1040-X. The IRS generally has three years to assess additional tax, though this period can be longer if you underreported income by 25% or more.

Frequently Asked Questions

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

No. If you sell an investment for less than you paid, you have a capital loss, not a gain. You can use that loss to offset other gains or to deduct up to $3,000 against your ordinary income in the same year. Losses beyond $3,000 roll forward to future years.

What if I sold an investment years ago and did not report it?

The IRS can assess tax and penalties going back three years from the date you filed your return, or six years if you significantly underreported income. File an amended return as soon as possible. The penalty for late payment is usually less than the penalty for non-filing, and showing good faith by correcting the error helps.

Do I owe capital gains tax on investments in a 401(k) or IRA?

No. Investments inside retirement accounts are not subject to capital gains tax when you sell them. You only pay tax when you withdraw money from the account, and the tax is on the full withdrawal amount, not just the gains. This is one major advantage of retirement accounts.

How do I know if my gain is long-term or short-term?

Count the days from the day after you bought the asset to the day you sold it. If that period is more than one year, it is long-term. If it is one year or less, it is short-term. For example, if you bought on January 15, 2023, and sold on January 16, 2024, it is long-term because you held it for more than one year.

Can I reduce my capital gains tax by donating the investment to charity instead of selling it?

Yes. If you donate appreciated securities directly to a may have access to charity, you avoid capital gains tax on the appreciation and can deduct the full fair market value of the investment as a charitable contribution. You must donate the actual security, not the proceeds from selling it, and the charity must be may have access to under IRS rules.