The rate depends on how long you held the stock and your total income
Capital gains tax on stocks is not a single number. The federal rate ranges from 0% to 20%, depending on two things: whether you held the stock for more than a year (long-term) or less than a year (short-term), and your total taxable income for that year. Long-term gains get preferential rates. Short-term gains are taxed as ordinary income, which means they use the same brackets as wages — up to 37% at the highest bracket.
Most people who sell stocks pay long-term rates because holding for over a year is common. A person in the 24% ordinary income bracket who sells stock held for two years might pay 15% on the gain instead. That same person selling stock held for six months would pay 24% on the gain. The difference is substantial: on a $10,000 gain, that is $1,500 versus $2,400 in federal tax alone.
Your state may also tax capital gains. California taxes them as ordinary income with no preferential rate. New York has a 4% to 10.9% state tax on gains. Some states — Florida, Texas, Washington — have no income tax at all. The state tax stacks on top of the federal rate, so your total can exceed 20% even on long-term gains.
Key Takeaways
- Long-term capital gains (held over one year) are taxed at 0%, 15%, or 20% federally, depending on your income level; short-term gains use your ordinary income tax bracket, which goes up to 37%.
- The 0% rate applies only to lower-income filers — for 2024, that is roughly $47,000 for single filers and $94,000 for married filing jointly, though these thresholds change yearly.
- Your state may add its own capital gains tax on top of the federal rate, ranging from 0% to over 13% depending on where you live.
- The tax is calculated on the gain (sale price minus what you paid), not the full sale price, so you only pay tax on profit.
How the three federal long-term rates work
The IRS uses your taxable income to sort you into one of three long-term capital gains brackets. This is not your gross income or your salary — it is what remains after standard deductions and adjustments. For 2024, the brackets are roughly:
0% rate: Single filers with taxable income up to about $47,000; married filing jointly up to about $94,000. This rate exists because ordinary income already fills these brackets. Your capital gains sit in the empty space at no additional tax. Once your ordinary income plus gains exceed the threshold, gains above that point move to the next bracket.
15% rate: Single filers from roughly $47,000 to $518,000; married filing jointly from roughly $94,000 to $583,000. This is where most stock sellers land. The 15% rate is substantially lower than the ordinary income rate at the same income level.
20% rate: Single filers over roughly $518,000; married filing jointly over roughly $583,000. This applies only to high-income households. These thresholds are indexed to inflation and change each year, so check the IRS website or your tax software for the current year's numbers.
Short-term gains are taxed like wages
If you sell a stock you have owned for less than one year, the gain is short-term capital gain. It is taxed at your ordinary income tax rate — the same rate applied to your salary, bonus, or self-employment income. For 2024, those rates range from 10% to 37% depending on your total income.
This creates a sharp cliff. A person in the 22% ordinary income bracket who sells a stock held for 11 months pays 22% on the gain. The same person selling an identical stock held for 13 months pays 15%. The difference is not a penalty; it is the structure of the tax code. The incentive is deliberate: the tax system encourages longer holding periods.
Short-term gains are also added to your ordinary income, which can push you into a higher bracket. If you earn $80,000 in salary and realize $30,000 in short-term gains, your taxable income is $110,000. You may jump from the 22% bracket into the 24% bracket, and the gains are taxed at that higher rate.
State taxes add to your federal bill
Nine states have no income tax: Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, Wyoming, and New Hampshire (which taxes only dividends and interest, not capital gains). If you live in one of these states, you pay only federal capital gains tax.
Most other states tax capital gains as ordinary income, meaning they explore their state income tax rate to the gain. California's top rate is 13.3%. New York's is 10.9%. Illinois is 4.95%. These rates stack directly on top of the federal rate. A California resident in the 20% federal bracket pays 20% + 13.3% = 33.3% total on long-term gains.
A few states have created separate capital gains taxes. Washington State imposes a 7% tax on long-term gains over $250,000 (as of 2024), separate from its lack of income tax. Vermont taxes long-term gains at a lower rate than ordinary income. Check your state's tax authority website for the current rules in your state.
How the gain itself is calculated
You do not pay tax on the full sale price. You pay tax only on the gain — the difference between what you paid and what you sold it for. If you bought 100 shares at $50 per share ($5,000 total) and sold them at $75 per share ($7,500 total), your gain is $2,500. You pay tax on $2,500, not $7,500.
Your cost basis is what you paid, including commissions and fees if you paid them. If you bought the shares in multiple batches at different prices, you can choose which shares to sell — this is called lot identification. Selling your highest-cost shares first minimizes the gain and the tax. Your broker can help you specify which lot to sell when you place the order.
If you inherited stock, your cost basis "steps up" to the market value on the date of death. If your parent bought at $20 and died when it was worth $100, your basis is $100. If you sell when ready at $100, there is no gain and no tax. This step-up is a major tax benefit of inherited assets and applies to most inherited property, not just stocks.
Losses can offset gains and reduce your tax bill
If you sell a stock at a loss, you can use that loss to reduce your capital gains. If you have $10,000 in long-term gains and $3,000 in long-term losses, you report a net gain of $7,000 and pay tax only on that amount. Losses and gains in the same category (both long-term or both short-term) offset each other first.
If losses exceed gains, you can deduct up to $3,000 of the excess loss against ordinary income in that year. Any remaining loss carries forward to future years. This is called tax-loss harvesting — deliberately selling losing positions to offset gains elsewhere. It is a legitimate strategy and costs nothing to do; your broker can help you identify candidates.
Wash-sale rules prevent you from when ready buying back the same or substantially identical stock to recapture the loss. If you sell at a loss and buy the same stock again within 30 days before or after the sale, the loss is disallowed and added to your new cost basis instead. The rule exists to prevent artificial loss-taking, but it means you must wait 31 days or switch to a similar but different security.
Mutual funds and ETFs follow the same rules
Capital gains tax applies to mutual funds and exchange-traded funds (ETFs) the same way it applies to individual stocks. When you sell shares of a fund for more than you paid, the gain is taxable. The holding period is measured from when you bought the shares, not when the fund itself was created.
Mutual funds also distribute capital gains to shareholders when the fund manager sells securities inside the fund. These distributions are taxable to you even if you did not sell your shares. The fund sends you a 1099-DIV form showing the amount. Long-term distributions are taxed at long-term rates; short-term distributions at ordinary rates. ETFs distribute gains less frequently than mutual funds, which is one reason they are often more tax-efficient.
If you reinvest distributions back into the fund, you still owe tax on them. The reinvestment does not defer the tax. Your cost basis increases by the amount of the reinvested distribution, which reduces the gain when you eventually sell.
Frequently Asked Questions
Do I owe capital gains tax if I sell at a loss?
No. A loss produces no tax. You can use losses to offset gains from other sales, and if losses exceed gains, you can deduct up to $3,000 against ordinary income that year. Any unused loss carries forward to future years.
What if I sell stock in a Roth IRA or 401(k)?
No capital gains tax applies inside retirement accounts. You can buy and sell as much as you want within the account without triggering tax. Tax is deferred (in a traditional account) or never owed (in a Roth) until you withdraw money from the account itself.
How do I report capital gains on my tax return?
Your broker sends you a Form 1099-B showing sales and proceeds. You report long-term and short-term gains separately on Schedule D (Form 1040), then transfer the totals to Form 1040. Tax software usually walks you through this step-by-step using the 1099-B data.
Can I avoid capital gains tax by holding stock forever?
Yes, as long as you do not sell. Tax is owed only when you realize the gain by selling. If you hold until death, your heirs receive a stepped-up basis and owe no tax on the gain that occurred during your lifetime. This is a major reason some wealthy investors hold appreciated assets indefinitely.
What is the difference between may have access to and non-may have access to dividends?
may have access to dividends are taxed at capital gains rates (0%, 15%, or 20%); non-may have access to dividends are taxed as ordinary income. Most dividends from U.S. stocks held over 60 days are may have access to. Dividends are separate from capital gains, but both appear on your tax return and use similar rate structures.