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

The tax applies to the difference between what you paid for something and what you sold it for — not the full sale price. If you bought stock for $1,000 and sold it for $1,500, your capital gain is $500. That $500 is what gets taxed, not the $1,500.

The amount of tax you owe depends on two things: how long you held the asset before selling it, and your income level. The IRS treats assets you hold for less than a year differently from assets you hold for a year or longer, and the tax rate changes based on your total income that year.

Key Takeaways

  • Capital gain equals the sale price minus what you originally paid, and only that gain is taxed.
  • Short-term gains (assets held under one year) are taxed at your regular income tax rate, which can be 10%, 12%, 22%, 24%, 32%, 35%, or 37%.
  • Long-term gains (assets held one year or longer) are taxed at 0%, 15%, or 20% depending on your income, which is usually lower than your regular rate.
  • Your total income for the year determines which tax bracket you fall into, so other income affects your capital gains tax rate.

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

If you sell an asset you owned for less than one year, the gain is short-term capital gain. The IRS taxes this at your ordinary income tax rate — the same rate applied to wages, salary, and other regular income. For 2024, those rates are 10%, 12%, 22%, 24%, 32%, 35%, or 37%, depending on your income bracket.

If you sell an asset you owned for one year or longer, the gain is long-term capital gain. This gets a preferential rate: 0%, 15%, or 20%. Which rate you pay depends on your income level, not on how much you gained. Someone in a higher income bracket pays 20% on long-term gains; someone in a lower bracket might pay 0%.

The holding period starts the day after you buy and ends the day you sell. If you bought on January 15 and sold on January 15 the next year, that counts as one year held.

How to calculate your capital gain or loss

Start with your cost basis — what you originally paid for the asset, including any fees or commissions. If you bought 100 shares of stock at $10 per share plus a $25 broker fee, your cost basis is $1,025.

Next, determine your sale proceeds — what you received when you sold it, minus any fees. If you sold those 100 shares for $15 per share and paid a $25 broker fee, your proceeds are $1,475.

Subtract cost basis from proceeds: $1,475 minus $1,025 equals $450 capital gain. If the proceeds were less than the cost basis, you have a capital loss instead, which can reduce your taxable gains.

ScenarioCost BasisSale ProceedsCapital Gain or Loss
Stock purchase and sale$1,025$1,475$450 gain
Real estate sale$250,000$320,000$70,000 gain
Investment loss$5,000$3,200$1,800 loss

How your income bracket affects the tax rate

For long-term capital gains, your tax rate depends on which income bracket you fall into. The brackets change each year. For 2024, if your total taxable income (including the capital gain) falls below certain thresholds, you pay 0% on long-term gains. Above those thresholds but below higher ones, you pay 15%. Above the highest threshold, you pay 20%.

The exact income limits vary by filing status. A single filer has different thresholds than a married couple filing jointly. The IRS publishes updated brackets each year, and your tax software or accountant can tell you which bracket applies to you.

Your other income matters. If you earned $50,000 in salary and have a $10,000 long-term capital gain, your total taxable income is $60,000. That $60,000 determines your capital gains rate, not just the gain itself.

What happens with capital losses

If you sell an asset for less than you paid, you have a capital loss. You can use this loss to reduce your capital gains. If you had $5,000 in gains and $2,000 in losses, you report a net gain of $3,000.

If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against your regular income. Any losses beyond that $3,000 carry forward to future years, where you can use them to offset future gains or income.

Special situations: inherited assets and home sales

If you inherit an asset, your cost basis is usually reset to its value on the date of death, not what the original owner paid. This is called a step-up in basis. If your parent bought a house for $100,000 and it was worth $400,000 when they died, your cost basis is $400,000. If you sell it immediately for $400,000, you owe no capital gains tax.

If you sell a home you lived in, you may exclude up to $250,000 of gain if you are single, or $500,000 if married filing jointly. You must have owned and lived in the home for at least two of the last five years. This exclusion applies only once every two years.

Frequently Asked Questions

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

No. Capital gains tax is owed only when you sell and realize the gain. If you own stock worth more than you paid but have not sold it, there is no tax due. The gain is "unrealized" until you sell.

What if I sold something at a loss — do I have to report it?

You should report it, because losses reduce your taxable gains and can lower your overall tax bill. If losses exceed gains, you can deduct up to $3,000 against other income that year. Unused losses carry forward indefinitely.

How do I know my cost basis if I lost the original receipt?

Your broker or financial institution has records. For stocks and mutual funds, you can request a cost basis report. For real estate, you may need to search county records or contact the title company. If you truly cannot find it, the IRS allows you to estimate based on available evidence, though this is less reliable.

Are cryptocurrency gains taxed the same way?

Yes. Selling cryptocurrency for a profit creates a capital gain taxed the same as stock or real estate. The holding period (short-term or long-term) is determined the same way. You report it on Schedule D, the same form used for other capital gains.