Your tax bill depends on three things: how long you held the asset, your total income, and your filing status

The amount of capital gains tax you pay is not a fixed percentage. The IRS taxes long-term capital gains (assets held over one year) at 0%, 15%, or 20% depending on your income bracket. Short-term gains (assets held one year or less) are taxed as ordinary income, which means your regular tax rate applies — anywhere from 10% to 37%. A $10,000 gain can cost you $0 in tax or $3,700, depending entirely on which category you fall into.

You also owe state capital gains tax in most states, which ranges from 0% to 13.3% depending on where you live. A few states — Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming — have no state income tax at all. New Hampshire and Tennessee tax only investment income, not wages. If you live in California, you pay both federal and state tax on the same gain, which can total over 30%.

The calculation starts with your adjusted gross income (AGI) — your total income minus certain deductions. The IRS then stacks your capital gains on top of that number to determine which tax bracket applies. This matters because the 15% federal rate applies only to gains that fall within a specific income range, and that range changes every year.

Key Takeaways

  • Long-term capital gains are taxed at 0%, 15%, or 20% federally, while short-term gains use your ordinary income tax rate (10% to 37%).
  • Your income bracket is determined by stacking gains on top of your other income, so a large gain can push you into a higher tax rate.
  • Most states tax capital gains as income, adding 0% to 13.3% on top of federal tax, though eight states have no income tax.
  • The exact dollar amount you owe depends on the year you sell, your filing status, and whether you have losses to offset gains.

Long-term gains: the three federal tax brackets

If you held an asset for more than one year before selling it, the gain qualifies for long-term treatment. For 2024, the 0% federal rate applies to long-term gains that fall within these income ranges: $0 to $47,025 for single filers, $0 to $94,050 for married filing jointly, and $0 to $63,000 for head of household. These numbers increase slightly each year for inflation.

The 15% rate applies to gains above those thresholds up to $518,900 (single), $583,750 (married filing jointly), or $551,350 (head of household). Anything above those limits is taxed at 20%. The brackets are wide enough that most people with moderate incomes pay 15% or 0%, but a large gain in a single year can push you into the 20% bracket.

Example: You are single with $50,000 in wages and sell stock for a $30,000 gain. Your AGI is $80,000. The first $47,025 of your gain falls in the 0% bracket (because your income is below that threshold). The remaining $2,975 of gain is taxed at 15%. Your federal tax on the gain is $446.25, not $4,500.

Short-term gains: taxed as ordinary income

If you held an asset for one year or less, any gain is taxed as ordinary income using the standard tax brackets. For 2024, the 10% bracket applies to income up to $11,600 (single) or $23,200 (married filing jointly). The rate climbs to 12%, 22%, 24%, 32%, 35%, and finally 37% at the highest income levels.

A short-term gain stacks on top of your other income, so it can push you into a higher bracket. If you earn $60,000 in wages and realize a $20,000 short-term gain, you are taxed on $80,000 of total income. The gain is not taxed at a single rate; instead, it fills up the remaining space in your current bracket and then moves into the next one.

This is why the holding period matters so much. The same $20,000 gain could cost you $2,000 to $7,400 in federal tax depending on whether it qualifies as long-term or short-term.

State capital gains tax: eight states charge nothing, others charge up to 13.3%

State tax is separate from federal tax and applies in addition to it. Most states treat capital gains as income and tax them at the same rate as wages. California has the highest rate at 13.3%. New York charges up to 10.9%. Illinois, Iowa, Kansas, and several others charge between 4% and 6.5%.

Eight states have no income tax at all: Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming. If you live in one of these states, you owe only federal tax. New Hampshire and Tennessee tax only investment income, not wages, which means capital gains are taxed but wages are not.

Some states offer preferential rates for long-term gains. A few states do not tax capital gains at all, though this is rare. Check your state's tax authority website or a tax professional to confirm the rate in your state, because state law changes and varies by income level in some cases.

How to calculate your actual bill: a worked example

Assume you are single, live in New York, earned $75,000 in wages, and sold stock held for three years for a $40,000 gain. Your AGI is $115,000.

Federal tax: The 0% bracket for long-term gains ends at $47,025. You have $47,025 of gain at 0% and $40,000 − $47,025 = negative, so all your gain falls in the 0% bracket. Federal tax: $0.

Wait — that is wrong. Let me recalculate. Your AGI is $115,000. The 0% bracket for single filers ends at $47,025. Your gain of $40,000 starts at $115,000 and goes to $155,000. None of it falls in the 0% bracket. All $40,000 is taxed at 15%. Federal tax: $40,000 × 0.15 = $6,000.

State tax: New York taxes long-term gains as income at rates up to 10.9%. At your income level, the rate is approximately 8.82%. State tax: $40,000 × 0.0882 = $3,528.

Total tax on the gain: $6,000 + $3,528 = $9,528. Your effective rate is 23.8% of the gain.

Using losses to reduce what you owe

If you sold assets at a loss in the same year, you can subtract those losses from your gains. This is called loss harvesting. If you have a $40,000 gain and a $15,000 loss, you report a net gain of $25,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 net loss against ordinary income. Any loss above $3,000 carries forward to future years, so you can use it to offset gains in later years. This means a bad year in the market can reduce your tax bill for several years to come.

Losses must be matched by type: long-term losses offset long-term gains first, then short-term gains. If you have only short-term losses and long-term gains, the losses still reduce your taxable gain, but the order matters for the IRS calculation.

What changes your tax bill year to year

The income thresholds for each tax bracket increase every year for inflation. In 2023, the 0% long-term gains bracket for single filers ended at $44,625. In 2024, it ends at $47,025. In 2025, it will be higher still. This means the same gain may be taxed at a different rate depending on when you sell.

Your filing status also matters. Married filing jointly has much wider brackets than single filers. A $50,000 gain that falls entirely in the 15% bracket for a single person might fall partly in the 0% bracket for a married couple with the same total income.

Changes to federal tax law can also affect your rate. The current long-term capital gains rates (0%, 15%, 20%) are scheduled to expire after 2025 unless Congress extends them. If they expire, long-term gains would be taxed at higher rates. State tax rates also change periodically, so your state bill may increase or decrease depending on legislative action.

Frequently Asked Questions

Do I owe capital gains tax if I sell at a loss?

No. If you sell an asset for less than you paid for it, you have a loss, not a gain. You do not owe tax on a loss. You can use the loss to offset gains from other sales in the same year, and if losses exceed gains, you can deduct up to $3,000 against other income.

What if I inherit an asset — do I owe capital gains tax when I sell it?

Inherited assets receive a step-up in basis, which means the IRS treats your cost basis as the asset's value on the date of death, not what the original owner paid. If you inherit stock worth $100,000 and sell it for $105,000 a year later, you owe tax only on the $5,000 gain, not the full $105,000.

How do I know if my gain is long-term or short-term?

Count the days from the date you bought the asset to the date you sold it. If it is more than one year, the gain is long-term. The IRS counts the purchase date as day zero and the sale date as day one, so if you bought on January 15, 2023, and sold on January 16, 2024, it qualifies as long-term.

Can I reduce my capital gains tax by donating the asset to charity instead of selling it?

Yes. If you donate an appreciated asset directly to a may have access to charity, you avoid the capital gains tax entirely and can deduct the asset's fair market value as a charitable contribution. You must own the asset long-term for this to work, and the charity must be may have access to under IRS rules.

What if I live in one state but moved to another — which state taxes my gain?

Generally, the state where you lived when you sold the asset taxes the gain. If you moved from California to Nevada in June and sold stock in July, Nevada taxes the gain because you were a resident when you sold. Some states have different rules for residents who recently moved, so check with a tax professional if you moved during the year of sale.