The federal capital gains tax is a tax on the profit you make when you sell an asset for more than you paid for it
When you sell a stock, real estate, or other investment and pocket a gain, the federal government taxes that profit at rates that differ from ordinary income tax. The rate depends on how long you held the asset and how much total income you earned that year. Long-term gains — assets held over a year — are taxed at lower rates (0%, 15%, or 20%) than short-term gains, which are taxed as ordinary income at rates up to 37%. This structure exists because Congress treats investment income differently from wages: the theory is that lower rates encourage people to invest and hold assets longer rather than trade constantly.
The tax applies at the federal level only. Some states add their own capital gains tax on top, while others do not tax capital gains at all. Your total bill depends on both your federal rate and whether your state taxes gains.
Key Takeaways
- Long-term capital gains (assets held over one year) are taxed at 0%, 15%, or 20% depending on your total income; short-term gains are taxed as ordinary income.
- The rate you pay depends on your filing status and total taxable income for the year, not just the size of the gain itself.
- You report capital gains on Schedule D (Form 1040) and calculate the tax using the capital gains tax tables, which differ from ordinary income brackets.
- State capital gains taxes vary widely: some states do not tax gains at all, while others tax them as ordinary income or at a separate rate.
- Net capital losses can offset capital gains and up to $3,000 of ordinary income in a single year, with excess losses carried forward to future years.
How the federal rates are structured and what determines your rate
The federal capital gains tax uses three brackets: 0%, 15%, and 20%. Which bracket you fall into depends on your taxable income — your total income after deductions — and your filing status (single, married filing jointly, head of household, or married filing separately). The IRS publishes the exact income thresholds each year, and they change annually for inflation.
For 2024, a single filer pays 0% on long-term gains up to roughly $47,000 of taxable income, 15% on gains between roughly $47,000 and $518,900, and 20% on gains above that. A married couple filing jointly has higher thresholds — roughly $94,000 and $583,750. These numbers shift each year. The key point: your rate is determined by where your total taxable income lands, not by the size of the gain alone.
Short-term gains — profits from assets held one year or less — are not may be able to access for these preferential rates. Instead, they are taxed as ordinary income using the regular income tax brackets, which go up to 37%. This is why holding an investment for just over one year can make a significant difference in your tax bill.
The difference between long-term and short-term capital gains
The IRS draws a hard line at one year. If you sell an asset you have owned for more than 12 months, the gain qualifies as long-term and gets the preferential 0%, 15%, or 20% rates. If you sell it within 12 months, the gain is short-term and is taxed as ordinary income — the same way your salary is taxed.
This distinction matters enormously. Suppose you bought a stock for $10,000 and sold it for $15,000 after 11 months, making a $5,000 gain. If you are in the 24% ordinary income bracket, you owe $1,200 in federal tax on that gain. If you had waited one more month and sold it as a long-term gain, and your total income put you in the 15% capital gains bracket, you would owe only $750 — a $450 difference on the same profit, just for waiting.
The holding period clock starts the day after you buy the asset and ends on the day you sell it. Wash sales — selling a security at a loss and buying a substantially identical one within 30 days — do not reset the clock, but they do prevent you from deducting the loss.
How to report capital gains on your tax return
You report all capital gains and losses on Schedule D, which is part of Form 1040. You list each transaction separately: the date acquired, date sold, cost basis (what you paid), sale price, and the resulting gain or loss. If you have many transactions, you may attach a separate statement listing them all, with just the totals on Schedule D itself.
Schedule D separates short-term gains and losses from long-term ones. You net all short-term gains and losses together to get a short-term total, and all long-term gains and losses together to get a long-term total. If you have a net long-term gain, you then use the capital gains tax tables (not the ordinary income brackets) to calculate the tax on that gain. If you have both short-term and long-term gains, you calculate tax on each separately and add them together.
Your broker or investment platform sends you a Form 1099-B after the year ends, listing all your sales. The IRS receives a copy too, so your numbers must match. If you bought an asset years ago and do not have the original purchase documents, you may need to reconstruct the cost basis from old statements or contact the broker for historical records.
What happens when you have capital losses
Capital losses work in your favor, but with limits. If you sell an asset for less than you paid for it, you have a loss. You can use that loss to offset capital gains dollar-for-dollar. If you have $10,000 in long-term gains and $6,000 in long-term losses, your net long-term gain is $4,000, and you pay tax only on that $4,000.
If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against ordinary income — wages, interest, dividends, and other non-capital-gain income. If your total losses are $15,000 and your gains are $5,000, you have a $10,000 net loss. You can deduct $3,000 against ordinary income that year, and the remaining $7,000 carries forward to the next year, where you can use it again.
This carryforward continues indefinitely. You can use losses from 2020 to offset gains in 2025 if you have not used them up by then. However, losses can only offset gains and ordinary income — they cannot reduce your tax below zero or create a refund.
State capital gains taxes and how they add to the federal bill
Nine states — California, Connecticut, Delaware, Illinois, Maryland, Minnesota, New Jersey, New York, and Vermont — currently tax capital gains at the state level. Most of these states tax long-term gains as ordinary income, meaning you pay both the federal preferential rate and the state's ordinary income rate on the same gain. A few states, like Illinois, have a flat capital gains tax separate from income tax.
The remaining 41 states do not tax capital gains at all. If you live in Florida, Texas, Washington, or another no-tax state, you owe only the federal capital gains tax. If you live in California and sell a stock for a $50,000 long-term gain while earning $200,000 in wages, you might pay 15% federal ($7,500) plus California's top rate of roughly 13.3% ($6,650), for a combined $14,150 — nearly 28% of your gain.
State tax rules also vary on what counts as a gain. Some states tax only gains on securities; others include real estate. A few have different holding periods or rates. If you move between states during the year you sell an asset, you may owe tax to both states, though you can usually claim a credit for taxes paid to one state when filing in another.
Special situations: real estate, collectibles, and inherited assets
Real estate gains follow the same federal rules as stock gains, but with one major exception: the Section 121 exclusion lets you exclude up to $250,000 of gain ($500,000 if married filing jointly) if you owned and lived in the home as your primary residence for at least two of the five years before the sale. This means many home sales produce no taxable gain at all. The exclusion applies once every two years.
Collectibles — art, coins, precious metals, and similar items — are taxed at a flat 28% federal rate on long-term gains, not the preferential 0%, 15%, or 20% rates. This is higher than the standard long-term rate and applies even if your income would otherwise put you in the 15% bracket. Short-term collectible gains are still taxed as ordinary income.
When you inherit an asset, you receive a stepped-up basis. This means your cost basis becomes the asset's value on the date of the owner's death, not what the original owner paid. If your parent bought a stock for $5,000 and it was worth $50,000 when they died, your basis is $50,000. If you sell it when ready for $50,000, you have no gain and owe no tax. This rule applies to most inherited property, including real estate and investments.
Frequently Asked Questions
Do I owe capital gains tax if I sell an investment at a loss?
No. A loss means you sold for less than you paid, so there is no gain to tax. You can use the loss to offset capital gains or up to $3,000 of ordinary income in the same year. Any excess loss carries forward to future years.
What if I do not know my original purchase price for an old investment?
Contact your broker or investment firm and request historical account statements or a cost basis report. If records are truly unavailable, you may reconstruct the basis using old statements or tax returns. The IRS can impose penalties for understating basis, so document your efforts to find the original cost.
How does the capital gains tax explore if I live abroad but am a U.S. citizen?
U.S. citizens and residents owe federal capital gains tax on worldwide income, including gains on foreign investments. You report the gains on Schedule D just as you would for U.S. assets. You may be able to claim a foreign tax credit if you paid tax to another country on the same gain.
Can I reduce my capital gains tax by timing when I sell investments?
Yes, within limits. Selling in a year when your total income is lower may put your gains in a lower bracket. You can also harvest losses to offset gains. However, wash-sale rules prevent you from when ready repurchasing a substantially identical security after selling at a loss, so timing strategies require planning.
Is the 0% capital gains rate really zero, or are there hidden taxes?
The federal rate is genuinely zero if your income falls in the 0% bracket. However, you may owe Net Investment Income Tax (3.8%) if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). Some states also tax gains even when the federal rate is zero. Check both federal and state rules.