Capital gains tax is the tax you pay when you sell an investment for more than you paid for it
When you sell a stock, bond, real estate, or other investment at a profit, the IRS taxes that profit as capital gains. The amount you owe depends on how long you held the investment, your total income for the year, and your tax filing status. The calculation itself is straightforward: subtract what you paid (your basis) from what you received when you sold it (your proceeds), and that difference is your gain. The tax rate applied to that gain is where the rules split into two categories.
You do not owe capital gains tax on investments you still own, only on ones you have sold. You also do not owe it if you sold at a loss — though you can use losses to offset gains in the same year or carry them forward to future years.
Key Takeaways
- Capital gains are the profit from selling an investment, calculated as the sale price minus what you originally paid for it.
- Short-term capital gains (held one year or less) are taxed as ordinary income at your regular tax rate, which can be 10%, 12%, 22%, 24%, 32%, 35%, or 37% depending on your income.
- Long-term capital gains (held more than one year) are taxed at lower rates: 0%, 15%, or 20%, depending on your total income and filing status.
- You report capital gains on Schedule D (Form 1040) and must track the purchase date, sale date, purchase price, and sale price for each investment sold.
- Capital losses can reduce your capital gains dollar-for-dollar, and unused losses can be carried forward to future tax years.
Short-term versus long-term capital gains rates
The holding period determines which tax rate applies. If you sell an investment you owned for one year or less, it is a short-term capital gain, and it is taxed at your ordinary income tax rate. That rate depends on your total income and filing status for the year — it could be 10%, 12%, 22%, 24%, 32%, 35%, or 37%.
If you sell an investment you owned for more than one year, it is a long-term capital gain, and it receives preferential tax treatment. Long-term gains are taxed at 0%, 15%, or 20%, depending on your income level and filing status. For 2024, for example, a single filer pays 0% on long-term gains up to $47,025 of taxable income, 15% from $47,025 to $518,900, and 20% above that. These income thresholds change each year.
The date that matters is the date you sold the investment, not the date you bought it. If you bought a stock on June 15, 2023, and sold it on June 16, 2024, you held it for more than one year, so it qualifies for long-term rates.
How to calculate your capital gain or loss
Start with your cost basis, which is what you paid for the investment plus any fees or commissions. If you bought 100 shares of a stock at $50 per share and paid a $10 commission, your basis is $5,010 total, or $50.10 per share.
Next, determine your proceeds, which is what you received when you sold it. If you sold those 100 shares at $75 per share and paid a $10 commission to sell, your proceeds are $7,490 total, or $74.90 per share.
Your capital gain is proceeds minus basis. In this example: $7,490 − $5,010 = $2,480 gain. If the proceeds had been less than the basis, you would have a capital loss instead.
For inherited investments, your basis is typically the market value on the date the person died, not what they originally paid. This is called a step-up in basis, and it can significantly reduce or eliminate capital gains tax if you sell the investment soon after inheriting it.
Reporting capital gains on your tax return
You report capital gains and losses on Schedule D, which attaches to your Form 1040. The IRS also receives a copy of your sales from your brokerage on Form 8949, so your numbers must match what the brokerage reported.
For each investment sold, you need to record the date acquired, date sold, proceeds, cost basis, and whether it was short-term or long-term. Most brokerages provide this information in a year-end statement or tax report, though you should verify the cost basis is correct — brokerages sometimes make errors, especially for inherited shares or dividend reinvestments.
If you have both short-term and long-term gains in the same year, you report them separately on Schedule D. Short-term gains and losses are netted together first, then long-term gains and losses are netted together. If you have a net loss in either category, you can use up to $3,000 of it to offset ordinary income in that tax year. Any loss above $3,000 carries forward to future years.
Using capital losses to reduce your tax bill
If you sold an investment at a loss, that loss can reduce your capital gains dollar-for-dollar. If you had $5,000 in long-term gains and $2,000 in long-term losses in the same year, your net long-term gain is $3,000, and that is what you pay tax on.
If your total capital losses exceed your total capital gains in a year, you can use up to $3,000 of the excess loss to reduce your ordinary income. For example, if you had $2,000 in gains and $7,000 in losses, you would have a $5,000 net loss. You could use $3,000 to reduce your ordinary income that year, and the remaining $2,000 would carry forward to the next tax year.
This strategy is sometimes called tax-loss harvesting: selling an investment at a loss to offset gains elsewhere or to reduce ordinary income, then buying a similar (but not identical) investment to maintain your market exposure. The IRS has a wash-sale rule that prevents you from claiming a loss if you buy the same or substantially identical investment within 30 days before or after the sale, so timing matters.
Special situations: real estate, collectibles, and may have access to small business stock
Most investments follow the standard long-term and short-term rules above. Real estate held for investment or business use follows the same capital gains rules, though you may also owe depreciation recapture tax at 25% on the portion of your gain that came from depreciation deductions you claimed in prior years.
Collectibles — art, coins, stamps, and similar items — are taxed at a maximum long-term rate of 28%, not the standard 0%, 15%, or 20%. Precious metals held as collectibles also fall into this category.
may have access to small business stock (stock in a C corporation with gross assets under $50 million at the time you bought it) may allow you to exclude 50%, 75%, or 100% of your gain from taxation if you held it for more than five years. This is a complex rule with strict requirements, and you would need to report it on Form 8949 and Schedule D with the appropriate exclusion noted.
State and local capital gains taxes
In addition to federal capital gains tax, some states impose their own capital gains tax or treat capital gains as ordinary income subject to state income tax. A few states — including Washington, Illinois, and California — have enacted or proposed capital gains taxes that explore to long-term gains above a certain threshold, typically ranging from 1% to 13.3% depending on the state and the gain amount.
Most states that have income tax treat capital gains as part of your taxable income and tax them at your state income tax rate, which varies by state from 0% to over 13%. A handful of states have no income tax at all. Your state's tax treatment can significantly affect your total tax bill, so check your state's rules if you live outside a no-income-tax state.
Frequently Asked Questions
Do I owe capital gains tax if I reinvest the money?
Yes. Capital gains tax is based on the profit you made, not on what you do with the money afterward. Whether you spend it, reinvest it, or leave it in cash does not change the tax you owe. The tax is due when you file your return for the year you sold the investment.
What if I sold at a loss — can I claim that?
Yes. Capital losses reduce your capital gains dollar-for-dollar. If you have more losses than gains, you can use up to $3,000 of the excess loss to reduce your ordinary income. Any loss beyond that carries forward to future years and can be used the same way.
How do I know my cost basis if I inherited an investment?
Inherited investments receive a step-up in basis to their market value on the date of death. Your broker or the estate executor should provide this value. You use that stepped-up basis, not what the original owner paid, so if you sell soon after inheriting, you may owe little or no capital gains tax.
Do I have to report capital gains if they are under a certain amount?
Yes, you must report all capital gains and losses on Schedule D, regardless of the amount. The IRS receives a copy from your broker on Form 8949, so your return must match. However, if your total capital gains are small and you have no other income, you may owe no tax due to the standard deduction.
What is the wash-sale rule and how does it affect my losses?
The wash-sale rule prevents you from claiming a loss if you buy the same or substantially identical investment within 30 days before or after the sale. If you violate this rule, the loss is disallowed for that year and added to your basis in the new investment instead. The rule applies to stocks, bonds, and mutual funds, but not to real estate.