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

When you buy an asset — a house, stock, cryptocurrency, or business — and later sell it for a profit, that profit is called a capital gain. The IRS taxes that gain. How much you owe depends on how long you held the asset and your total income for the year. The tax rate ranges from 0% to 20% for most people, though it can go higher if you have very high income.

The key distinction is holding period. If you sell something you owned for less than a year, you pay ordinary income tax rates on the gain — the same rates as your salary or wages. If you hold it for more than a year before selling, you pay the lower long-term capital gains rate. This difference can mean thousands of dollars in tax savings on the same profit.

Key Takeaways

  • Capital gains tax applies only to profits from selling assets, not to the full sale price — if you buy a house for $300,000 and sell it for $350,000, you owe tax only on the $50,000 gain.
  • Long-term capital gains (assets held over one year) are taxed at 0%, 15%, or 20% depending on your income; short-term gains are taxed at your ordinary income tax rate, which is usually higher.
  • Your total income for the year determines which tax bracket you fall into, so a large capital gain can push you into a higher rate even if your salary stayed the same.
  • Some assets like primary residences have exemptions — you can exclude up to $250,000 in gains if you're single, or $500,000 if you're married filing jointly, if you meet ownership and use requirements.

How the IRS calculates your capital gain

The calculation is straightforward: sale price minus what you paid for it equals your gain. If you paid $10,000 for stock and sold it for $15,000, your capital gain is $5,000. If you paid $10,000 and sold it for $8,000, you have a capital loss of $2,000, which you can use to offset other gains or reduce your ordinary income by up to $3,000 per year.

You also need to account for basis adjustments. If you inherited the asset, your basis is usually its value on the date of death, not what the original owner paid. If you received stock as compensation, your basis is the fair market value on the day you received it. These rules exist so you don't pay tax on gains that occurred before you owned the asset.

Keep records of your purchase price, purchase date, and sale price. The IRS requires this documentation if you're audited. For stocks and mutual funds, your broker sends you a form called a 1099-B that reports sales; for real estate, you'll receive a 1099-S. These forms go to the IRS, so your tax return must match them.

Long-term versus short-term capital gains rates

Long-term capital gains — profits from assets you held for more than one year — are taxed at preferential rates: 0%, 15%, or 20%. Which rate you pay depends on your filing status and total taxable income for the year. For 2024, a single filer pays 0% on long-term gains up to $47,025 of taxable income, 15% from $47,025 to $518,900, and 20% above that. These income thresholds change each year.

Short-term capital gains — profits from assets you held for one year or less — are taxed as ordinary income. If you're in the 22% tax bracket for your salary, short-term gains are also taxed at 22%. This is why holding an investment just a few months longer can save you money: the difference between 22% and 15% on a $10,000 gain is $700.

The holding period starts the day after you buy and ends the day you sell. If you bought stock on January 15 and sold it on January 16 of the next year, you've held it for more than one year and may have access to for long-term rates. If you sold on January 15, it's short-term.

How income level affects your capital gains tax rate

Your total income for the year — wages, self-employment income, dividends, and capital gains combined — determines which capital gains rate applies to you. This is why a large capital gain can push you into a higher tax bracket even if your job income didn't change.

If you're single and earn $50,000 in salary, you have room in the 15% long-term capital gains bracket. A $20,000 capital gain would be taxed at 15% because your total income ($70,000) stays below the 20% threshold. But if you earned $100,000 in salary and had the same $20,000 gain, part of that gain would be taxed at 20% because your total income exceeds the threshold.

This effect is called stacking. Your capital gains are added to your other income, and the IRS taxes them at the rate that applies to that combined total. Planning the year you sell an asset — or spreading sales across multiple years — can sometimes reduce your overall tax if you're near a bracket boundary.

Special rules for home sales and other assets

If you sell a primary residence, you can exclude up to $250,000 in capital gains from tax if you're single, or $500,000 if you're married filing jointly. You must have owned the home and lived in it as your main residence for at least two of the five years before the sale. This exclusion applies once every two years.

If you sell a second home, investment property, or rental house, the full capital gain is taxable. There's no exclusion. If you rent out part of your primary residence, the exclusion applies only to the portion you lived in, not the rental portion.

Collectibles — art, antiques, coins, and similar items — are taxed at a flat 28% rate on long-term gains, higher than the standard long-term rate. Certain small business stock may may have access to for a 50% exclusion under Section 1202, meaning you report only half the gain. These are narrow rules that apply to specific situations, so consult a tax professional if you think they apply to you.

State and local taxes on capital gains

Federal capital gains tax is only part of the picture. Most states also tax capital gains as ordinary income. California, for example, taxes long-term capital gains at the same rate as wages — up to 13.3% for high earners. A few states, including Washington and Tennessee, tax capital gains but at a lower rate or only on certain types of gains.

Some cities and counties add local income taxes on top of state taxes. New York City residents, for instance, pay federal tax, New York State tax, and New York City tax on capital gains. The combined rate can exceed 50% for very high earners in high-tax states.

If you move to a different state after selling an asset, the state where you lived when you sold it generally has the right to tax the gain. This is why timing a move around a large sale can matter for tax planning.

Reporting capital gains on your tax return

You report capital gains on Schedule D of Form 1040. You list each sale separately: the date acquired, date sold, purchase price, sale price, and gain or loss. Long-term and short-term gains are reported in separate sections.

If you have net long-term gains, they go on line 15 of Form 1040 and are taxed at the preferential rates. If you have net short-term gains, they're added to your ordinary income on line 1. If you have losses, you can use them to offset gains or reduce ordinary income by up to $3,000 per year; excess losses carry forward to future years.

Your broker sends you a 1099-B showing all stock and mutual fund sales. For real estate, the buyer's title company sends a 1099-S to you and the IRS. Make sure the information on these forms matches your records. If it doesn't, file an amended return or contact the issuer to request a corrected form.

Frequently Asked Questions

Do I owe capital gains tax if I haven't sold yet?

No. Capital gains tax applies only when you sell the asset. If you own stock worth $50,000 more than you paid, you owe no tax until you sell. This is called an "unrealized gain." Once you sell, it becomes a "realized gain" and is taxable.

What if I sell at a loss?

Capital losses offset capital gains dollar-for-dollar. If you have $10,000 in gains and $6,000 in losses, you report a net gain of $4,000. If losses exceed gains, you can deduct up to $3,000 against ordinary income in that year. Excess losses carry forward to future years with no time limit.

How do I know my holding period?

The holding period starts the day after you purchase and ends the day you sell. If you bought on March 15, 2023, and sold on March 16, 2024, you've held it for more than one year and may have access to for long-term rates. If you sold on March 15, 2024, it's short-term.

Can I reduce my capital gains tax by donating the asset to charity?

Yes. If you donate appreciated stock or real estate to a may have access to charity, you avoid the capital gains tax entirely and can deduct the fair market value of the asset as a charitable contribution. This is often more valuable than selling and donating the proceeds, because you skip the tax.

What happens to capital gains if I inherit an asset?

Your basis is "stepped up" to the fair market value on the date of death. If someone bought stock for $10,000 and it was worth $50,000 when they died, your basis is $50,000. If you sell it immediately for $50,000, you owe no capital gains tax. This step-up applies to most inherited assets, though rules vary for certain types of property.