How Capital Gains Tax Works When You Sell an Investment
What capital gains tax is
Capital gains tax is a tax on the profit you make 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 gain, and that gain is taxable income.
For example, if you bought stock for $1,000 and sold it for $1,500, your capital gain is $500. That $500 is subject to capital gains tax. You do not pay tax on the full $1,500 — only on the profit portion.
Capital gains tax applies to many types of assets: stocks, bonds, real estate, cryptocurrency, collectibles, and mutual funds. It does not explore to assets you still own. You owe the tax only when you sell and realize the gain.
Key Takeaways
- Capital gains tax is owed on the profit from selling an investment, not on the full sale price.
- Long-term capital gains (held over one year) are taxed at lower rates than short-term gains (held one year or less).
- Your tax rate depends on your total income for the year and your filing status, not just the size of the gain.
- You report capital gains on Schedule D of your federal tax return, and some states also tax capital gains.
Long-term versus short-term capital gains
The tax rate you pay depends on how long you held the asset before selling it. If you held it for more than one year, 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 as ordinary income at your regular tax bracket rate. That rate can be 10%, 12%, 22%, 24%, 32%, 35%, or 37% depending on your income and filing status.
Long-term capital gains have their own tax brackets, which are lower. The federal rates are 0%, 15%, or 20% depending on your income level and filing status. Most people pay 15%. The 0% rate applies to lower-income filers, and the 20% rate applies to the highest earners.
Because long-term rates are lower, many investors try to hold assets for more than one year before selling. The one-year holding period is measured from the date you bought the asset to the date you sold it.
How your income level affects your tax rate
Your capital gains tax rate is not based only on the size of your gain. It depends on your total taxable income for the year, combined with your filing status (single, married filing jointly, head of household, and so on).
The IRS publishes tax brackets each year that show which income range puts you in the 0%, 15%, or 20% long-term capital gains bracket. If your total income is low, you may owe 0% on long-term gains. If it is higher, you pay 15%. If it is very high, you pay 20%.
This means the same $10,000 gain could be taxed at different rates depending on how much other income you earned that year. Someone with a $30,000 salary and a $10,000 gain may pay a different rate than someone with a $100,000 salary and the same $10,000 gain.
Reporting capital gains on your tax return
You report capital gains to the IRS using Schedule D, which is part of Form 1040. On Schedule D, you list each sale separately: the date you bought it, the date you sold it, your cost basis (what you paid), the sale price, and the gain or loss.
Your broker or investment company sends you a Form 1099-B after the year ends, which shows all the sales you made in that account. You use this form to fill out Schedule D. If you sold real estate, you may receive a Form 1099-S instead.
Schedule D also calculates whether your gains are long-term or short-term and adds them up. The total goes on your main tax return (Form 1040) and becomes part of your taxable income for the year.
State capital gains taxes
Some states tax capital gains in addition to federal tax. As of now, only a few states have a dedicated capital gains tax: Washington, Illinois, and California. Other states tax capital gains as part of regular income tax, which means your state income tax rate applies to the gain.
The rate and rules vary by state. Washington's capital gains tax applies only to long-term gains on certain assets and has a 7% rate. Illinois taxes long-term gains at a lower rate than short-term gains. California taxes capital gains as ordinary income at rates up to 13.3%.
If you live in a state with no income tax (such as Texas, Florida, or Nevada), you owe no state capital gains tax. If you moved during the year you sold an asset, you may owe tax to both your old state and your new state, depending on when you moved and when you sold.
Capital losses and offsetting gains
If you sell an investment for less than you paid for it, you have a capital loss. Capital losses can offset capital gains, which reduces the amount of gain you owe tax on.
For example, if you had a $5,000 long-term gain from one stock and a $2,000 long-term loss from another, you would report a net gain of $3,000 and owe tax only on that amount.
If your capital losses exceed your capital gains in a year, you can deduct up to $3,000 of the excess loss against other income (like wages or interest). Any losses beyond $3,000 carry forward to future years, where you can use them to offset future gains or other income.
Special situations: real estate and inherited assets
If you sell a home you lived in, you may not owe capital gains tax on part or all of the gain. The IRS allows you to exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly, as long as you owned and lived in the home for at least two of the last five years.
If you inherit an asset, the cost basis is "stepped up" to the fair market value on the date of the person's death. This means if someone left you stock worth $100,000 that they bought for $10,000, your cost basis is $100,000, not $10,000. If you sell it shortly after, you owe little or no capital gains tax.
Collectibles such as art, antiques, and precious metals are taxed at a maximum federal rate of 28% on long-term gains, which is higher than the standard long-term rate of 20%.
Frequently Asked Questions
Do I owe capital gains tax if I do not sell?
No. Capital gains tax is owed only when you sell an asset and realize the gain. If you own stock that has doubled in value but you have not sold it, you owe no tax on that unrealized gain. You owe tax only when you sell.
What if I sold an investment at a loss?
A loss reduces your taxable gains. If your losses exceed your gains, you can deduct up to $3,000 against other income in that year. Losses beyond $3,000 roll forward to future years. You cannot deduct a loss on an asset you still own.
How do I know my cost basis?
Your broker or investment company tracks this and reports it on your 1099-B form. Cost basis is what you paid for the asset, including any fees or commissions. If you bought in multiple batches, you can choose which shares you are selling (specific identification method) to control your gain or loss.
Can I reduce my capital gains tax by donating to charity?
You cannot deduct the capital gains tax itself, but you can donate appreciated assets (like stock) directly to a charity and avoid the capital gains tax entirely while also deducting the full fair market value as a charitable donation. This is often more tax-efficient than selling and donating the cash.
Is cryptocurrency taxed as capital gains?
Yes. The IRS treats cryptocurrency as property, not currency. When you sell or trade crypto, any gain is subject to capital gains tax at the same rates as stocks. Even trading one cryptocurrency for another is a taxable event.
This guide is for general information only and is not medical, financial, legal, or other professional advice. For decisions specific to your situation, consult a qualified professional. See our Editorial Policy.