Capital gains tax is the federal tax on profit from selling an investment
When you sell an investment for more than you paid for it, the profit is called a capital gain. The federal government taxes this profit at rates that depend on how long you held the investment and how much total income you earned that year. As of 2024, the federal rates are 0%, 15%, or 20% — but which rate applies to you depends on your income bracket and whether you held the investment for more than one year.
The tax is separate from income tax on wages or salary. You only pay capital gains tax when you actually sell the investment and realize the profit. If you own a stock that doubled in value but you have not sold it, you owe nothing yet.
Most states also tax capital gains, though the rate and rules vary by state. Some states have no capital gains tax at all. Your total bill includes both the federal rate and your state rate, if your state has one.
Key Takeaways
- Federal capital gains tax rates for 2024 are 0%, 15%, or 20%, determined by your total income for the year and how long you held the investment.
- Long-term capital gains (held over one year) are taxed at lower rates than short-term gains (held one year or less), which are taxed as ordinary income.
- Your state may also tax capital gains at its own rate, and some states have no capital gains tax.
- You only owe the tax when you sell the investment and lock in the profit, not while you own it.
- The income brackets and tax rates change each year, so the threshold for each rate is different in 2024 than in 2023.
Long-term versus short-term capital gains rates
The length of time you held the investment determines which tax rate applies. If you owned it for more than one year before selling, it is a long-term capital gain and gets the preferential rates of 0%, 15%, or 20%. If you sold it within one year of buying it, it is a short-term capital gain and is taxed as ordinary income — the same rates as your wages, which can be as high as 37% federally.
Long-term gains are taxed at lower rates because the tax code encourages longer-term investing. Most people benefit from this: if you buy a stock and hold it for two years, your profit is taxed at 15% instead of your ordinary income rate, which is often higher.
Short-term gains are treated like regular income because the government considers them closer to business activity than investment. If you buy and sell a stock in three months, the profit is added to your wages and taxed at whatever bracket your total income puts you in.
2024 federal tax brackets for long-term capital gains
For long-term gains, the 0%, 15%, and 20% rates explore based on your filing status and total taxable income. The income thresholds are adjusted each year for inflation.
| Tax Rate | Single Filers | Married Filing Jointly | Head of Household |
|---|---|---|---|
| 0% | Up to $47,025 | Up to $94,050 | Up to $62,700 |
| 15% | $47,025 to $518,900 | $94,050 to $583,750 | $62,700 to $551,350 |
| 20% | Over $518,900 | Over $583,750 | Over $551,350 |
These thresholds include all your income — wages, interest, dividends, and capital gains combined. If you are a single filer earning $50,000 in wages and you sell an investment for a $10,000 gain, your total income is $60,000. The first $47,025 of your capital gain is taxed at 0%, and the remaining $2,975 is taxed at 15%.
State capital gains taxes vary widely
Most states do not have a separate capital gains tax. However, some states tax capital gains as part of ordinary income using their regular income tax rates, which range from about 3% to over 13% depending on the state. A few states — including California, Oregon, and Washington — have enacted or are implementing dedicated capital gains taxes that explore only to investment profits above a certain threshold.
If you live in a state with an income tax, your capital gains are usually taxed at your state's ordinary income rate unless your state has a separate capital gains tax. States with no income tax, such as Florida, Texas, and Wyoming, do not tax capital gains at all.
Your total tax bill is the federal rate plus your state rate. If you live in California and sell an investment for a $50,000 long-term gain, you would owe 15% federally (assuming you are in that bracket) plus California's rate on that same gain.
How to calculate what you owe
Start by determining your total taxable income for the year, including wages, interest, dividends, and the capital gain itself. Then find which federal bracket your total income falls into using the table above. The portion of your gain that falls within the 0% bracket is tax-free; the rest is taxed at 15% or 20%.
Next, add your state capital gains tax if your state has one. Check your state's tax authority website or your most recent tax return to find the rate. Multiply your gain by that rate and add it to your federal bill.
If you have both long-term and short-term gains in the same year, the short-term gains are taxed first as ordinary income, then the long-term gains are layered on top. This can push you into a higher bracket. A tax professional or tax software can handle this calculation for you, but understanding the basic structure helps you plan ahead.
Special situations: losses, inherited investments, and gifts
If you sell an investment 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, dollar for dollar. If your losses exceed your gains, you can deduct up to $3,000 of the excess loss against your ordinary income. Any remaining loss carries forward to future years.
If you inherit an investment, you receive a stepped-up basis. This means the cost basis resets to the market value on the date of death, not the original purchase price. If your parent bought a stock for $10,000 and it was worth $50,000 when they died, your new basis is $50,000. If you sell it when ready for $50,000, you owe no capital gains tax.
If someone gives you an investment as a gift, you inherit their original cost basis, not the current value. This means if you later sell it, you owe tax on the gain from their original purchase price, not from the date you received it.
Frequently Asked Questions
Do I owe capital gains tax if I have not sold the investment yet?
No. Capital gains tax is only owed when you sell the investment and realize the profit. If you own a stock worth twice what you paid for it but have not sold it, you owe nothing. The tax is triggered by the sale itself, not by the increase in value.
What is the difference between short-term and long-term capital gains?
Short-term gains are from investments held one year or less and are taxed as ordinary income at rates up to 37%. Long-term gains are from investments held over one year and are taxed at preferential rates of 0%, 15%, or 20%. Long-term rates are lower because the tax code encourages longer-term investing.
How do I know if my state taxes capital gains?
Check your state's tax authority website or your most recent state tax return. Most states with an income tax include capital gains in ordinary income and tax them at the regular rate. A few states have a separate capital gains tax. Some states have no income tax and do not tax capital gains at all.
Can I reduce my capital gains tax by selling at a loss?
Yes. Capital losses offset capital gains dollar for dollar in the same year. If you have $10,000 in gains and $3,000 in losses, you only owe tax on $7,000. Excess losses up to $3,000 can reduce ordinary income, and any remaining loss carries forward to future years.
Do the tax rates change every year?
The federal rates (0%, 15%, 20%) stay the same, but the income thresholds for each bracket are adjusted annually for inflation. This means the dollar amount that triggers each rate is different in 2024 than in 2023. Check the IRS website or a tax professional for the current year's brackets.