You pay capital gains tax when you sell an investment or property for more than you paid for it, and the timing depends on how long you held it
Capital gains tax is owed on the profit you make when you sell something you own — a stock, a house, land, or a business. The holding period (how long you owned it) determines your tax rate. If you held the asset for one year or less, you pay short-term capital gains tax at your ordinary income tax rate. If you held it for more than one year, you pay long-term capital gains tax at a lower rate — either 0%, 15%, or 20%, depending on your income.
You do not pay the tax when you buy. You do not pay it while you own the asset. You pay it in the year you sell, when you file your tax return for that year. If you sell in December 2024, you report the gain on your 2024 tax return, filed in early 2025.
Key Takeaways
- Short-term capital gains (assets held one year or less) are taxed as ordinary income at your regular tax bracket, which is usually higher than long-term rates.
- Long-term capital gains (assets held more than one year) are taxed at 0%, 15%, or 20% depending on your total income for the year.
- You report capital gains on your tax return in the year you sell, not when you buy or while you hold the asset.
- The sale price minus what you originally paid equals your gain; if you sell for less than you paid, you have a loss that can offset other gains.
- Certain assets like primary homes may be excluded from capital gains tax if you meet holding and use requirements.
How the holding period affects your tax rate
The difference between short-term and long-term rates is significant. If you are in the 24% federal income tax bracket and sell a stock you owned for six months, your profit is taxed at 24%. If you sell the same stock after owning it for 13 months, the same profit is taxed at 15% (assuming your income level qualifies for that bracket).
The holding period clock starts the day after you buy and ends the day you sell. If you bought on January 15, 2024, and sold on January 15, 2025, you held it for exactly one year, which qualifies as long-term. If you sold on January 14, 2025, it is short-term.
Long-term capital gains rates are 0%, 15%, or 20% at the federal level. Your income determines which bracket you fall into. For 2024, single filers with taxable income up to $47,025 may pay 0% on long-term gains. Income from $47,026 to $518,900 is taxed at 15%. Income above that is taxed at 20%. These thresholds change each year.
What counts as a capital gain and what does not
A capital gain is the difference between what you sold something for and what you paid for it, including any improvements you made. If you bought a rental house for $200,000, spent $50,000 on renovations, and sold it for $350,000, your gain is $100,000 (not $150,000). The improvements are added to your cost basis.
Not all sales trigger capital gains tax. Wages, interest, and dividends are ordinary income, not capital gains. Losses on the sale of personal items (your car, furniture, clothes) are not deductible. However, losses on investments can offset capital gains — if you sold one stock for a $5,000 gain and another for a $3,000 loss, you report a net gain of $2,000.
Some assets are exempt or treated differently. The sale of your primary home is excluded from capital gains tax if you owned and lived in it for at least two of the last five years before the sale. The exclusion is up to $250,000 for single filers and $500,000 for married couples filing jointly. Inherited assets receive a "step-up in basis," meaning the cost basis resets to the fair market value on the date of death, which can eliminate or reduce capital gains tax for heirs.
When you actually owe the tax
You do not owe capital gains tax until you file your tax return for the year in which you sold the asset. If you sell in March 2024, you report it on your 2024 tax return, due April 15, 2025. You do not make a separate payment when you sell — the tax is calculated when you file.
If you expect a large capital gain, you may need to make estimated tax payments during the year to avoid penalties. Estimated taxes are paid quarterly (April 15, June 17, September 16, and January 15 of the following year). Your broker or tax software can help you calculate whether you need to pay estimated taxes based on your expected gains.
If you sold an asset through a broker (stocks, bonds, mutual funds), the broker reports the sale to the IRS on Form 1099-B. If you sold real property, the title company or real estate agent reports it on Form 1099-S. You must report these sales on your tax return even if you did not receive a form.
State and local capital gains taxes
In addition to federal capital gains tax, some states and cities charge their own capital gains tax or treat capital gains as ordinary income subject to state income tax. Washington, Illinois, and California have separate capital gains taxes. New York City charges a local tax on gains from the sale of real property. Other states tax capital gains as part of regular income at your state tax rate.
If you live in a state with no income tax (Texas, Florida, Nevada, South Dakota, Tennessee, Wyoming, Alaska, and New Hampshire), you owe no state capital gains tax. If you moved during the year you sold an asset, you may owe tax to both your old state and your new state, depending on when you moved and where the asset was located.
How to calculate your capital gain
The basic formula is straightforward: sale price minus cost basis equals capital gain. Cost basis is what you paid for the asset plus any fees (broker commissions, closing costs) and improvements (for real estate). If you inherited the asset, your basis is the fair market value on the date of death.
For stocks and mutual funds, if you bought shares at different times and prices, you must specify which shares you are selling. You can use the "first in, first out" method (FIFO), which assumes you sold the oldest shares first. You can use the "specific identification" method, which lets you choose which shares to sell — this often results in a lower tax bill because you can sell higher-cost shares first. Your broker can help you track this.
For real estate, keep records of your purchase price, closing costs, and any capital improvements (a new roof, addition, or major repair). Routine maintenance (painting, repairs) does not count as an improvement. If you rented out the property, you can deduct depreciation you claimed in prior years, but this reduces your basis and may trigger depreciation recapture tax at a higher rate.
What happens if you have a capital 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. If you have $10,000 in gains and $3,000 in losses, you report a net gain of $7,000.
If your losses exceed your gains in a year, you can deduct up to $3,000 of the net loss against ordinary income. Any losses beyond $3,000 carry forward to future years, where you can use them to offset future gains or ordinary income (again, up to $3,000 per year). This means a large loss can reduce your tax burden over several years.
Frequently Asked Questions
Do I owe capital gains tax if I sell at a loss?
No, you do not owe capital gains tax on a loss. Instead, you can use the loss to reduce capital gains from other sales. If losses exceed gains, you can deduct up to $3,000 against ordinary income in that year, with any remaining loss carried forward to future years.
What if I sold a stock and reinvested the money right away?
Reinvesting does not change your tax obligation. You owe capital gains tax on the profit from the sale regardless of what you do with the money. The holding period for the new investment starts fresh from the purchase date.
Do I owe capital gains tax on cryptocurrency or NFTs?
Yes. The IRS treats cryptocurrency and NFTs as property, not currency. When you sell them for a profit, you owe capital gains tax at short-term or long-term rates depending on how long you held them. You must report all sales, even small ones.
Can I avoid capital gains tax by holding an asset forever?
You avoid paying capital gains tax while you hold the asset, but you will owe it when you eventually sell. The only way to avoid it entirely is to never sell or to pass the asset to heirs, who receive a step-up in basis and can sell without owing tax on the gain that occurred during your lifetime.
What if I inherited an asset that had gained value before I inherited it?
You do not owe tax on the gain that occurred before you inherited it. Your cost basis is the fair market value on the date of death. If the asset gains value after you inherit it and you later sell it, you owe tax only on the gain after the inheritance date.