What capital gains tax is and when you owe it
Capital gains tax is a tax on the profit you make when you sell something you own — a house, stocks, land, a business, or other property — for more than you paid for it. The difference between what you paid and what you sold it for is your gain, and that gain is taxable income.
You owe capital gains tax only when you actually sell the asset. Holding it and watching its value go up does not trigger a tax bill. The tax applies to the profit itself, not to the full sale price. If you bought a house for $200,000 and sold it for $250,000, your capital gain is $50,000 — and that $50,000 is what gets taxed, not the entire $250,000.
Capital gains are reported on your federal tax return each year. Most states also tax capital gains, though the rules and rates vary by state. Some states have no capital gains tax at all.
Key Takeaways
- Capital gains tax applies only to the profit you make on a sale, calculated as the sale price minus what you originally paid plus any improvements you made.
- Long-term capital gains (assets held over one year) are taxed at lower federal rates than short-term gains, which are taxed as ordinary income.
- The federal long-term capital gains rate is 0%, 15%, or 20% depending on your income level, while short-term gains use your regular income tax bracket.
- You report capital gains on Schedule D of your tax return, and your state may also tax them at its own rate.
- Some assets like your primary home may may have access to for an exclusion that lets you avoid tax on part or all of the gain.
Long-term versus short-term capital gains
How long you hold an asset before selling it determines which tax rate applies. If you own it for more than one year, it is a long-term capital gain. If you sell it within one year, it is a short-term capital gain.
Short-term capital gains are taxed as ordinary income — meaning they use your regular income tax bracket, which can be as high as 37% at the federal level. Long-term capital gains have their own, lower tax brackets: 0%, 15%, or 20% at the federal level, depending on your total income. This is why holding an asset longer can save you money in taxes.
For example, if you are in the 24% income tax bracket and sell stock you held for six months, the gain is taxed at 24%. If you held that same stock for 14 months, the same gain might be taxed at 15% instead. The difference can be substantial on large gains.
How to calculate your capital gain
Your capital gain is the sale price minus your cost basis — the original price you paid, plus any costs directly tied to the purchase or sale. Cost basis includes the purchase price, broker fees, closing costs on real estate, and the cost of improvements you made to the property.
If you bought a rental house for $150,000, paid $5,000 in closing costs, and later spent $20,000 on a new roof, your cost basis is $175,000. If you sell it for $250,000, your capital gain is $75,000 ($250,000 minus $175,000). Routine maintenance does not count toward cost basis — only improvements that add value or extend the life of the asset.
If you inherited an asset, your cost basis is usually its value on the date of death, not what the original owner paid. This is called a step-up in basis and can significantly reduce or eliminate capital gains tax on inherited property.
Federal 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. The income thresholds change each year and differ based on your filing status.
| Tax Rate | Single Filers | Married Filing Jointly | Head of Household |
|---|---|---|---|
| 0% | Up to $47,025 | Up to $94,050 | Up to $62,975 |
| 15% | $47,025 to $518,900 | $94,050 to $583,750 | $62,975 to $551,350 |
| 20% | Over $518,900 | Over $583,750 | Over $551,350 |
These thresholds are adjusted annually for inflation. The IRS publishes updated amounts each year, usually in October or November for the following tax year. Your state may also impose its own capital gains tax on top of the federal rate.
Special rules for your primary home
If you sell your primary residence, you may be able to exclude up to $250,000 of the gain from federal tax (or $500,000 if you are married filing jointly). To may have access to, you must have owned the home and lived in it as your main home for at least two of the five years before the sale.
This exclusion applies only once every two years. If you sold a home and used the exclusion, you cannot use it again until two years have passed. The exclusion does not apply to investment properties, vacation homes, or rental properties — only to your primary residence.
If your gain exceeds the exclusion amount, the excess is taxed as a long-term capital gain at the rates described above. For example, if you are single and your gain is $350,000, you exclude $250,000 and pay tax on the remaining $100,000.
Reporting capital gains on your tax return
You report capital gains on Schedule D (Form 1040), which is part of your federal tax return. Schedule D asks for the date you bought the asset, the date you sold it, your cost basis, the sale price, and the resulting gain or loss.
If you have only a few transactions, you may be able to report them directly on Form 8949 (Sales of Capital Assets), which feeds into Schedule D. If you have many transactions — for example, from frequent stock trading — your broker will send you a summary statement that you can reference.
Long-term and short-term gains are reported separately on Schedule D. The form then calculates your net gain or loss and carries it to your main tax return. If you have capital losses, they can offset capital gains, and any remaining loss can reduce your ordinary income by up to $3,000 per year.
State capital gains taxes
Most states tax capital gains as part of ordinary income using their regular income tax rates, which range from 0% to over 13% depending on the state. A few states — including Washington, Tennessee, and Florida — have no income tax and therefore no capital gains tax.
A small number of states, including California, New York, and Washington D.C., have enacted separate capital gains taxes that apply only to long-term gains above a certain threshold. These rates and thresholds vary significantly and change over time. You will owe both federal and state capital gains tax unless your state has no income tax.
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 capital losses to offset capital gains from other sales. If your losses exceed your gains, you can deduct up to $3,000 of the net loss against your ordinary income in that year, and carry forward any remaining loss to future years.
What if I sell cryptocurrency or digital assets?
Cryptocurrency is treated like any other asset for capital gains purposes. If you buy Bitcoin for $10,000 and sell it for $25,000, you have a $15,000 capital gain. The holding period determines whether it is taxed as long-term or short-term. Exchanges and brokers report these transactions to the IRS, so they are subject to the same reporting requirements as stocks or real estate.
Can I reduce my capital gains 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. This works well for stocks, real estate, and other property that has increased in value. You cannot donate the asset and then claim a deduction for the gain — the tax benefit comes from the donation itself, not from avoiding the sale.
How do I know my cost basis if I inherited stock or property?
For inherited assets, your cost basis is the fair market value on the date the person died, not what they originally paid. This is called a step-up in basis. You may need to get a professional appraisal or use historical market data to establish that value. Your broker or the estate executor can often provide documentation of the stepped-up basis.
Do I owe capital gains tax on a 401(k) or IRA withdrawal?
No. Withdrawals from traditional 401(k)s and IRAs are taxed as ordinary income, not as capital gains, regardless of how much the investments grew inside the account. Roth IRA withdrawals are not taxed at all if you meet the holding requirements. The capital gains tax applies only to assets held outside retirement accounts.