Skip to main content

HomeAll guides

How the Federal Capital Gains Tax Works

The federal capital gains tax is a tax on profit you make when you sell an investment

When you sell a stock, bond, real estate, or other investment for more than you paid for it, the difference is a capital gain. The federal government taxes that profit at a rate that depends on how long you held the investment and how much total income you earned that year. The tax is collected by the IRS when you file your annual tax return, not when you sell.

Capital gains are taxed differently from wages or salary. You do not pay the same tax rate on investment profits that you pay on a paycheck. This difference is built into the tax code itself — it is not a loophole or a special account type. Understanding which rate applies to your situation matters because the difference between a 15% rate and a 37% rate on a large gain can mean thousands of dollars.

Key Takeaways

  • Long-term capital gains (investments held over one year) are taxed at 0%, 15%, or 20% depending on your total income for the year, not on the size of the gain itself.
  • Short-term capital gains (investments held one year or less) are taxed as ordinary income at your regular tax bracket rate, which can be as high as 37%.
  • The IRS requires you to report all capital gains on your tax return, even small ones, and you owe tax on gains even if you do not receive a 1099 form.
  • Your total income for the year determines which tax bracket you fall into, and capital gains can push you into a higher bracket and increase your overall tax bill.
  • Losses on investments can offset gains dollar-for-dollar, and unused losses can carry forward to reduce gains in future years.

Long-term versus short-term capital gains rates

The IRS divides capital gains into two categories based on how long you owned the investment. If you held it for more than one year before selling, it is a long-term capital gain. If you held it for one year or less, it is a short-term capital gain. This distinction is the single biggest factor in how much tax you owe.

Short-term capital gains are taxed as ordinary income. That means they are added to your wages, salary, and other income, and taxed at your regular income tax bracket rate. In 2024, those rates range from 10% to 37% depending on your total income and filing status. If you are in the 24% tax bracket and sell a stock you owned for six months at a $5,000 gain, you owe $1,200 in federal tax on that gain.

Long-term capital gains have their own tax brackets, separate from ordinary income brackets. The federal rates are 0%, 15%, or 20%. Which rate you pay depends on your total income for the year, not on the size of the gain. A single filer with income under roughly $47,000 in 2024 pays 0% on long-term gains. Income from roughly $47,000 to $518,000 is taxed at 15%. Income above that is taxed at 20%. These income thresholds change each year and vary by filing status.

How your total income determines your tax rate

Your tax bracket is based on your taxable income — all income sources combined, minus deductions. When you sell an investment at a gain, that gain is added to your taxable income for the year. This can push you into a higher tax bracket, even if the gain itself would normally be taxed at a lower rate.

Suppose you are a single filer with $40,000 in wages and you sell a stock at a $10,000 long-term gain. Your total taxable income is now $50,000. The first $7,000 of your gain falls in the 0% bracket (income up to $47,000). The remaining $3,000 falls in the 15% bracket. You owe $450 in federal tax on the gain, not $0. This is called bracket creep, and it happens to many investors.

The same principle applies to short-term gains. If you earn $100,000 in salary and realize a $20,000 short-term gain, your taxable income is $120,000. You are taxed on that $20,000 at whatever bracket $120,000 puts you in, which is higher than the bracket for $100,000 alone.

Reporting capital gains to the IRS

You report capital gains on your federal tax return using Schedule D (Form 1040), which is part of the standard tax filing package. You list each sale separately: the date you bought it, the date you sold it, the price you paid, the price you sold it for, and the gain or loss. The IRS uses this to verify that you reported the transaction correctly.

If you sell stocks or mutual funds through a brokerage, the broker sends you a Form 1099-B in January showing the sales and proceeds. This form also goes to the IRS. If you sell real estate, you may receive a Form 1099-S from the title company or real estate agent, though not all sales generate one. You are required to report all capital gains on your tax return, whether or not you receive a 1099 form.

Many people assume that if they do not receive a form, they do not have to report the gain. This is incorrect. The IRS has records of most investment sales through brokers, and unreported gains are a common audit trigger. If you sell something privately — a car, collectible, or piece of real estate — and do not receive a form, you still owe tax on any gain and must report it yourself.

Using capital losses to reduce your tax bill

If you sell an investment at a loss, you can use that loss to offset capital gains. If you have $8,000 in long-term gains and $3,000 in long-term losses in the same year, your net gain is $5,000, and you owe tax only on $5,000. Losses and gains in the same category (long-term or short-term) offset each other first. If you have leftover losses, they can offset gains in the other category.

If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against your ordinary income (wages, salary, and so on). Any losses beyond that $3,000 carry forward to the next year, where they can offset future gains or reduce ordinary income again. This carryforward continues indefinitely until the losses are used up.

This is why some investors deliberately sell losing positions late in the year — a practice called tax-loss harvesting. By realizing losses, they reduce their capital gains tax bill or their ordinary income tax bill. The loss must be real (the investment actually sold at a lower price), and there are rules about buying the same or a substantially identical investment within 30 days before or after the sale.

State and local taxes on capital gains

The federal capital gains tax is separate from state and local taxes. Some states tax capital gains at the same rate as ordinary income. Others have a separate capital gains tax or tax capital gains at a lower rate. A few states do not tax capital gains at all. Your state tax bill depends on where you live and where the investment was located.

If you live in a state with a high income tax rate and realize a large gain, your combined federal and state tax bill can be substantial. For example, California taxes long-term capital gains as ordinary income at rates up to 13.3%, on top of the federal rate. New York adds up to 6.85%. Other states add nothing. This is one reason some investors consider the tax implications of a sale before executing it, especially for large gains.

Special situations: inherited investments and wash sales

If you inherit an investment, you receive a stepped-up basis. This means your cost basis is reset to the market value on the date of the person's death, not the price they originally paid. If the investment was worth $100,000 when purchased and $150,000 when inherited, your basis is $150,000. If you sell it when ready for $150,000, you owe no capital gains tax. This is a major tax benefit of inherited assets and applies to most inherited property.

A wash sale occurs when you sell an investment at a loss and buy the same or a substantially identical investment within 30 days before or after the sale. The IRS disallows the loss deduction and adds the loss amount to your cost basis in the new purchase. This rule prevents investors from claiming a loss purely for tax purposes while maintaining the same investment position. The 30-day window is strict: 30 days before the sale through 30 days after.

Frequently Asked Questions

Do I owe capital gains tax if I do not sell the investment?

No. You owe capital gains tax only when you sell and realize the gain. If you own a stock that has doubled in value but you still hold it, you owe no federal tax on that unrealized gain. You owe tax only when you sell it or transfer it to someone else (with rare exceptions for very large estates).

What if I sold an investment years ago and did not report it?

You should report it now by filing an amended return for that year using Form 1040-X. The IRS has a statute of limitations, typically three years from the original filing date, but it can be longer if you underreported income by 25% or more. Reporting voluntarily is better than waiting for an audit notice, and the IRS may reduce penalties if you file an amended return.

Can I deduct investment losses against my salary or wages?

Only up to $3,000 per year. If you have $10,000 in capital losses and no capital gains, you can deduct $3,000 against your ordinary income. The remaining $7,000 carries forward to next year. This limit applies every year, so it can take many years to use up large losses.

Are dividends taxed the same way as capital gains?

may have access to dividends are taxed at the same rates as long-term capital gains (0%, 15%, or 20%), but they are reported separately on your tax return. Non-may have access to dividends are taxed as ordinary income. Most dividends from U.S. stocks are may have access to if you held the stock for more than 60 days around the dividend date.

What happens if I sell a home I live in?

If you are a single filer, you can exclude up to $250,000 of gain from the sale of your primary residence from federal tax. Married couples filing jointly can exclude up to $500,000. You must have owned and lived in the home for at least two of the last five years. Gains above the exclusion amount are taxed as long-term capital gains.

This guide is for general information only and is not medical, financial, legal, or other professional advice. For decisions specific to your situation, consult a qualified professional. See our Editorial Policy.