Capital gains tax is the tax you pay on profit when you sell an asset for more than you paid for it
When you buy something — a house, stock, or piece of land — and later sell it for more money than you paid, that profit is called a capital gain. The IRS taxes that profit. The amount you owe depends on how long you held the asset and how much profit you made. This is separate from income tax on wages or salary.
The tax applies to almost any asset you own: real estate, stocks, bonds, cryptocurrency, collectibles, even a business. If you sell it and make money, you owe capital gains tax on the difference between what you paid (your basis) and what you sold it for (your sale price). If you sell at a loss, you can use that loss to reduce other gains or, in some cases, reduce your regular income.
Key Takeaways
- Capital gains tax applies to profit from selling assets, and the rate depends on whether you held the asset for more or less than one year.
- Long-term capital gains (held over one year) are taxed at 0%, 15%, or 20% depending on your income; short-term gains are taxed as ordinary income at your regular tax rate.
- Your basis is what you paid for the asset, including purchase price and certain costs; your gain is the sale price minus your basis.
- You report capital gains on Schedule D of your tax return, and losses can offset gains or reduce other income by up to $3,000 per year.
- Some assets like primary homes have special rules that may let you exclude part or all of the gain from taxation.
Long-term versus short-term capital gains rates
The IRS taxes capital gains at different rates depending on how long you owned the asset. If you held it for more than one year before selling, 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 capital gains are taxed at your ordinary income tax rate — the same rate that applies to wages, salary, and other regular income. That rate ranges from 10% to 37% depending on your total income and filing status.
Long-term capital gains have their own lower tax brackets: 0%, 15%, or 20%. Which bracket you fall into depends on your income level and filing status. For 2024, the 0% rate applies to single filers with income up to about $47,000; the 15% rate applies to income above that up to about $518,000; and the 20% rate applies to income above that. These income thresholds change each year. The key point: long-term gains are almost always taxed at a lower rate than short-term gains, which is why holding an asset longer can save you money in taxes.
How to calculate your capital gain or loss
Your capital gain is straightforward math: sale price minus what you paid for the asset. What you paid is called your basis. In most cases, your basis is the purchase price plus any costs directly tied to buying it — broker fees, title insurance, or closing costs on real estate.
If you inherited an asset, your basis is usually the value on the date the person died, not what they originally paid. This is called a step-up in basis and can significantly reduce or eliminate the tax you owe if you sell soon after inheriting.
For stocks or mutual funds, if you bought shares at different times and prices, you need to track which shares you sold. You can use several methods: first-in-first-out (FIFO), where you sell the oldest shares first; specific identification, where you choose which shares to sell; or average cost, where you use the average price of all shares. Different methods produce different gains or losses, so choosing carefully can lower your tax bill. Your brokerage can help you track this.
If you sell at a loss, you can use that loss to offset capital gains from other sales. If your losses exceed your gains, you can deduct up to $3,000 of the loss against your regular income in that year. Any loss beyond $3,000 carries forward to future years.
Special rules for real estate and primary homes
If you sell a house that was your primary residence, you may be able to exclude part or all of the gain from taxation. You can exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly. To may have access to, you must have owned the home and lived in it as your main home for at least two of the five years before the sale.
This rule applies only once every two years. If you sell a second home, rental property, or investment real estate, this exclusion does not explore — you owe capital gains tax on the full profit. If you rented out part of your home during the time you owned it, the exclusion may be reduced.
Reporting capital gains on your tax return
You report capital gains and losses on Schedule D of your federal tax return (Form 1040). You list each sale separately: the asset, the date you bought it, the date you sold it, your basis, the sale price, and the gain or loss.
If you sold stocks, mutual funds, or bonds through a brokerage, the brokerage sends you a Form 1099-B showing the sales. If you sold real estate, you receive a Form 1099-S from the title company or real estate agent. These forms also go to the IRS, so your numbers need to match.
After you complete Schedule D, you transfer the total long-term and short-term gains (or losses) to the main tax return. Long-term gains go into the calculation of your tax using the preferential rates. Short-term gains are added to your ordinary income and taxed at your regular rate.
State and local capital gains taxes
Most states tax capital gains as part of ordinary income, so you owe state tax on top of federal tax. A few states — including Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming — do not have an income tax at all, so there is no state capital gains tax.
Some states have recently introduced separate capital gains taxes. Washington State, for example, taxes long-term capital gains on certain assets at a flat rate. California taxes capital gains at the same rate as ordinary income, which can be as high as 13.3%. If you move to a different state after selling an asset, the state where you lived when you sold it is the one that taxes the gain, not where you live now.
When to consider tax-loss harvesting or timing a sale
Because long-term gains are taxed at lower rates than short-term gains, timing a sale to cross the one-year mark can save money. If you bought a stock nine months ago and it has gained $5,000, waiting three more months means the gain is taxed at the long-term rate (0%, 15%, or 20%) instead of your ordinary income rate (potentially 22% to 37%). The difference can be thousands of dollars.
Tax-loss harvesting is a strategy where you sell an investment at a loss to offset gains elsewhere. For example, if you have a stock that gained $10,000 and another that lost $4,000, you can sell the losing stock to reduce your net gain to $6,000. You can then buy a similar (but not identical) investment to maintain your portfolio. The IRS has a wash-sale rule that prevents you from buying the same or substantially identical security within 30 days before or after the sale, so you need to be careful about timing.
These strategies work best with the help of a tax professional or financial advisor, especially if you have large gains or complex holdings.
Frequently Asked Questions
Do I owe capital gains tax if I sell an asset at a loss?
No, you do not owe tax on a loss. Instead, you can use the loss to reduce capital gains from other sales. If losses exceed gains, you can deduct up to $3,000 against your regular income in that year. Any remaining loss carries forward to future years.
What if I inherited an asset and then sold it?
Inherited assets receive a step-up in basis, meaning your basis is the value on the date the person died, not what they originally paid. If you sell shortly after inheriting, you may owe little or no capital gains tax. If the value has risen since the death, you owe tax only on the increase after the death date.
How do I know if a gain is long-term or short-term?
Count the days from the purchase date to the sale date. If it is more than one year, it is long-term. The IRS counts the purchase date as day zero, so if you bought on January 1 and sold on January 2 of the next year, that is long-term. Your brokerage or tax software can calculate this automatically.
Can I avoid capital gains tax by not selling?
Yes. You owe capital gains tax only when you sell. If you hold an asset indefinitely, you never owe the tax. However, if you pass the asset to heirs, they receive a step-up in basis and can sell without owing tax on the gain that occurred during your lifetime.
Do I have to report small capital gains?
Yes. You must report all capital gains, even small ones, on Schedule D. However, if your total capital gains are small and you have no other income, you may owe no tax because the gain falls within the standard deduction or the 0% long-term capital gains bracket.