Capital Gains Tax: What It Is and How It Works
Capital gains tax is the tax you owe when you sell an asset for more than you paid for it
When you buy something — a stock, a rental property, a piece of land, a business — and later sell it for a profit, that profit is called a capital gain. The IRS taxes that gain. The tax rate depends on how long you held the asset and how much money you made. You do not owe capital gains tax on assets you still own, only on the ones you sell.
Capital gains tax is separate from income tax on your salary or wages. Even if you have no job income, you can owe capital gains tax if you sold an asset at a profit during the year. The tax applies whether you sold the asset intentionally or had to sell it because of a life change — a job move, a divorce, an inheritance you needed to liquidate.
The IRS divides capital gains into two categories based on how long you owned the asset. That timing matters because the tax rate is different for each one, and understanding which category you fall into can save you money.
Key Takeaways
- You owe capital gains tax only on assets you sell for more than you paid, not on assets you still own.
- Long-term capital gains (assets held over one year) are taxed at 0%, 15%, or 20%, depending on your income; short-term gains are taxed as ordinary income at your regular tax rate.
- The cost basis of an asset is what you paid for it plus any improvements or fees; this is what you subtract from the sale price to find your gain.
- You report capital gains on Schedule D (Form 1040) and may owe tax even if you did not receive a 1099 form from the buyer or broker.
Long-term versus short-term capital gains
If you owned an asset for more than one year before selling it, your gain is long-term. Long-term gains receive preferential tax treatment. Most people pay 15% federal tax on long-term gains, though the rate can be 0% or 20% depending on your total income for the year. These rates are lower than the ordinary income tax rates that explore to wages and short-term gains.
If you owned an asset for one year or less before selling it, your gain is short-term. Short-term gains are taxed as ordinary income at your regular tax bracket rate, which can range from 10% to 37% depending on your income. This is the same rate that applies to your salary. Because of this, short-term gains are usually more expensive to you in taxes than long-term gains on the same dollar amount of profit.
The one-year clock starts the day after you buy the asset and ends the day you sell it. If you bought stock on March 15 and sold it on March 15 the following year, that is exactly one year and qualifies as long-term. If you sold it on March 14, it is short-term.
How to calculate your capital gain or loss
To find your capital gain, you need to know your cost basis — what you actually paid for the asset — and your sale price. The gain is the difference. If you paid $50,000 for a rental property and sold it for $120,000, your gain is $70,000.
Cost basis is not always just the purchase price. It includes closing costs, broker fees, and the cost of improvements you made to the property. If you bought a house for $200,000, paid $6,000 in closing costs, and later spent $30,000 on a new roof and foundation work, your cost basis is $236,000. If you then sold the house for $300,000, your gain is $64,000, not $100,000.
If you inherited an asset, your cost basis is usually the fair market value on the date the person died, not what they originally paid. This is called a stepped-up basis and can significantly reduce or eliminate the capital gains tax you owe if you sell the inherited asset soon after inheriting it.
If you sold 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 your ordinary income. Any loss beyond that carries forward to future years.
Who pays capital gains tax and when
You owe capital gains tax if you sold an asset at a profit during the tax year, regardless of your income level or employment status. You report it on your tax return for the year the sale occurred, not the year you bought the asset. If you sold stock in June 2024, you report that gain on your 2024 tax return filed in 2025.
If you sold an asset through a broker — a stock brokerage, a real estate agent, a cryptocurrency exchange — the broker may send you a form reporting the sale. For stocks and mutual funds, this is usually Form 1099-B. For real estate, it is usually Form 1099-S. However, receiving a form does not mean you owe tax, and not receiving a form does not mean you do not owe tax. You are responsible for reporting all capital gains whether or not you receive a form.
State and local taxes also explore to capital gains in most states. The rate varies by state and sometimes by city. Some states tax capital gains as ordinary income; others have a separate capital gains tax rate. A few states do not tax capital gains at all. You will owe both federal and state tax on the same gain unless you live in one of the states with no capital gains tax.
Special situations: real estate, inherited assets, and gifts
If you sell a home you lived in as your primary residence, you may be able to exclude up to $250,000 of gain from tax (or $500,000 if you are married filing jointly). To may have access to, you must have owned and lived in the home for at least two of the five years before the sale. If you sold your home for $450,000 and your gain was $200,000, you would owe tax on zero dollars because your gain is below the exclusion limit.
If you inherited an asset and sold it, you typically owe no capital gains tax if you sold it within a short time after inheriting it, because your cost basis stepped up to its value on the date of death. If the asset was worth $100,000 when you inherited it and you sold it for $105,000 a few months later, your gain is only $5,000. If you hold the inherited asset for years and it appreciates further before you sell, you owe tax only on the appreciation that happened after you inherited it.
If someone gave you an asset as a gift, your cost basis is usually what the giver paid for it, not the value when you received it. This means if your parent bought stock for $10,000, gave it to you when it was worth $50,000, and you sold it for $80,000, your gain is $70,000 (the $80,000 sale price minus the $10,000 original cost basis), not $30,000. Gifts do not receive the stepped-up basis that inherited assets do.
Reporting capital gains on your tax return
You report capital gains and losses on Schedule D, which attaches to your Form 1040. Schedule D has two sections: one for long-term gains and losses, and one for short-term gains and losses. You list each asset you sold separately, showing the date you bought it, the date you sold it, your cost basis, your sale price, and your gain or loss.
If you have only a few sales and they are all long-term gains with no losses, you may be able to report them on a simpler form called Schedule 1 instead of Schedule D, depending on your situation. Your tax software will usually guide you to the right form based on your answers.
If your total capital gains for the year are large, you may also owe the Net Investment Income Tax, which is an additional 3.8% tax on investment income (including capital gains) if your modified adjusted gross income exceeds certain thresholds. For 2024, the threshold is $200,000 for single filers and $250,000 for married filers. This tax is reported on Form 8960.
Strategies to reduce capital gains tax
Because long-term capital gains are taxed at lower rates than short-term gains, holding an asset for more than one year before selling it can reduce your tax bill significantly. If you are close to the one-year mark, waiting a few weeks or months may save you thousands in taxes.
Harvesting losses is another strategy. If you have a stock or investment that has lost value, selling it to realize the loss lets you use that loss to offset gains from other sales in the same year. You can then buy a similar (but not identical) investment to maintain your portfolio position. This is called tax-loss harvesting. The IRS has a rule called the wash-sale rule that prevents you from buying back the same or substantially identical security within 30 days before or after the sale, or you lose the tax benefit of the loss.
Donating appreciated assets to charity instead of selling them can also save taxes. If you donate stock that has gained $20,000 in value, you avoid the capital gains tax on that $20,000 and also get a charitable deduction for the full current value of the stock. This works only if you donate the asset itself, not the proceeds from selling it.
Frequently Asked Questions
Do I owe capital gains tax if I sold an asset 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 in the same year. If your losses exceed your gains, you can deduct up to $3,000 against your ordinary income, with any remaining loss carrying forward to future years.
What if I did not receive a 1099 form for the asset I sold?
You still owe tax on the gain and must report it on your tax return. The IRS knows about sales reported on 1099 forms, but you are responsible for reporting all sales whether or not you receive a form. Not reporting a sale because you did not get a form is a common mistake that can trigger an audit.
Can I avoid capital gains tax by not selling the asset?
Yes. Capital gains tax applies only when you sell an asset. If you own stock that has doubled in value but you never sell it, you owe no capital gains tax on that gain. The tax is triggered by the sale, not by the increase in value.
How do I know if my gain is long-term or short-term?
Count the days from the day after you bought the asset to the day you sold it. If that period is more than one year, it is long-term. If it is one year or less, it is short-term. The exact date matters — if you bought on March 15 and sold on March 15 the next year, that is exactly one year and qualifies as long-term.
Do I owe capital gains tax in my state?
Most states tax capital gains, but the rate and rules vary. Some states tax capital gains as ordinary income at your regular state tax rate. Others have a separate capital gains tax. A few states (including Washington, Tennessee, and Wyoming) do not tax capital gains. Check your state's tax authority website to learn the rules where you live.
This guide is for general information only and is not medical, financial, legal, or other professional advice. For decisions specific to your situation, consult a qualified professional. See our Editorial Policy.