Capital gains tax is the tax on profit when you sell an asset for more than you paid for it

When you buy a stock, house, or piece of land and later sell it for a higher price, the difference between what you paid and what you received is your capital gain. The IRS taxes that profit. The amount you owe depends on three things: how much you gained, how long you held the asset, and your ordinary income for the year.

Capital gains are taxed differently from wages or salary. A $10,000 gain is not taxed the same way as a $10,000 paycheck. The tax rate on gains depends on whether you held the asset for more or less than one year, and your income level. This is why capital gains matter enough to understand separately from income tax.

Key Takeaways

  • Your capital gain is the sale price minus what you originally paid, minus any costs of selling (like broker fees or real estate commissions).
  • Long-term gains (assets held over one year) are taxed at lower rates than short-term gains, which are taxed as ordinary income.
  • Your tax bracket for capital gains depends on your total income for the year, not just the gain itself.
  • You report capital gains on Schedule D (Form 1040) and may also owe net investment income tax if your income exceeds certain thresholds.

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

How long you owned the asset changes the tax rate dramatically. If you held it for more than one year before selling, it is a long-term gain. If you held it for one year or less, it is a short-term gain.

Short-term gains are taxed as ordinary income — the same rate as your wages. If you are in the 24% tax bracket, a short-term gain is taxed at 24%. Long-term gains are taxed at lower rates: 0%, 15%, or 20%, depending on your income level. For most people, long-term gains are taxed at 15%. The 0% rate applies only to lower-income filers, and the 20% rate applies to high-income filers.

This difference is why timing matters. Holding an investment just a few more months to cross the one-year mark can cut your tax bill significantly.

How to calculate your capital gain or loss

Start with the sale price — the amount you actually received when you sold the asset. Subtract your cost basis, which is what you originally paid for it. If the result is positive, you have a gain. If it is negative, you have a loss.

Cost basis is not always just the purchase price. If you inherited the asset, your basis is usually its value on the date the person died, not what they paid. If you received stock as compensation, your basis is the fair market value on the day you received it. If you made improvements to real estate, you can add those costs to your basis.

Subtract any costs of selling: broker commissions, real estate agent fees, title insurance, or legal fees. These reduce your gain. For example: you bought a stock for $5,000, sold it for $7,500, and paid a $50 broker fee. Your gain is $7,500 − $5,000 − $50 = $2,450.

How your income level affects your capital gains tax rate

Capital gains tax brackets are separate from ordinary income brackets, but they are tied to your income. The IRS uses your taxable income (after deductions) to determine which long-term capital gains rate applies to you.

For 2024, the long-term capital gains brackets are roughly: 0% rate if your taxable income is below $47,025 (single filer); 15% rate for income between roughly $47,025 and $518,900; and 20% rate above that. These thresholds change every year. Short-term gains do not have separate brackets — they use your ordinary income tax bracket.

This means your capital gains rate depends on your total income picture. If you earned $40,000 in wages and have a $10,000 long-term gain, part of that gain may be taxed at 0% and part at 15%, because the gain pushes you into the higher bracket. This is called "stacking."

What to do if you have capital losses

A loss occurs when you sell an asset for less than you paid for it. Capital losses can reduce your capital gains. If you have $8,000 in long-term gains and $3,000 in long-term losses, you net $5,000 in gains and owe tax only on that $5,000.

You can also use capital losses to reduce ordinary income, but only up to $3,000 per year. If your losses exceed your gains by more than $3,000, you can carry the unused loss forward to future years. This means a large loss in one year can shelter gains in the next year or years.

Losses must be matched by type: long-term losses offset long-term gains first, then short-term losses offset short-term gains. Only after all gains are offset can you use losses against ordinary income.

Where to report capital gains on your tax return

You report capital gains on Schedule D (Form 1040), which is part of your federal income tax return. Schedule D has separate sections for long-term and short-term gains and losses. You list each transaction: the asset, the date bought, the date sold, the cost basis, the sale price, and the gain or loss.

The total from Schedule D carries to your Form 1040, where it is added to your other income to calculate your total taxable income. If you have only a few transactions, the process is straightforward. If you have many, a tax software or accountant can help organize them.

If your income exceeds certain thresholds ($200,000 for single filers, $250,000 for married filing jointly), you may also owe the Net Investment Income Tax, which is an additional 3.8% on investment income including capital gains. This is reported on Form 8960.

Special situations: real estate, inherited assets, and stock options

Home sales have a special rule. If you are married and file jointly, you can exclude up to $500,000 of gain on the sale of your primary residence if you owned and lived in it for at least two of the last five years. Single filers can exclude $250,000. This exclusion applies once every two years.

Inherited assets receive a step-up in basis. If your parent bought a stock for $1,000 and it was worth $10,000 when they died, your cost basis is $10,000, not $1,000. If you sell it when ready for $10,000, you owe no capital gains tax. This applies to most inherited property, though the rules are complex for certain assets.

Stock options, restricted stock units, and employee stock purchase plans have their own basis rules. The date you exercise an option or vest in a unit becomes your cost basis date, not the date you sell. Consult a tax professional if you receive compensation in the form of company stock.

Frequently Asked Questions

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

No tax is owed on the loss itself. Instead, you can use the loss to reduce other gains or up to $3,000 of ordinary income in the same year. Unused losses carry forward indefinitely to future years.

What if I bought a stock years ago and don't know what I paid for it?

Your broker should have records going back several years. If the stock was bought before your current broker held it, contact the old broker or the company's investor relations department. If records are truly unavailable, you may be able to use the stock's value on a specific date (like January 1, 2001) as your basis, but this requires IRS approval and is complicated.

Is cryptocurrency taxed the same way as stocks?

Yes. Buying and selling cryptocurrency is treated as a capital asset. If you hold it over one year before selling, it qualifies for long-term capital gains rates. If you sell within one year, it is taxed as short-term gain at your ordinary income rate.

Can I deduct investment losses from my paycheck taxes?

Only up to $3,000 per year. If you have $10,000 in investment losses and $50,000 in wages, you can reduce your taxable income to $47,000. The remaining $7,000 loss carries to the next year.

Do I have to report capital gains if they are small?

Yes. Even a $100 gain must be reported on Schedule D. The IRS matches your reported gains against broker statements, which are also sent to the IRS. Unreported gains, no matter how small, can trigger an audit notice.