What capital gains tax actually means and how it works
Capital gains tax is the tax you owe on profit when you sell something you own — a stock, a house, a rental property, or even cryptocurrency. The tax is not on the full sale price. It is only on the gain, which is the difference between what you paid for it and what you sold it for.
Here is the basic math: if you bought a stock for $5,000 and sold it for $8,000, your capital gain is $3,000. That $3,000 is what gets taxed, not the $8,000. The IRS taxes this gain at different rates depending on how long you held the asset and how much total income you made that year.
You report capital gains on your tax return using Form 8949 (Sales of Capital Assets) and Schedule D (Capital Gains and Losses). These forms tell the IRS which assets you sold, when you sold them, and how much you gained or lost on each one.
Key Takeaways
- Capital gain is the sale price minus what you originally paid, and only the gain gets taxed, not the full sale amount.
- Long-term gains (held over one year) are taxed at lower rates than short-term gains (held one year or less), which are taxed as regular income.
- Your tax rate depends on your total income for the year and your filing status, not just the size of the gain.
- You report gains on Form 8949 and Schedule D, and you can subtract losses from other sales to reduce the tax you owe.
- Inherited assets get a "step-up" in basis, meaning the cost basis resets to the value on the date of death, which usually eliminates or reduces the gain.
The difference between long-term and short-term capital gains
The IRS taxes capital gains at two different rates depending on how long you owned the asset. If you held it for more than one year before selling, 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 gains are taxed like regular income — at your ordinary tax bracket, which can be 10%, 12%, 22%, 24%, 32%, 35%, or 37% depending on your total income and filing status. Long-term gains are taxed at lower rates: 0%, 15%, or 20%, again depending on your total income and filing status. For most people, long-term rates are significantly lower.
This is why holding an investment for just over one year can save you thousands in taxes. A $10,000 gain taxed as short-term income at the 24% bracket costs $2,400. The same gain taxed as long-term at the 15% rate costs $1,500. The difference is real money.
How to calculate your cost basis
Cost basis is what you originally paid for the asset, plus any fees or improvements you made to it. This is the number you subtract from the sale price to find your gain. Getting this right is critical because the IRS will compare it to what your broker reports.
For stocks and mutual funds, cost basis is usually straightforward: the price you paid per share times the number of shares, plus any commissions or fees. If you bought 100 shares at $50 per share and paid a $10 commission, your cost basis is $5,010.
For real estate, cost basis includes the purchase price plus the cost of improvements (a new roof, a deck, a kitchen remodel) but not repairs or maintenance. If you bought a house for $300,000 and spent $50,000 on a new foundation and addition, your cost basis is $350,000. If you spent $5,000 on painting and repairs, those do not count. Depreciation on rental properties also reduces your basis over time.
Your broker or financial institution will send you a Form 1099-B (for stocks and securities) or Form 1099-S (for real estate) showing the sale price. You will need your own records to prove the cost basis, so keep purchase confirmations, receipts for improvements, and closing documents.
Working through the tax rate brackets for your situation
Your capital gains tax rate depends on your total taxable income for the year, not just the size of the gain. The IRS stacks capital gains on top of your other income (wages, interest, dividends) and applies the rate that matches your total.
For 2024, the long-term capital gains brackets are 0%, 15%, and 20%. You fall into the 0% bracket if your total income is below a certain threshold — $47,025 for single filers, $94,050 for married filing jointly. You move to the 15% bracket above that, and to the 20% bracket at higher income levels. These thresholds change each year.
This means you might owe zero tax on some of your gain and 15% on the rest. If you are single and earned $40,000 in wages, and you have a $15,000 long-term capital gain, your total income is $55,000. The first $7,025 of the gain falls in the 0% bracket (up to $47,025 total), and the remaining $7,975 is taxed at 15%. You would owe $1,196 in capital gains tax, not $2,250.
Short-term gains are taxed at your ordinary income tax brackets, which range from 10% to 37%. If you are in the 24% bracket and have a $10,000 short-term gain, you owe $2,400 in tax on that gain alone.
Using capital losses to reduce what you owe
If you sold an asset at a loss, you can use that loss to reduce your capital gains tax. This is called tax-loss harvesting when done intentionally, and it is one of the few ways to lower your tax bill on investment income.
You report all gains and losses on Schedule D. If you have $15,000 in long-term gains and $6,000 in long-term losses, your net long-term gain is $9,000, and that is what gets taxed. The losses offset the gains dollar-for-dollar.
If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against your regular income (wages, salary, interest). Any loss beyond $3,000 carries forward to future years, where you can use it to offset future gains or income. This means a bad year in the market can reduce your taxes for years to come.
Special situations: inherited assets and primary residence sales
If you inherit an asset, you get a major tax break. The cost basis steps up to the fair market value on the date of the person's death. This means if your parent bought a house for $200,000 and it was worth $500,000 when they died, your cost basis is $500,000, not $200,000. If you sell it a month later for $510,000, your gain is only $10,000, not $310,000.
For your primary residence, you can exclude up to $250,000 of gain from tax if you are single, or $500,000 if you are married filing jointly. You must have owned and lived in the home for at least two of the last five years. This exclusion applies only once every two years, and it covers only your primary home, not rental properties or vacation homes.
If you sold your primary residence for $600,000 and your cost basis was $350,000, your gain is $250,000. As a single filer, you owe tax on zero dollars of that gain. As a married couple, you would owe tax on zero dollars as well. If the gain were $600,000, a married couple would owe tax on $100,000 of it.
What to report on your tax forms
You report capital gains using Form 8949 (Sales of Capital Assets) and Schedule D (Capital Gains and Losses). Form 8949 lists each transaction: the asset, the date you bought it, the date you sold it, the sale price, the cost basis, and the gain or loss. Schedule D summarizes your long-term and short-term gains and losses and calculates your net gain or loss for the year.
Your broker will send you Form 1099-B for securities sales or Form 1099-S for real estate sales. These forms show the sale price and sometimes the cost basis, depending on the type of asset and when you bought it. You need to match what you report on Form 8949 to what appears on these forms, or the IRS will flag the difference.
If you have no capital gains or losses, you do not file these forms. If you have only long-term gains and no losses, some tax software will let you report them directly on Schedule D without Form 8949, but this depends on your situation and the software you use.
Frequently Asked Questions
Do I owe capital gains tax if I have not sold yet?
No. Capital gains tax is only on the profit when you actually sell the asset. If you own a stock worth $10,000 more than you paid, you owe nothing until you sell it. The gain is "unrealized" until the sale happens. This is why some people hold investments for decades without paying tax on the growth.
What if I sold at a loss — do I get a refund?
No refund, but you can use the loss to reduce your taxes. You can deduct up to $3,000 of losses against your regular income in the year of the sale. Any excess loss carries forward to future years. If you had $8,000 in losses and $2,000 in gains, you would have a $6,000 net loss, and you could deduct $3,000 against your income this year and carry $3,000 forward.
Do I have to report every small stock trade?
Yes. Every sale of a security is a taxable event and must be reported on Form 8949, even if the gain is small. Your broker reports all sales to the IRS on Form 1099-B, so the IRS knows about them. Failing to report a sale can trigger an audit. Tax software and most brokers make it easier to report many transactions at once.
Can I avoid capital gains tax by donating the asset to charity?
Yes, and it is often the best strategy. If you donate an appreciated asset directly to a may have access to charity, you avoid the capital gains tax entirely and can deduct the full fair market value as a charitable contribution. If you sold the asset first and then donated the proceeds, you would owe capital gains tax on the gain. Donating the asset itself is almost always better.
What happens to capital gains if I die?
Your heirs inherit the asset with a stepped-up basis, meaning the cost basis becomes the fair market value on the date of your death. If you bought a stock for $10,000 and it was worth $50,000 when you died, your heirs' cost basis is $50,000. If they sell it when ready for $50,000, they owe zero capital gains tax. The gain you never paid tax on disappears.