What determines your capital gains tax bill

The amount of capital gains tax you owe depends on three things: how much profit you made, how long you held the investment, and your income tax bracket. The IRS taxes long-term gains (assets held over one year) at lower rates than short-term gains (held one year or less). Your total income for the year also matters, because capital gains tax rates are tied to the same brackets used for ordinary income.

If you sold an investment for $15,000 that you bought for $10,000, your capital gain is $5,000. That $5,000 is what gets taxed, not the full sale price. The tax you owe on that $5,000 depends on whether it's long-term or short-term, and on your tax bracket that year.

Key Takeaways

  • Long-term capital gains (held over one year) are taxed at 0%, 15%, or 20% depending on your income; short-term gains are taxed as ordinary income at rates up to 37%.
  • Your capital gain is the sale price minus what you originally paid, and only that gain is taxable.
  • You can reduce your taxable gains by selling losing investments to offset winning ones, a strategy called tax-loss harvesting.
  • State and local taxes add to your federal capital gains tax bill, and the amount varies by where you live.

Long-term capital gains tax rates for 2024

Long-term gains are taxed at 0%, 15%, or 20% depending on your filing status and total taxable income for the year. These rates are lower than ordinary income tax rates because Congress taxes investment profits at preferential rates.

The 0% rate applies to single filers with taxable income up to $47,025 and married couples filing jointly up to $94,050 in 2024. The 15% rate covers the middle range, and the 20% rate applies to the highest earners. These income thresholds change each year with inflation.

Your "taxable income" includes wages, interest, dividends, and capital gains added together. If you have $60,000 in wages and a $10,000 long-term capital gain, your taxable income is $70,000, and the capital gain portion may be taxed at a different rate than your wages depending on where it falls in the bracket.

Short-term capital gains tax rates

Short-term gains are taxed as ordinary income at your regular tax bracket rate, which ranges from 10% to 37% in 2024. This is significantly higher than long-term rates. If you sell a stock you've held for six months at a profit, that gain is taxed at your full ordinary income rate, not at the preferential long-term rate.

The difference between short-term and long-term treatment can be substantial. A $5,000 short-term gain for someone in the 24% bracket costs $1,200 in federal tax. The same $5,000 long-term gain for that person costs $750 at the 15% rate — a $450 difference on a single transaction.

How to calculate what you owe

Start with the sale price of your investment and subtract what you paid for it (your cost basis). That number is your capital gain or loss. If you bought 100 shares at $50 per share ($5,000 total) and sold them for $7,500, your gain is $2,500.

Next, determine whether the gain is long-term or short-term by counting the days you held it. The holding period starts the day after you buy and ends the day you sell. If you held it more than one year, it's long-term. If one year or less, it's short-term.

Then find your tax bracket for the year based on your total income. Your capital gain will be taxed at the rate for your bracket (or the long-term rate if applicable). You report this on Schedule D (Form 1040) when you file your tax return.

Using losses to reduce your tax bill

If you sell an investment at a loss, you can use that loss to offset capital gains from other sales. If you sold one stock for a $3,000 gain and another for a $2,000 loss in the same year, your net capital gain is $1,000, and you pay tax only on that $1,000.

If your losses exceed your gains in a year, you can deduct up to $3,000 of the net loss against your ordinary income. Any loss beyond $3,000 carries forward to future years and can be used to offset future gains or income.

This strategy, called tax-loss harvesting, is commonly used by investors to manage their annual tax bill. You can sell a losing position to realize the loss, then buy a similar (but not identical) investment to maintain your market exposure while capturing the tax benefit.

State and local taxes on capital gains

Most states tax capital gains as part of ordinary income, so your state income tax rate applies on top of the federal rate. If you live in a state with a 5% income tax and owe 15% federal tax on a long-term gain, your combined rate is 20%.

A few states have no income tax at all (including Florida, Texas, and Wyoming), so residents pay only federal capital gains tax. Some states, like California, tax capital gains at their top ordinary income rate, which can exceed 13%. Washington State recently enacted a capital gains tax of 7% on long-term gains over $250,000.

Your state of residence when you sell matters. If you move during the year, the state where you lived when you sold the investment is generally the one that taxes the gain.

Special situations that change your tax

If your income is high enough, you may owe an additional 3.8% Net Investment Income Tax (NIIT) on top of regular capital gains tax. This applies to single filers with modified adjusted gross income over $200,000 and married couples over $250,000. The 3.8% is calculated on the lesser of your net investment income or the amount your income exceeds the threshold.

Inherited investments receive a "step-up in basis," meaning the cost basis is reset to the market value on the date of death. If your parent bought stock for $10,000 and it was worth $50,000 when they died, your new cost basis is $50,000. If you sell it the next day for $50,000, you owe no capital gains tax.

Certain investments like collectibles and real estate have different rules. Collectibles are taxed at a maximum 28% rate on long-term gains (higher than regular long-term rates). Real estate held for business purposes may may have access to for depreciation recapture, which is taxed at 25%.

Frequently Asked Questions

Do I owe capital gains tax if I haven't sold yet?

No. Capital gains tax is only owed when you actually sell an investment and realize the gain. If you own stock worth $20,000 that you bought for $10,000, you owe no tax until you sell it. The unrealized gain is not taxable.

What if I sold at a loss — do I get a refund?

No refund, but you can use the loss to reduce your taxable gains and up to $3,000 of ordinary income in the same year. Any unused loss carries forward to future years. You report losses on Schedule D when you file your return.

How do I know my cost basis if I've lost the original paperwork?

Your brokerage has records of your purchases and should provide a cost basis report. If you bought through a mutual fund or retirement account, the fund company has the information. The IRS also requires brokers to report cost basis on Form 1099-B for sales after 2011.

Are capital gains taxed differently in a 401(k) or IRA?

Inside a traditional 401(k) or IRA, you pay no capital gains tax when you sell investments. You pay ordinary income tax on the entire withdrawal amount when you take money out in retirement. In a Roth IRA, may have access to withdrawals are tax-free, including all gains.

Can I deduct investment losses from my paycheck?

No. Capital losses can only offset capital gains first. After that, you can deduct up to $3,000 of net loss against wages and other ordinary income. Losses beyond $3,000 must be carried forward to future years.