Capital gains tax is the tax you owe when you sell an investment or asset for more than you paid for it
The difference between what you paid and what you sold it for is your capital gain. The IRS taxes that profit. How much tax you owe depends on how long you held the asset before selling it — hold it for more than a year and you pay a lower rate than if you sell it within a year.
You report capital gains on your tax return using Schedule D (Form 1040), which feeds into your main return. The tax rate you pay is either your ordinary income tax rate (for short-term gains) or a preferential rate of 0%, 15%, or 20% (for long-term gains), depending on your total income that year.
Capital gains explore to stocks, bonds, real estate, cryptocurrency, collectibles, and most other assets you own. They do not explore to items you use personally, like your primary home (which has its own rules) or your car.
Key Takeaways
- A capital gain is the profit you make when you sell an asset for more than you paid for it, and the IRS taxes that profit at rates that depend on how long you held it.
- Long-term capital gains (assets held over one year) are taxed at 0%, 15%, or 20% depending on your income; short-term gains (held one year or less) are taxed as ordinary income.
- You report capital gains on Schedule D and carry the total to Form 1040, where it combines with your other income to determine your tax bracket.
- You can reduce your capital gains tax by offsetting gains with losses from other investments, a strategy called tax-loss harvesting.
The difference between short-term and long-term capital gains
The IRS divides capital gains into two categories based on how long you owned the asset before you sold it. If you held it for one year or less, it is a short-term capital gain. If you held it for more than one year, it is a long-term capital gain.
Short-term gains are taxed as ordinary income — the same rate as your wages or salary. If you are in the 24% tax bracket, a short-term gain is taxed at 24%. Long-term gains get preferential rates: 0%, 15%, or 20%, depending on your total taxable income for the year. For most people, long-term gains are taxed at 15%. The 0% rate applies to lower-income filers, and the 20% rate applies to high-income filers.
This is why the holding period matters. Selling a stock after 13 months instead of 11 months can cut your tax bill significantly. The holding period starts the day after you buy and ends the day you sell.
How to calculate your capital gain or loss
The math is straightforward: subtract what you paid (your cost basis) from what you received when you sold it (your sale proceeds). The result is your gain or loss.
Cost basis includes the purchase price plus any fees or commissions you paid to buy the asset. If you inherited an asset, your cost basis is usually its value on the date the person died, not what they originally paid — this is called a step-up in basis and is a major tax advantage for inherited investments.
If you sold for less than you paid, you have a capital loss. You can use losses to offset gains from other sales in the same year. If your losses exceed your gains, you can deduct up to $3,000 of the excess loss against your ordinary income in that year. Any remaining loss carries forward to future years.
What triggers capital gains tax when you sell
You owe capital gains tax whenever you sell an asset at a profit, but the trigger is the sale itself — the moment the transaction completes and you receive the proceeds. You do not owe tax just because an investment went up in value. You only owe tax when you actually sell.
This applies to stocks, mutual funds, bonds, real estate, cryptocurrency, and collectibles like art or rare coins. If you sell a rental property, you owe capital gains tax on the profit. If you sell a second home, you owe capital gains tax on the profit (unlike your primary residence, which has a $250,000 exclusion for single filers and $500,000 for married couples filing jointly, provided you meet ownership and use tests).
Some transactions that feel like sales are treated as sales for tax purposes even if no money changes hands. If you trade one cryptocurrency for another, that is a taxable event. If you use an appreciated asset to pay for something, that is a taxable event. If you donate an appreciated asset to charity, you avoid the capital gains tax but must report the donation.
How capital gains affect your overall tax bill
Capital gains do not exist in isolation — they combine with your other income to determine your total tax. The IRS stacks income in order: ordinary income (wages, interest, dividends) first, then capital gains on top.
This means a capital gain can push you into a higher tax bracket. If you earned $100,000 in wages and have a $50,000 long-term capital gain, your total income is $150,000. The long-term gain is taxed at the rate that applies to that $150,000 of income, not at the rate that applied to your first $100,000.
Certain income thresholds determine which long-term capital gains rate applies. For 2024, the 15% rate applies to single filers with income between roughly $47,000 and $518,000 (these thresholds change yearly). Below that range, you may may have access to for the 0% rate. Above it, you pay 20%. Married couples filing jointly have higher thresholds.
Tax-loss harvesting and offsetting gains
If you have both gains and losses in the same year, you can use losses to reduce the amount of gain you owe tax on. This is called tax-loss harvesting. You sell an investment at a loss specifically to offset a gain elsewhere.
For example, if you sold Stock A for a $10,000 gain and Stock B for a $3,000 loss, your net gain is $7,000. You owe tax only on the $7,000, not the full $10,000. If your losses exceed your gains, you can deduct up to $3,000 of the excess against your wages or other ordinary income in that year. Any remaining loss carries to the next year.
One rule to watch: the wash-sale rule. If you sell a security at a loss and buy the same or a substantially identical security within 30 days before or after the sale, the IRS disallows the loss. You cannot harvest a loss and when ready rebuy the same investment. You must wait at least 31 days, or buy a different but similar investment in the meantime.
Reporting capital gains on your tax return
You report capital gains on Schedule D (Form 1040), which is a separate form that lists each sale and calculates your total gain or loss. You then carry the total to your main Form 1040.
Your brokerage or investment company sends you a Form 1099-B (Proceeds from Broker and Barter Exchange Transactions) that lists every sale you made during the year. This form shows the sale price but usually does not show your cost basis — you must provide that yourself. Some brokerages now report cost basis on the 1099-B, but not all.
Keep records of what you paid for each investment, including the date you bought it and any fees. If you cannot find your original purchase records, you can reconstruct them using historical price data, but it is easier to keep them from the start. The IRS can ask for these records years later.
Frequently Asked Questions
Do I owe capital gains tax on my primary home when I sell it?
No, not on the profit up to $250,000 (single filers) or $500,000 (married couples filing jointly), provided you owned and lived in the home as your primary residence for at least two of the five years before the sale. Profit above those amounts is taxable. Investment properties and second homes do not may have access to for this exclusion.
What if I inherited investments — do I owe capital gains tax?
Not on the increase in value before you inherited them. Your cost basis steps up to the value on the date of death, so you owe tax only on gains that occur after you inherit. This is a major tax advantage and applies to most inherited assets, including stocks, real estate, and retirement accounts (though retirement accounts have their own rules).
How do I know if my gain is short-term or long-term?
Count the days from the day after you bought to the day you sold. If it is 365 days or fewer, it is short-term. If it is 366 days or more, it is long-term. Your brokerage statement usually shows the holding period, but verify it yourself because the calculation matters for your tax rate.
Can I deduct investment losses against my salary or wages?
Only up to $3,000 per year. If you have more losses than that, the excess carries forward to future years. You can use those future losses to offset future gains or to deduct another $3,000 against ordinary income each year until the loss is used up.
What happens if I sell cryptocurrency — is that a capital gain?
Yes. Selling cryptocurrency for a profit is a taxable capital gain, taxed the same way as stocks. Trading one cryptocurrency for another is also a taxable event. The IRS treats cryptocurrency as property, not currency, so every transaction that results in a gain is taxable.