Capital gains tax is not one fixed percentage — it depends on how long you held the investment, your total income, and your filing status

When you sell an investment for more than you paid for it, the profit is called a capital gain. The IRS taxes that profit, but the rate you pay is not the same for everyone. The two main rates are 0%, 15%, and 20% for most people, but you might also pay your ordinary income tax rate if you held the investment for less than a year. Your actual rate depends on three things: whether the gain is short-term or long-term, what your income is, and whether you are single, married filing jointly, or another filing status.

The difference between short-term and long-term is straightforward: if you owned the investment for one year or less, it is short-term and taxed at your regular income tax rate (10% to 37%). If you owned it for more than one year, it is long-term and taxed at the preferential rates. This distinction alone can save you thousands of dollars on the same profit.

Key Takeaways

  • Short-term capital gains (investments held one year or less) are taxed at your ordinary income tax rate, which ranges from 10% to 37% depending on your income bracket.
  • Long-term capital gains (investments held more than one year) are taxed at 0%, 15%, or 20% depending on your income level and filing status.
  • The income thresholds that determine which rate you pay change every year and are different for single filers, married couples, and heads of household.
  • You report capital gains on Schedule D of your tax return, and the IRS matches the sale price to your cost basis to calculate the profit.

Short-Term Capital Gains: Taxed as Ordinary Income

If you sell an investment you owned for one year or less, the profit is a short-term capital gain. The IRS taxes this at your ordinary income tax rate — the same rate you pay on wages or salary. That rate ranges from 10% to 37% depending on your total income and filing status. For example, if you are single and in the 22% tax bracket, a short-term capital gain is taxed at 22%.

Short-term gains are added to your other income for the year, which can push you into a higher tax bracket. If you earned $50,000 in wages and realized a $20,000 short-term capital gain, the IRS treats you as having $70,000 in income that year. This matters because it may move you into the next tax bracket and increase the tax on both the gain and your other income. Many investors avoid selling within a year for this reason — waiting just a few months can cut your tax bill significantly.

Long-Term Capital Gains: The Lower Rates

If you sell an investment you owned for more than one year, the profit is a long-term capital gain. These are taxed at preferential rates: 0%, 15%, or 20%. Which rate you pay depends entirely on your income level and filing status. The IRS sets income thresholds each year that determine which bracket you fall into.

For 2024, here is how the brackets work for long-term gains (these amounts change yearly):

Filing Status0% Rate15% Rate20% Rate
SingleUp to $47,025$47,026 to $518,900Over $518,900
Married Filing JointlyUp to $94,050$94,051 to $583,750Over $583,750
Head of HouseholdUp to $62,975$62,976 to $551,350Over $551,350

These thresholds are based on your taxable income, not the capital gain itself. If you are single with $40,000 in wages and a $10,000 long-term capital gain, your taxable income is $50,000. Since that is below $47,025, you would pay 0% on the gain. If your wages were $50,000 and your gain was $10,000, your taxable income would be $60,000, putting part of the gain in the 15% bracket. The thresholds shift every year for inflation, so check the current year's numbers before you calculate what you owe.

How the IRS Calculates Your Capital Gain

The capital gain is the difference between what you sold the investment for and what you paid for it. The amount you paid is called your cost basis. If you bought 100 shares of stock at $30 per share and sold them at $50 per share, your cost basis is $3,000 and your sale proceeds are $5,000, so your capital gain is $2,000.

Cost basis can be more complicated if you received the investment as a gift, inherited it, or bought it over time. If you inherited stock, your cost basis is usually the price on the date of death, not what the original owner paid. If you bought shares in multiple transactions, you can choose which shares you are selling — a method called specific identification — to control your gain or loss. Keep all purchase confirmations and statements because the IRS will ask for proof of your cost basis if you are audited. Your brokerage usually tracks this for you, but it is your responsibility to report it correctly.

State and Local Taxes on Capital Gains

Federal capital gains tax is only part of what you owe. Most states also tax capital gains, and some cities do as well. State rates vary widely. Some states, like Florida and Texas, do not tax capital gains at all. Others, like California and New York, tax them as ordinary income, which can be 10% or higher. A few states, like Iowa and Vermont, have separate capital gains tax rates.

You report state and local capital gains taxes on your state return, not your federal return. The federal return goes to the IRS; your state return goes to your state tax agency. If you moved during the year you sold the investment, you may owe tax to both states, though most states allow a credit for taxes paid to another state to prevent double taxation. Check your state's tax website or ask a tax preparer what your state charges.

Net Investment Income Tax: An Additional 3.8%

High-income earners may owe an additional Net Investment Income Tax of 3.8% on top of the capital gains tax. This applies if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). The 3.8% is calculated on the lesser of your net investment income or the amount your income exceeds the threshold.

For example, if you are single with $220,000 in income and $10,000 in long-term capital gains, you would owe the 3.8% tax on $10,000 because that is less than the $20,000 amount your income exceeds the threshold. This tax goes to Medicare and is reported on Form 8960. It applies to capital gains, dividends, rental income, and other investment income, but not to wages or self-employment income. If your income is below the threshold, you do not owe this tax at all.

How to Report Capital Gains on Your Tax Return

You report all capital gains and losses on Schedule D of Form 1040. List each sale separately: the date you bought it, the date you sold it, the sale price, your cost basis, and the gain or loss. The form automatically calculates whether each gain is short-term or long-term based on the holding period.

If you have losses, you can use them to offset gains. If your losses exceed your gains, you can deduct up to $3,000 of the net loss against your ordinary income in that year. Any remaining loss carries forward to future years. Many people use tax-loss harvesting — selling investments at a loss to offset gains elsewhere — to reduce their capital gains tax bill. Your brokerage or tax software can help you track which investments to sell to minimize your tax.

Frequently Asked Questions

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

No. A loss means you sold for less than you paid, so there is no gain to tax. You can use the loss to offset capital gains from other sales that year. If losses exceed gains, you can deduct up to $3,000 against your wages or other income, and carry the rest forward to future years.

What if I inherited stock or real estate — do I owe capital gains tax when I sell it?

Inherited investments receive a "step-up" in cost basis, meaning your cost basis is the fair market value on the date of death, not what the original owner paid. If you sell shortly after inheriting, you usually owe little or no capital gains tax. This applies to most inherited property, though there are exceptions for certain retirement accounts.

Can I avoid capital gains tax by holding an investment longer?

Holding longer than one year changes the tax rate from your ordinary income rate to the preferential long-term rate (0%, 15%, or 20%), which is usually lower. However, you still owe the tax. You cannot avoid it by holding indefinitely unless you donate the investment to charity or it passes to your heirs, who receive a step-up in basis.

How do I know if I am in the 0%, 15%, or 20% bracket for long-term gains?

Add up all your income for the year — wages, interest, dividends, and capital gains — to find your taxable income. Compare that to the income thresholds for your filing status. The thresholds change every year, so check the current year's IRS tables or your tax software. Your tax preparer can also calculate which bracket you fall into.

Do I have to pay capital gains tax in the year I sell, or can I defer it?

You owe the tax in the year you sell, not when you receive the money. If you sell in December but do not receive payment until January, the gain is still reported on the December tax year return. The only way to defer capital gains tax is through specific strategies like like-kind exchanges (for real estate) or installment sales, which have strict requirements.