Capital gains tax is the tax you owe when you sell an investment or property for more than you paid for it
The difference between what you paid for something and what you sold it for is your capital gain. The IRS taxes that profit. The tax rate depends on how long you held the asset before selling it — hold it less than a year and you pay your regular income tax rate; hold it a year or longer and you pay a lower rate set by federal law.
You report capital gains on Schedule D (Form 1040), which feeds into your main tax return. The IRS tracks this through your brokerage statements, real estate closing documents, and other sale records. If you sell stocks, mutual funds, rental property, a second home, or collectibles, you will likely have a capital gain or loss to report.
Capital losses (selling something for less than you paid) can offset capital gains, and you can deduct up to $3,000 of net losses against your other income in a single year. Losses beyond that carry forward to future years.
Key Takeaways
- Short-term capital gains (assets held one year or less) are taxed at your ordinary income tax rate, which can be as high as 37 percent depending on your income bracket.
- Long-term capital gains (assets held more than one year) are taxed at 0 percent, 15 percent, or 20 percent depending on your total income, which is usually lower than your ordinary rate.
- You report capital gains on Schedule D and attach it to your Form 1040; your brokerage or closing statement will show the purchase price and sale price you need.
- Capital losses can reduce your capital gains dollar-for-dollar, and unused losses can reduce other income by up to $3,000 per year.
- Certain assets like primary residences, collectibles, and real estate have special rules that change how much tax you owe.
The difference between short-term and long-term capital gains
The holding period determines your tax rate. If you buy a stock on March 15, 2023, and sell it on March 14, 2024, you held it less than one year — that is a short-term capital gain. You pay tax at your ordinary income tax rate, which ranges from 10 percent to 37 percent depending on your total income for the year.
If you sell that same stock on March 15, 2024 (one year and one day), it becomes a long-term capital gain. The federal tax rate is now 0 percent, 15 percent, or 20 percent, depending on your income. For 2024, the 15 percent rate applies to most people; the 0 percent rate applies to lower-income filers; and the 20 percent rate applies to high-income filers. These rates are set by law and change only when Congress acts.
The difference matters. A $10,000 short-term gain taxed at 37 percent costs $3,700. The same $10,000 as a long-term gain taxed at 15 percent costs $1,500. Holding an investment just a few extra weeks or months can save thousands in tax.
How to calculate your capital gain or loss
Start with your cost basis — the original price you paid plus any fees or commissions. For stocks, this is the purchase price per share times the number of shares. For real estate, it includes the purchase price, closing costs, and certain improvements (a new roof, not routine maintenance).
Subtract your cost basis from the sale price. If you sold 100 shares bought at $50 per share ($5,000 basis) and sold them at $75 per share ($7,500 sale price), your gain is $2,500. If you sold them at $40 per share ($4,000), your loss is $1,000.
Your brokerage will send you a Form 1099-B showing the sale price and, in many cases, the cost basis. Real estate closings produce a Closing Disclosure or settlement statement with the sale price; you keep your original purchase documents for the basis. Do not rely on the brokerage or closing statement alone — verify the cost basis yourself, because errors on these forms happen and cost you money if you do not catch them.
Reporting capital gains on your tax return
You report all capital gains and losses on Schedule D, which is a two-page form that comes with Form 1040. Part I lists short-term gains and losses; Part II lists long-term gains and losses. You add up each section, then combine them to get your net capital gain or loss for the year.
If your net result is a gain, that number goes to Form 1040 and is added to your other income. If it is a loss, you can deduct up to $3,000 against your wages, interest, and other ordinary income. Any loss beyond $3,000 carries forward to next year — you do not lose it.
You will need your 1099-B forms from brokerages, your closing documents from real estate sales, and any records of improvements you made to property. Organize these by asset and by year sold before you start filling out Schedule D. The form asks for the date acquired, date sold, sales price, and cost basis for each transaction.
Special rules for real estate and primary residences
If you sell a home you lived in as your primary residence for at least two of the last five years, you can exclude up to $250,000 of gain from tax (or $500,000 if you are married filing jointly). This exclusion applies once every two years. You still report the sale on Schedule D, but you subtract the exclusion before calculating your taxable gain.
Rental property and investment real estate do not get this exclusion. You pay capital gains tax on the full profit. However, you can deduct depreciation you claimed on the property while you rented it — but the IRS taxes that depreciation at 25 percent when you sell, which is higher than the long-term capital gains rate. This is called depreciation recapture.
If you inherited property, your cost basis "steps up" to the fair market value on the date of death, not the original purchase price. This can eliminate or greatly reduce the capital gain if the property increased in value over many years. Keep the death certificate and a professional appraisal or tax assessment from the date of death to prove the stepped-up basis.
Capital losses and how to use them
When you sell an investment at a loss, you can use that loss to offset capital gains from other sales in the same year. If you sold Stock A for a $5,000 gain and Stock B for a $2,000 loss, your net capital gain is $3,000. You report both on Schedule D and the form calculates the net for you.
If your losses exceed your gains, you can deduct up to $3,000 of the net loss against your salary, interest income, and other ordinary income in that year. If you have a $10,000 net loss, you deduct $3,000 this year and carry the remaining $7,000 forward to next year, where you can use it the same way.
This carryforward has no time limit — you can use losses from 2020 in 2030 if you have not used them by then. Keep a record of any loss carryforward on a separate sheet so you remember to claim it in future years. The IRS does not remind you.
Frequently Asked Questions
Do I owe capital gains tax if I sell an investment at a loss?
No. A loss means you sold for less than you paid, so there is no gain to tax. You report the loss on Schedule D, and it reduces any capital gains you have. If losses exceed gains, you can deduct up to $3,000 against your other income that year.
What if I bought a stock years ago and do not know what I paid for it?
Contact your brokerage — they keep records for at least seven years and can provide your original purchase price. If the brokerage is gone or records are lost, you can use a reasonable estimate based on historical price data, but document your method. The IRS may ask, and you need to show your work.
Do I pay capital gains tax on money I made from a 401(k) or IRA?
No. Withdrawals from traditional 401(k)s and IRAs are taxed as ordinary income, not capital gains, regardless of how much the investments grew inside the account. Roth IRAs have no tax on withdrawals if you follow the rules. Capital gains tax applies only to investments held outside retirement accounts.
Can I deduct investment losses from my paycheck?
Only up to $3,000 per year. If you have a $10,000 net capital loss, you deduct $3,000 against your wages and other income this year. The remaining $7,000 carries forward to next year, where you can deduct another $3,000, and so on until the loss is used up.
What counts as a capital asset for tax purposes?
Stocks, bonds, mutual funds, real estate, and collectibles (art, coins, precious metals) are capital assets. Your primary residence is also a capital asset, but it gets the special exclusion. Inventory you hold for sale in a business is not a capital asset — gains on inventory are ordinary business income.