The tax rate depends on how long you held the asset and your total income
Capital gains tax is not one flat rate. The federal government taxes long-term gains (assets held over one year) at 0%, 15%, or 20%, depending on your income bracket. Short-term gains (held one year or less) are taxed as ordinary income, which means your regular tax rate applies. Your state may add its own tax on top of the federal amount.
The income brackets that determine your rate change every year. For 2024, a single filer in the 15% long-term bracket earns between roughly $47,000 and $518,000 in taxable income. A married couple filing jointly falls into that same bracket between roughly $94,000 and $583,000. These numbers shift annually for inflation.
You also need to know your total taxable income for the year, not just the gain itself. If you sell a stock for a $10,000 profit but earn $200,000 in salary, your taxable income is $210,000 (before deductions), and that determines which bracket your capital gain falls into.
Key Takeaways
- Long-term capital gains are taxed at 0%, 15%, or 20% federally; short-term gains use your ordinary income tax rate, which can be as high as 37%.
- Your tax rate depends on your total taxable income for the year, not just the size of the gain.
- Most states add their own capital gains tax or income tax on top of federal tax, ranging from 0% to over 13%.
- You calculate the gain by subtracting what you paid (your basis) from what you received when you sold, including commissions and fees.
- Losses can offset gains in the same year, and unused losses can carry forward to reduce future years' taxes.
Long-term versus short-term: the one-year line
The holding period is the single biggest factor in your tax bill. If you buy a stock on January 15 and sell it on January 14 the next year, it is a short-term gain. If you sell on January 16, it is long-term. That one-day difference can cut your tax rate in half or more.
Short-term gains are taxed as ordinary income. If you are in the 32% federal income tax bracket, your short-term capital gain is taxed at 32%. If you are in the 12% bracket, it is 12%. This applies to stocks, bonds, real estate, cryptocurrency, and any other asset held under one year.
Long-term gains get preferential rates. The 0% rate applies to lower-income filers (single filers under $47,000 in 2024). The 15% rate covers most middle-income filers. The 20% rate applies to high-income filers. These rates have been in place since 2013 and do not change with your ordinary income tax bracket.
How your income bracket determines your rate
The IRS stacks your capital gains on top of your other income. If you earn $60,000 in salary and have a $20,000 long-term capital gain, your taxable income is $80,000 (before standard deduction or other adjustments). That $80,000 determines which tax bracket applies to the gain.
For 2024, single filers pay 0% on long-term gains if their taxable income is under $47,025. They pay 15% if it is between $47,025 and $518,900. They pay 20% if it exceeds $518,900. For married couples filing jointly, the 0% bracket goes up to $94,050, the 15% bracket extends to $583,750, and anything above that is 20%.
This matters because you might fall into different brackets depending on the year. If you have a large gain one year, it might push you into the 20% bracket. If you spread the sale across two years, you might stay in the 15% bracket both years and pay less total tax.
State and local taxes on capital gains
Most states tax capital gains as part of ordinary income tax. If your state income tax rate is 5%, you pay 5% on capital gains too. Nine states have no income tax at all (Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, Wyoming, and New Hampshire for non-dividend income). California taxes long-term gains at the same rate as ordinary income, up to 13.3%.
A few states have separate capital gains taxes. Washington and Illinois tax long-term gains at a flat rate (7% in Washington, 4.75% in Illinois) regardless of your income bracket. New York added a 3.876% surcharge on gains over $1 million for high-income filers. These state taxes stack on top of federal tax.
If you live in a high-tax state and sell a large asset, your combined federal and state rate can exceed 30%. A $100,000 long-term gain in California at the 20% federal rate plus 13.3% state rate costs you $33,300 in tax.
Calculating your actual gain or loss
Your capital gain is not the sale price. It is the sale price minus what you paid, minus any costs to sell. If you buy a stock for $5,000, pay $50 in commission to buy it, and sell it for $8,000 with a $50 selling commission, your gain is $2,900 (8,000 − 5,000 − 50 − 50).
Your purchase price is called your basis. For stocks and bonds, it is what you paid plus commissions. For inherited assets, the basis is usually the value on the date of death, not what the original owner paid. For real estate, basis includes the purchase price plus improvements (a new roof, addition, or major repair), but not maintenance (painting, repairs).
If you receive a dividend and reinvest it, each reinvestment increases your basis. If you own mutual funds and take distributions, those distributions increase your basis if they are return of capital. Tracking basis carefully matters because a mistake can cost you thousands in unnecessary tax.
Using losses to reduce your tax bill
If you sell an asset for less than you paid, you have a capital loss. You can use losses to offset gains in the same year. If you have $15,000 in gains and $8,000 in losses, you report a net gain of $7,000 and pay tax only on that amount.
If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against ordinary income (like salary). If you have $8,000 in losses and $2,000 in gains, you can deduct $3,000 against your salary, and the remaining $3,000 carries forward to next year.
Losses carry forward indefinitely. If you have $10,000 in unused losses this year, you can use $3,000 next year, $3,000 the year after, and so on until the losses are gone. This is why some investors deliberately sell losing positions in December to offset gains from winning positions.
Special situations: real estate, inherited assets, and gifts
If you sell a primary residence, you may exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly. You must have owned and lived in the home for at least two of the last five years. This exclusion applies once every two years.
Inherited assets receive a step-up in basis. If your parent bought a stock for $10,000 and it is worth $50,000 when they die, your basis is $50,000, not $10,000. If you sell it immediately for $50,000, you have no gain. This applies to most inherited assets, though the rules are complex for certain retirement accounts.
Gifts do not trigger capital gains tax for the giver. If you give someone a stock worth $50,000 that you bought for $10,000, you pay no tax. The recipient receives your original basis of $10,000, so if they sell for $50,000, they owe tax on the $40,000 gain. The recipient's basis is the same as yours was.
Frequently Asked Questions
Do I owe capital gains tax if I sell at a loss?
No federal tax is owed on a loss itself. You can use the loss to offset gains from other sales in the same year. If losses exceed gains, you can deduct up to $3,000 against ordinary income, with unused losses carrying forward to future years.
What if I hold an asset for exactly one year?
The holding period is measured from the purchase date to the sale date. If you buy on January 15 and sell on January 15 the next year, it is long-term. If you sell on January 14, it is short-term. The IRS counts the purchase date as day zero.
Do I have to report small gains?
Yes. The IRS requires you to report all capital gains, regardless of size. Even a $100 gain must be reported on your tax return. Brokers report sales to the IRS on Form 1099-B, so underreporting is easily detected.
Can I reduce my capital gains tax by donating to charity?
Donating appreciated assets to charity is often more tax-efficient than selling. You avoid the capital gains tax entirely and receive a charitable deduction for the full fair market value. Consult a tax professional about your specific situation.
What happens if I sell cryptocurrency?
Cryptocurrency is treated as property for tax purposes. Gains and losses are capital gains and losses. If you hold for over one year, you get long-term rates. If you trade frequently, each trade is a short-term gain or loss taxed at ordinary income rates.