Capital gains tax is the tax you owe when you sell something for more than you paid for it
When you buy an asset — a house, stock, or piece of land — and later sell it for a higher price, the profit is called a capital gain. The IRS taxes that profit. The amount you owe depends on how long you held the asset and your income level. If you held it for less than a year, you pay your regular income tax rate on the gain. If you held it for more than a year, you pay a lower rate — either 0%, 15%, or 20%, depending on your total income.
The tax applies to most things you own for investment or personal use, but the rules differ by asset type. Real estate, stocks, bonds, and collectibles all have their own treatment. Some assets — like your primary home — have exemptions that can save you thousands in taxes.
Key Takeaways
- Capital gains tax applies only to profit, not the full sale price — if you bought a house for $300,000 and sold it for $350,000, you owe tax only on the $50,000 gain.
- 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 rates up to 37%.
- You can exclude up to $250,000 in gains on the sale of your primary home if you meet ownership and use tests, or $500,000 if you are married filing jointly.
- You report capital gains on Schedule D of your tax return, and the IRS receives a matching report from your broker or the person who bought your asset.
The difference between long-term and short-term capital gains
How long you own an asset before selling it determines which tax rate applies. If you sell within one year of purchase, the gain is short-term and taxed as ordinary income — the same rate as your wages or salary. For 2024, that ranges from 10% to 37% depending on your tax bracket.
If you hold the asset for more than one year, the gain is long-term and qualifies for preferential rates. Most people pay 15%. You pay 0% if your income is below a certain threshold (for 2024, that is $47,025 for single filers, $94,050 for married filing jointly). You pay 20% only if your income exceeds the top bracket. This is why investors often hold assets longer — the tax savings can be substantial.
The holding period starts the day after you buy and ends the day you sell. If you buy on January 15 and sell on January 16 of the next year, you have held it long-term.
How to calculate your capital gain
The calculation is straightforward: sale price minus what you paid equals your gain. But "what you paid" includes more than just the purchase price. It includes basis — the original cost plus any improvements you made.
For a house, basis includes the purchase price plus the cost of a new roof, addition, or major renovation. It does not include routine maintenance like painting or repairs. For stocks, basis is the purchase price plus any fees you paid to buy them. If you inherited an asset, your basis is its value on the date of death, not what the original owner paid — this is called a "step-up in basis" and can eliminate or reduce the tax.
Example: You buy a rental house for $200,000. You spend $50,000 on a new foundation. Your basis is $250,000. You sell for $400,000. Your gain is $150,000, not $200,000.
Capital gains on your primary home
The IRS allows you to exclude up to $250,000 in gains on the sale of your primary home if you meet two tests. You must have owned the home for at least two of the last five years, and you must have lived in it as your main home for at least two of the last five years. The two years do not have to be consecutive.
If you are married and file jointly, the exclusion is $500,000 — but both spouses must meet the ownership and use tests. If only one spouse meets the tests, the exclusion is $250,000. You can use this exclusion only once every two years.
This exclusion applies only to your primary residence. If you sell a vacation home, rental property, or investment real estate, you owe tax on the full gain (minus your basis). If your gain exceeds the exclusion amount, you owe tax on the excess.
How to report capital gains on your tax return
You report capital gains on Schedule D, which is part of your Form 1040. You list each sale separately: the date you bought, the date you sold, the sale price, your basis, and the gain or loss. The IRS also receives a copy from your broker or the buyer's title company, so misreporting is easy to catch.
If you have only one or two simple sales, you may be able to report them directly on Form 1040 without filing Schedule D, but most people need the full form. If you have losses, you can use them to offset 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. If losses exceed gains, you can deduct up to $3,000 of the excess loss against other income in that year, and carry forward any remaining loss to future years.
Your broker will send you a Form 1099-B showing all your sales for the year. Check it against your records before filing — if there is an error, contact the broker to request a corrected form.
State and local taxes on capital gains
Federal capital gains tax is only part of the picture. Most states also tax capital gains, usually at your ordinary income tax rate. A few states — including Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming — do not tax capital gains at all. Others tax them at a flat rate or as part of income tax.
Some cities and counties also impose local taxes on capital gains. New York City, for example, taxes capital gains as part of its income tax. If you sell an asset and move to a different state, the state where you lived when you sold it usually gets to tax the gain, not the state you move to.
If you are subject to both federal and state capital gains tax, your total tax bill can be significant. A $100,000 long-term gain might owe $15,000 in federal tax plus $5,000 to $10,000 in state tax, depending on where you live.
Special situations: inherited assets, gifts, and wash sales
If you inherit an asset, your basis is its fair market value on the date of the owner's death, not what they paid for it. This is called a step-up in basis. If your parent bought a stock for $10,000 and it is worth $100,000 when they die, your basis is $100,000. If you sell it the next day for $100,000, you owe no capital gains tax. This can save heirs thousands in taxes.
If someone gives you an asset as a gift, your basis is generally the giver's basis, not the value on the date of the gift. If your parent bought a stock for $10,000, gave it to you when it was worth $50,000, and you sell it for $60,000, your gain is $50,000 (not $10,000). However, if the asset has declined in value, you use the lower of the giver's basis or the fair market value on the date of the gift.
A wash sale occurs when you sell a stock at a loss and buy the same or a substantially identical stock within 30 days before or after the sale. The IRS disallows the loss deduction and adds the loss to your basis in the new shares. This rule prevents people from claiming a loss for tax purposes while maintaining their investment position.
Frequently Asked Questions
Do I owe capital gains tax if I sell at a loss?
No. If you sell an asset for less than you paid for it, you have a capital loss, not a gain. You can use the loss to offset capital gains from other sales. If losses exceed gains, you can deduct up to $3,000 against other income in that year and carry forward the rest to future years.
What if I sell a rental property or investment real estate?
Rental and investment properties do not may have access to for the primary home exclusion. You owe capital gains tax on the full gain. However, you may be able to deduct depreciation recapture — a separate tax on the depreciation deductions you claimed while you owned the property. This is taxed at 25%, not the long-term capital gains rate.
How do I know if my gain is long-term or short-term?
Count the days from the day after you bought to the day you sold. If it is more than 365 days, it is long-term. Your broker's statements usually show the holding period automatically, so check there first before calculating manually.
Can I reduce my capital gains tax by donating the asset to charity instead of selling it?
Yes. 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 fair market value of the asset as a charitable contribution. You must own the asset long-term for this to work. This strategy is often more valuable than selling and donating the proceeds.
What happens to capital gains tax if I move to another country?
The IRS taxes U.S. citizens and permanent residents on worldwide income, including capital gains, regardless of where they live. If you move abroad, you still owe U.S. capital gains tax. You may also owe tax to your new country, though tax treaties sometimes prevent double taxation.