Capital gains tax is the tax you owe on profit when you sell an investment for more than you paid for it
When you buy a stock, bond, real estate, or other asset and later sell it for a higher price, the difference between what you paid and what you received is called a capital gain. The IRS taxes that profit. The amount you owe depends on how long you held the asset before selling it, your total income that year, and your filing status. You do not owe capital gains tax on assets you still own — only on the ones you sell.
Capital gains tax is separate from income tax on wages or salary. You may owe both in the same year if you sell investments and also work a job. The tax rate on capital gains can be lower than the rate on ordinary income, which is why the holding period matters so much.
Key Takeaways
- Capital gains tax applies only to profit on assets you sell, calculated as the sale price minus what you originally paid plus any improvements or adjustments.
- Long-term capital gains (assets held over one year) are taxed at lower federal rates — 0%, 15%, or 20% depending on your income — while short-term gains are taxed as ordinary income.
- You report capital gains on Schedule D (Form 1040) when you file your tax return, and the IRS matches your report to the sale records your broker sends them.
- State capital gains taxes vary widely: some states have no capital gains tax, some tax all gains the same as income, and a few tax only certain types of gains like real estate or long-term stock sales.
Long-term versus short-term capital gains rates
The IRS divides capital gains into two categories based on how long you owned the asset before selling it. If you held it for one year or less, it is a short-term capital gain and is taxed at your ordinary income tax rate — the same rate as your salary or wages. If you held it for more than one year, it is a long-term capital gain and is taxed at a lower preferential rate.
Federal long-term capital gains rates are 0%, 15%, or 20%, depending on your taxable income and filing status. The 0% rate applies to lower-income filers; the 15% rate applies to most middle-income filers; and the 20% rate applies to high-income filers. These brackets change each year. Your broker or tax software will show you which rate applies based on your situation.
Short-term gains can be taxed at rates as high as 37% if you are in the highest income bracket. This is why holding an investment for more than a year often results in a much smaller tax bill on the same profit.
How to calculate your capital gain or loss
Your capital gain is the sale price minus your cost basis. Cost basis is usually what you paid for the asset, but it can be adjusted for certain events. If you inherited stock, your cost basis is typically the value on the date of death, not what the original owner paid. If you received stock as compensation, your cost basis is the fair market value on the date you received it. If you made improvements to real estate, you can add those costs to your basis.
If you sell for less than your cost basis, you have a capital loss. You can use capital losses to offset capital gains in the same year. If your losses exceed your gains, you can deduct up to $3,000 of the net loss against ordinary income. Any loss beyond $3,000 carries forward to future years.
Your broker will send you a Form 1099-B showing the sale price and your cost basis for most investments. Real estate sales are reported on Form 8949. Keep your purchase receipts and records of any improvements or adjustments, because you may need them if the IRS questions your basis.
State and local capital gains taxes
Federal capital gains tax is only part of what you may owe. Most states tax capital gains as part of ordinary income, meaning your state income tax rate applies to the gain. A few states have no income tax at all and therefore no capital gains tax: Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming.
A small number of states have separate capital gains taxes. Washington State taxes long-term capital gains on the sale of stocks and certain other investments at a flat 7% rate, with some exemptions for lower-income filers. Illinois taxes capital gains at a flat 4.75% rate. New York taxes capital gains as ordinary income but allows a deduction for certain gains. The rules vary significantly, so check your state's tax authority website for the current rules where you live.
If you live in a city with a local income tax — such as New York City or Columbus, Ohio — you may also owe local tax on capital gains. The rate and rules depend on your city.
Reporting capital gains on your tax return
You report capital gains and losses on Schedule D (Form 1040), which you attach to your main tax return. You list each sale separately, showing the date acquired, date sold, cost basis, sale price, and gain or loss. If you have many sales, you may also file Form 8949 (Sales of Capital Assets), which feeds into Schedule D.
Your broker sends you a Form 1099-B for each account showing sales during the year. The IRS receives a copy of this form, so your reported gains must match what your broker reported. If they do not match, the IRS will contact you to explain the difference.
If you sold real estate, you may also need to file Form 8949 and Schedule D-1 (if applicable in your state). If you sold a home and are claiming the primary residence exclusion — which lets you exclude up to $250,000 of gain if single or $500,000 if married filing jointly — you still report the sale on Schedule D but show the exclusion there.
Special situations: inherited assets and gifts
When you inherit an investment, you receive a stepped-up basis. This means your cost basis is the fair market value of the asset on the date of the owner's death, not what they originally paid. If the asset has appreciated significantly since purchase, this can eliminate most or all of the capital gains tax you would owe if you sell soon after inheriting.
If someone gives you an investment as a gift, you inherit their cost basis, not the current value. If the asset has appreciated, you will owe capital gains tax on the full appreciation when you sell, even though you did not own it during the appreciation period. This is one reason gifts of appreciated assets can be tax-inefficient compared to bequests.
If you sell an inherited asset within a short time after inheriting it, the stepped-up basis usually means you owe little or no capital gains tax, even if the asset was worth much more when the original owner died.
Frequently Asked Questions
Do I owe capital gains tax if I sell an investment at a loss?
No, you do not owe capital gains tax on a loss. Instead, you can use the loss to reduce any capital gains you had that year. If losses exceed gains, you can deduct up to $3,000 against ordinary income, and carry forward any remaining loss to future years.
What if I day trade stocks — do different rules explore?
Day traders are still subject to capital gains tax on each trade. Short-term gains (held under one year) are taxed as ordinary income. If you are classified as a professional trader by the IRS, different rules may explore, but this is rare and requires meeting specific criteria. Consult a tax professional if you trade frequently.
Can I avoid capital gains tax by holding an investment forever?
Yes, as long as you never sell. Capital gains tax is only owed when you sell. If you hold until death, your heirs receive a stepped-up basis and typically owe no tax on the appreciation that occurred during your lifetime. However, they will owe tax on any further appreciation after they inherit.
How do I know if I should hold an investment longer to get the long-term rate?
Compare the tax you would owe at the short-term rate versus the long-term rate on your expected gain. If the difference is large and you are comfortable holding the investment, waiting past the one-year mark often saves money. Your tax software or a tax professional can calculate the exact difference for your situation.
What happens if my broker reports the wrong cost basis?
Review the Form 1099-B your broker sends you. If the basis is wrong, you can correct it on your tax return by filing Form 8949 with an explanation. Keep your purchase records to support the correction. If the IRS questions it, you will need documentation of what you actually paid.