You owe capital gains tax when you sell an investment or property for more than you paid for it, and the tax is due in the year of the sale
The moment you trigger a capital gain — by selling stock, real estate, cryptocurrency, or other assets at a profit — you create a tax event. The IRS expects you to report that gain on your tax return for the year the sale happened, and you pay tax on it then, not when you originally bought the asset. The amount you owe depends on how long you held the asset and your income level that year.
You do not owe tax on an asset straightforward because it increased in value while you own it. A stock that doubled in price but you still hold is not taxed. The tax bill arrives only when you sell, trade, or otherwise dispose of the asset in a way that counts as a taxable event.
Key Takeaways
- Capital gains tax is due in the tax year when you sell the asset, reported on your tax return filed by April 15 of the following year.
- Long-term capital gains (assets held over one year) are taxed at lower rates than short-term gains, which are taxed as ordinary income.
- Your tax rate on long-term gains depends on your total income that year and ranges from 0%, 15%, or 20% depending on your tax bracket.
- Certain sales may be exempt or partially exempt from capital gains tax, including primary home sales up to $250,000 for single filers and $500,000 for married couples.
The difference between long-term and short-term capital gains
How long you owned the asset before selling it determines which tax rate applies. Long-term capital gains come from assets you held for more than one year. Short-term capital gains come from assets you held for one year or less. The distinction matters because short-term gains are taxed as ordinary income at your regular tax bracket, while long-term gains receive preferential rates.
If you bought stock on March 15, 2023, and sold it on March 14, 2024, that is a short-term gain taxed at your ordinary income rate, even if you held it for almost a year. If you sold that same stock on March 16, 2024, it becomes a long-term gain. The holding period is measured from the purchase date to the sale date, and the IRS counts both the purchase and sale dates in determining whether you crossed the one-year threshold.
Short-term gains can push you into a higher tax bracket for that year. Long-term gains are taxed separately and do not affect your ordinary income bracket, which is why they often result in a lower total tax bill even if your income is high.
Tax rates for long-term capital gains in 2024
Long-term capital gains are taxed at 0%, 15%, or 20% depending on your taxable income and filing status. These rates are lower than ordinary income tax brackets and do not change year to year — they are set by law. The 0% rate applies to the lowest earners, the 15% rate to middle-income filers, and the 20% rate to the highest earners.
For 2024, the 0% rate applies if your taxable income is $47,025 or less (single filers) or $94,050 or less (married filing jointly). The 15% rate applies to income above those thresholds up to $518,900 (single) or $583,750 (married filing jointly). Income above those amounts is taxed at 20%. These income thresholds adjust each year for inflation, so the ranges will shift in 2025 and beyond.
Your taxable income includes wages, interest, dividends, and other sources, not just capital gains. If you earn $60,000 in wages and have $20,000 in long-term capital gains, your total taxable income is $80,000, and the gains are taxed at the 15% rate because your total income falls in that bracket.
When you must report and pay the tax
You report capital gains on your federal tax return for the year the sale occurred. If you sold an asset in December 2024, you report it on your 2024 tax return, which you file by April 15, 2025. The tax is due on that same April 15 important date. You do not pay the IRS when ready after the sale — the payment is part of your annual tax filing.
If you expect to owe a large amount in capital gains tax and you have not had enough tax withheld from wages or made estimated tax payments during the year, you may owe a penalty for underpayment. The IRS calculates this based on whether your total tax payments (through withholding and estimated payments) were at least 90% of your 2024 tax or 100% of your 2023 tax, whichever is smaller. If you are concerned about a large gain, you can make an estimated tax payment before the year ends to avoid the penalty.
State income tax on capital gains varies by state. Some states tax capital gains as ordinary income, some tax them at a lower rate, and a few states do not tax capital gains at all. You will owe state tax in the state where you live, regardless of where the asset is located.
Sales that may be exempt or partially exempt from capital gains tax
Not all asset sales trigger capital gains tax. The most common exemption is the primary residence exclusion: if you sell your main home and meet the ownership and use tests, you can exclude up to $250,000 of gain from tax (single filers) or $500,000 (married filing jointly). You must have owned the home and lived in it as your primary residence for at least two of the five years before the sale.
Inherited assets receive a step-up in basis, which means the cost basis resets to the asset's value on the date of death. If your parent bought stock for $10,000 and it was worth $50,000 when they died, your new cost basis is $50,000. If you sell it when ready for $50,000, you owe no capital gains tax because you have no gain. This applies to most inherited property, though there are exceptions for certain retirement accounts and assets.
Charitable donations of appreciated assets can avoid capital gains tax entirely. If you donate stock that has doubled in value to a may have access to charity, you do not pay capital gains tax on the appreciation, and you may deduct the full current value as a charitable contribution. This strategy works only if you donate the asset itself, not the proceeds from selling it.
How to calculate your capital gain or loss
Your capital gain is the sale price minus your cost basis, which is what you paid for the asset plus any improvements or adjustments. If you bought 100 shares of stock for $50 per share ($5,000 total) and sold them for $80 per share ($8,000 total), your gain is $3,000.
Cost basis is not always straightforward. For real estate, your basis includes the purchase price plus the cost of improvements like a new roof or addition, but not maintenance like painting or repairs. For inherited property, the basis is the value on the date of death. For stock, if you bought shares at different times and prices, you can choose which shares you are selling — the specific identification method — to control your gain or loss.
If you sell an asset for less than you paid for it, 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 excess loss against ordinary income. Any remaining loss carries forward to future years.
Taxable events beyond selling
Selling is the most obvious way to trigger capital gains tax, but other transactions count as taxable events. Trading one asset for another — such as exchanging cryptocurrency for stock or swapping real estate — is treated as a sale of the first asset and a purchase of the second. You owe capital gains tax on any gain from the asset you gave up.
Gifting an asset to someone else is not a taxable event for you — you do not owe capital gains tax when you give away appreciated property. However, the person who receives the gift takes on your original cost basis, so if they later sell it, they will owe tax on the full gain from when you originally bought it. The exception is inherited property, which receives the step-up in basis described above.
Using an asset as collateral for a loan does not trigger capital gains tax. Receiving a distribution from a retirement account like a 401(k) or traditional IRA is not a capital gains event — it is taxed as ordinary income. Selling assets inside a traditional IRA or 401(k) does not trigger capital gains tax because the account itself is tax-deferred; you pay tax only when you withdraw money from the account.
Frequently Asked Questions
Do I owe capital gains tax if I sell at a loss?
No, you do not owe capital gains tax if you sell for less than you paid. Instead, you have a capital loss, which you can use to offset capital gains or up to $3,000 of ordinary income in the same year. Losses beyond that carry forward to future years.
What if I sell stock through my employer's 401(k) or IRA?
Selling inside a retirement account does not trigger capital gains tax. The account grows tax-deferred, and you pay ordinary income tax only when you withdraw money from the account. This applies to traditional IRAs, 401(k)s, and similar plans.
Do I have to pay capital gains tax the year I sell, or can I pay it later?
You report and pay capital gains tax in the year of the sale, as part of your annual tax return due April 15 of the following year. You cannot defer payment to a later year unless you use an installment sale agreement, which is rare and requires IRS approval.
How do I know if my home sale is exempt from capital gains tax?
The primary residence exemption excludes up to $250,000 (single) or $500,000 (married filing jointly) of gain if you owned and lived in the home as your main residence for at least two of the five years before the sale. You report this on Form 8949 when you file your tax return.
Can I reduce my capital gains tax by donating the asset instead of selling it?
Yes. If you donate appreciated stock, real estate, or other assets directly to a may have access to charity, you avoid capital gains tax on the appreciation and can deduct the full current value as a charitable contribution. You must donate the asset itself, not the proceeds from selling it.