Capital gains tax applies when you sell an asset for more than you paid for it
Capital gains is the profit you make when you sell something you own — a stock, a house, land, or a business — for more than you paid for it. The difference between what you paid (your cost basis) and what you sold it for is the gain. The federal government taxes this gain as income, though the rate depends on how long you held the asset and how much you earned that year.
You do not owe capital gains tax on assets you still own, only on the ones you sell. You also do not owe it if you sell something for less than you paid — that is a loss, which can reduce other gains. The tax applies whether you sell to another person, a business, or back to the original seller.
State and local governments may also tax capital gains. Some states do not tax capital gains at all; others tax them as regular income. A few states have a separate capital gains tax on high-earning investments. Where you live when you sell matters.
Key Takeaways
- Capital gains tax is owed only when you sell an asset for more than you paid for it, not when you own it.
- Long-term gains (assets held over one year) are taxed at lower federal rates than short-term gains, which are taxed as regular income.
- Your total income for the year determines your federal capital gains tax rate: 0%, 15%, or 20% for long-term gains depending on your tax bracket.
- You must report the sale on your tax return even if you owe no tax, and state taxes on capital gains vary widely by location.
The difference between long-term and short-term capital gains
How long you owned the asset before selling it changes the tax rate you pay. If you held it for more than one year, it is a long-term capital gain. If you held it for one year or less, it is a short-term capital gain.
Short-term gains are taxed as ordinary income — at the same rate as your salary or wages. If you are in the 22% tax bracket, your short-term capital gains are taxed at 22%. If you are in the 37% bracket, they are taxed at 37%.
Long-term gains get preferential rates. The federal government taxes them at either 0%, 15%, or 20%, depending on your total income for the year and your filing status. Most people pay 15%. The 0% rate applies only to lower-income filers; the 20% rate applies to high earners. These rates are much lower than the ordinary income rates, which is why holding an investment for over a year can save you significant tax.
How your income level determines your capital gains tax rate
The federal rate you pay on long-term gains depends on your taxable income for the year — not just the gain itself. The IRS sets income thresholds that change each year. For 2024, if you are single and your taxable income is below roughly $47,000, you may pay 0% on long-term gains. Between roughly $47,000 and $518,000, you pay 15%. Above that, you pay 20%.
These thresholds are higher for married couples filing jointly and lower for married couples filing separately. They also shift slightly each year to account for inflation. Your tax software or a tax professional can tell you which bracket you fall into based on your specific situation.
The order in which you report income matters. Capital gains are stacked on top of your other income. If you earned $40,000 in wages and have a $20,000 long-term capital gain, your taxable income is $60,000. That $20,000 gain may push you into a higher capital gains bracket than if you had no other income.
Sales that trigger capital gains tax
Capital gains tax applies to the sale of stocks, bonds, mutual funds, real estate, and business interests. It also applies to collectibles like art, coins, or jewelry if you sell them for a profit. The asset must be a capital asset — something you own for investment or personal use, not something you make or sell as part of a business.
If you sell a rental property, the gain is subject to capital gains tax. If you sell your primary home, you may be able to exclude up to $250,000 of the gain (or $500,000 if married filing jointly) if you meet the ownership and use tests: you owned it and lived in it for at least two of the last five years. This exclusion applies once every two years.
If you inherit an asset, you do not owe capital gains tax on the increase in value that happened before you inherited it. Your cost basis is stepped up to the fair market value on the date of death, so you only owe tax on gains that happen after you own it.
How to calculate your capital gain
Your capital gain is the sale price minus your cost basis. Cost basis is usually what you paid for the asset, plus any fees or commissions. If you bought 100 shares of stock at $50 per share and paid a $10 commission, your cost basis is $5,010 (100 × $50 + $10).
If you received the asset as a gift, your cost basis is generally what the giver paid for it. If you inherited it, your cost basis is the fair market value on the date of death. If you received stock as compensation for work, your cost basis is the fair market value on the date you received it.
When you sell, subtract your cost basis from the sale price. If you sold those 100 shares for $7,500, your gain is $7,500 − $5,010 = $2,490. That is the amount subject to capital gains tax. Keep records of your purchase price, date of purchase, sale price, and date of sale. Your brokerage or financial institution usually provides this information on statements or in year-end tax documents.
Reporting capital gains on your tax return
You report capital gains on Schedule D (Form 1040) and then transfer the totals to your main tax return. Your brokerage or investment company sends you a Form 1099-B showing the sales you made during the year. Real estate sales are reported on Schedule D as well, though you may also file Form 8949 to list each transaction.
You must report the sale even if you owe no tax — for example, if you sold at a loss or if your gain falls within the 0% bracket. The IRS matches your reported gains against the 1099 forms your broker sends them, so underreporting or omitting a sale can trigger an audit notice.
If you have losses, you can use them to offset gains. If your losses exceed your gains, you can deduct up to $3,000 of the excess loss against other income in that year. Any remaining loss carries forward to future years.
State and local capital gains taxes
Most states tax capital gains as part of regular income tax. A few states — including Florida, Texas, Washington, and Wyoming — have no income tax at all, so they do not tax capital gains. Some states have a separate capital gains tax that applies only to investment income above a certain threshold.
California, for example, taxes capital gains as ordinary income at rates up to 13.3%. New York taxes them as income at rates up to 10.9%. Washington state has a 7% capital gains tax on long-term gains from the sale of stocks, bonds, and certain other investments, even though it has no regular income tax.
If you move to a different state after selling an asset, the state where you lived when you made the sale is generally the one that taxes the gain. If you sell a property, the state where the property is located may also tax the gain. Check your state's tax rules or consult a tax professional if you live in or are moving to a state with capital gains taxes.
Frequently Asked Questions
Do I owe capital gains tax if I sell an investment at a loss?
No. A loss means you sold for less than you paid, so there is no gain to tax. You can use losses to offset other gains. If losses exceed gains, you can deduct up to $3,000 against other income that year, with any remainder carrying forward to future years.
What if I sell stock I received as a bonus from my employer?
Your cost basis is the fair market value of the stock on the date you received it as compensation. Any gain or loss is measured from that date forward. If you received the stock when it was worth $50 and sold it for $75, your gain is $25, even if the stock was worth $100 when you received it.
Do I owe capital gains tax on cryptocurrency sales?
Yes. The IRS treats cryptocurrency as property, not currency. When you sell or trade it, any gain is subject to capital gains tax. If you held it for over a year, it qualifies for long-term rates. Short-term gains are taxed as ordinary income. You must report all sales, including trades between different cryptocurrencies.
Can I avoid capital gains tax by donating an appreciated asset to charity?
Yes. If you donate an appreciated asset directly to a may have access to charity, you avoid the capital gains tax on the appreciation and may also deduct the fair market value of the asset as a charitable contribution. You cannot deduct the donation if you sell first and then donate the proceeds.
What happens to capital gains tax if I die before selling an asset?
Your heirs inherit the asset with a stepped-up cost basis equal to its fair market value on the date of your death. They owe no capital gains tax on the appreciation that happened while you owned it. If they later sell the asset, they only owe tax on gains that occur after they inherit it.