Capital gains tax is the tax on profit when you sell an investment for more than you paid for it
The federal rate depends on how long you held the investment. If you owned it for one year or less, the gain is taxed as short-term capital gains at your ordinary income tax rate — the same rate that applies to wages or salary. If you owned it for more than one year, it is taxed as long-term capital gains at a lower rate: 0%, 15%, or 20%, depending on your total income for the year.
Most people pay 15% on long-term gains. The 0% rate applies to lower-income filers, and the 20% rate applies to higher-income filers. Your state may also tax capital gains, and the rate varies by state — some states do not tax them at all, while others treat them as ordinary income.
The tax is owed only when you sell. Holding an investment that has grown in value does not trigger a tax bill. You also do not owe tax on gains in retirement accounts like 401(k)s or IRAs, because those accounts defer or eliminate tax on gains entirely.
Key Takeaways
- Long-term capital gains (held over one year) are taxed at 0%, 15%, or 20% federally, while short-term gains are taxed at your ordinary income rate, which is higher.
- Your long-term rate depends on your total taxable income for the year, not the size of the gain itself.
- State capital gains tax rates vary widely — some states do not tax capital gains, while others tax them as ordinary income.
- You can reduce capital gains tax by timing the sale across tax years, harvesting losses to offset gains, or holding investments longer to may have access to for the lower long-term rate.
How long-term and short-term rates differ
The difference between the two rates is substantial. If you are in the 24% federal income tax bracket and sell a stock you held for six months, your gain is taxed at 24%. If you sell the same stock after holding it for 13 months, the same gain is taxed at 15% (assuming your income level qualifies you for that bracket). On a $10,000 gain, that is a difference of $900 in federal tax.
The IRS counts holding period from the day after you buy to the day you sell. If you buy on January 15 and sell on January 15 of the next year, that is exactly one year and qualifies for long-term treatment. Selling one day earlier makes it short-term.
Short-term gains are added to your other income for the year and taxed at whatever bracket that total income puts you in. This means a short-term gain can push you into a higher tax bracket entirely. Long-term gains are calculated separately and do not affect the brackets applied to your wages or other income.
The three federal long-term capital gains brackets
For 2024, the 0% long-term rate applies to single filers with taxable income up to $47,025 and married filers filing jointly up to $94,050. The 15% rate applies to income above those thresholds up to $518,900 (single) or $583,750 (married filing jointly). The 20% rate applies to income above those amounts.
These thresholds change each year for inflation. The IRS publishes updated brackets in late fall for the following year. Your "taxable income" for this calculation includes wages, interest, dividends, and other income, minus deductions — it is the number on line 15 of your Form 1040.
If you have a large gain in a single year, it can push you from the 15% bracket into the 20% bracket. This is one reason to consider spreading a sale across two tax years if you have control over the timing.
State capital gains taxes vary widely
Nine states have no capital gains tax at all: Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, Wyoming, and New Hampshire (though New Hampshire taxes only dividends and interest, not gains on stock sales). Most other states tax capital gains as ordinary income, meaning your state rate depends on your state income tax bracket.
A few states have a separate capital gains tax. California taxes long-term gains at the same rate as short-term gains, with rates ranging from 1% to 13.3%. Washington has a 7% tax on long-term gains over $250,000. New York taxes long-term gains at ordinary income rates but offers a deduction for gains under certain thresholds.
If you live in a high-tax state and are considering a move, the capital gains tax difference can be material over time. If you are selling a large investment, it is worth checking your state's rules before you execute the sale.
How to reduce capital gains tax through timing and strategy
Tax-loss harvesting is selling an investment at a loss to offset gains elsewhere. If you sell Stock A for a $5,000 gain and Stock B for a $3,000 loss in the same year, you report a net gain of $2,000 and pay tax on that amount instead of $5,000. You can harvest losses in December to offset gains realized earlier in the year, or carry unused losses forward to future years.
Bunching gains and losses across years can lower your rate. If you have a large gain coming in 2025, you might realize losses in 2024 to offset it, or defer the gain to 2026 if you have flexibility. This is especially useful if you are near a bracket threshold — pushing yourself into the 20% bracket costs more than staying in the 15% bracket.
Holding investments longer is the simplest strategy. If you can wait one year and one day before selling, you move from short-term (your ordinary rate, often 22% to 37%) to long-term (15% or less for most people). On a large gain, this alone can save thousands in tax.
Donating appreciated securities to charity avoids capital gains tax entirely. You get a deduction for the full fair-market value of the security, and the charity receives it tax-free. This works best for highly appreciated stocks or funds you have held for years.
Capital gains in retirement accounts do not trigger tax
Gains inside a 401(k), traditional IRA, or Roth IRA are not taxed when you sell the investment. You can buy and sell as much as you want inside these accounts without owing capital gains tax. In a traditional 401(k) or IRA, you pay tax later when you withdraw the money in retirement. In a Roth IRA, you pay no tax on withdrawals at all, including the gains.
This is one reason to max out retirement account contributions before investing in taxable accounts. A $7,000 gain in a Roth IRA costs you nothing in tax. The same gain in a taxable brokerage account costs you $1,050 in federal tax (at the 15% long-term rate) plus state tax.
If you have a large gain in a taxable account and want to move it into a retirement account, you cannot transfer the security itself — you would have to sell it (triggering tax) and then contribute the proceeds. This is why it is important to use retirement accounts for investments you expect to grow significantly.
What happens if you inherit an investment
When you inherit an investment, you receive a stepped-up basis. This means the cost basis is reset to the fair-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 basis is $50,000. If you sell it the next day for $50,000, you owe no capital gains tax.
This stepped-up basis applies to most inherited assets — stocks, bonds, real estate, and mutual funds. It does not explore to inherited retirement accounts, which retain their original tax treatment. Inherited IRAs, for example, are subject to required distributions and ordinary income tax on those distributions.
The stepped-up basis rule may change in future years depending on legislation, so if you are planning an estate, it is worth discussing with a tax professional or estate attorney.
Frequently Asked Questions
Do I owe capital gains tax if I sell at a loss?
No. If you sell an investment for less than you paid, you have a capital loss, not a gain. You can use the loss to offset capital gains from other sales that year. If your losses exceed your gains, you can deduct up to $3,000 of the net loss against ordinary income, and carry unused losses forward to future years.
What if I buy and sell the same stock multiple times in one year?
Each sale is treated separately. If you buy Stock A in March and sell it in July, that is a short-term gain. If you buy Stock A again in August and sell it in December, that is another short-term gain. The holding period resets with each purchase. The IRS uses the specific identification method by default, meaning you can choose which shares you are selling if you bought at different times.
Does the capital gains rate change every year?
The federal rates (0%, 15%, 20%) do not change, but the income thresholds that determine which rate applies adjust annually for inflation. The IRS publishes new brackets in October or November for the following year. State rates and thresholds also vary by state and may change year to year.
Can I avoid capital gains tax by not selling?
Yes, but only temporarily. As long as you hold the investment, no tax is owed. When you eventually sell or pass the investment to heirs, tax becomes due — unless you die and the investment receives a stepped-up basis. This is why some people hold appreciated assets for life and pass them to heirs instead of selling.
What is the difference between capital gains and dividends?
Capital gains are profit from selling an investment for more than you paid. Dividends are payments a company makes to shareholders from its earnings. may have access to dividends (from U.S. stocks held for at least 60 days) are taxed at the same long-term capital gains rates. Unqualified dividends are taxed as ordinary income. Both are reported on your tax return, but they are separate items.