Capital gains tax is a tax on the profit you make when you sell an investment or asset for more than you paid for it

When you buy a stock, bond, real estate, or other asset and later sell it at a higher price, the difference between what you paid and what you received is your capital gain. The federal government taxes this profit. The tax rate depends on how long you held the asset before selling it — assets held longer than one year get lower rates than those you sell quickly. State taxes on capital gains vary widely: some states have no capital gains tax at all, while others tax them as regular income.

The tax applies only to the gain itself, not the full sale price. If you bought stock for $5,000 and sold it for $7,000, you owe tax only on the $2,000 gain. You report capital gains on your federal tax return using IRS Form 8949 and Schedule D, which feed into your main tax form (Form 1040).

Key Takeaways

  • Long-term capital gains (assets held over one year) are taxed at 0%, 15%, or 20% depending on your income level, while short-term gains are taxed as ordinary income at rates up to 37%.
  • You only pay tax on the profit, not the total sale price — the gain is the selling price minus what you originally paid plus any improvements.
  • State capital gains taxes range from zero in most states to as high as 13.3% in California, and some states tax capital gains as regular income.
  • You must report all capital gains on your federal return using Form 8949 and Schedule D, even if you did not receive a 1099 form.
  • Losses from investments can offset gains dollar-for-dollar, and unused losses can carry forward to future years.

Long-term versus short-term capital gains rates

The federal tax rate on your capital gain depends entirely on how long you owned the asset. If you held it for more than one year before selling, it qualifies as a long-term capital gain. Long-term gains are taxed at preferential rates: 0%, 15%, or 20%, determined by your total taxable income for the year. The exact threshold varies by filing status — a single filer in 2024 pays 0% on long-term gains up to $47,025 of taxable income, 15% from $47,026 to $518,900, and 20% above that.

If you held the asset for one year or less, it is a short-term capital gain, taxed as ordinary income. This means it uses the same tax brackets as your wages or salary — rates that run from 10% to 37% depending on your total income. Short-term gains are added to your other income and taxed at whatever bracket that combined total falls into. Because of this, short-term gains often result in a much higher tax bill than long-term gains on the same dollar amount.

The holding period clock starts the day after you buy the asset and ends the day you sell it. If you buy on January 15 and sell on January 15 of the next year, that is exactly one year, and the gain qualifies as long-term.

How to calculate your capital gain or loss

Your capital gain is the sale price minus your cost basis, which is what you originally paid for the asset plus any costs directly tied to buying it (such as broker fees or commissions). If you made improvements to real estate, those costs add to your basis as well. If you inherited an asset, your cost basis is typically its value on the date of death, not what the original owner paid — this is called a stepped-up basis.

Example: You buy 100 shares of stock at $50 per share ($5,000 total) plus a $50 broker fee. Your cost basis is $5,050. You sell all 100 shares at $75 per share ($7,500). Your capital gain is $7,500 minus $5,050, which equals $2,450. If you held the shares for more than one year, this $2,450 is taxed at the long-term rate.

If you sell at a loss — the sale price is less than your cost basis — you have a capital loss. You can use capital losses to offset capital gains dollar-for-dollar. If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against other income (like wages). Any remaining loss carries forward to future years, where you can use it again.

State capital gains taxes vary widely

Most states do not tax capital gains separately. However, some states tax capital gains as part of regular income tax, meaning they explore their ordinary income tax rates to your gains. These states include California, New York, Massachusetts, and others. A few states have a dedicated capital gains tax on top of income tax: Washington State, for example, imposes a 7% tax on long-term capital gains above $250,000 per person per year.

Three states — Florida, Nevada, and Texas — have no income tax and therefore no capital gains tax. Tennessee and New Hampshire tax only dividend and interest income, not capital gains. If you live in a state with capital gains tax and sell an asset, you will owe both federal tax and state tax on the same gain. The federal tax is not deductible against state tax, so the total burden stacks.

If you move to a different state after selling an asset, the state where you lived when you sold it is generally the one that taxes the gain, not your new state. However, state rules on this vary, and some states have specific rules about real estate located within their borders.

How to report capital gains on your tax return

You report capital gains using Form 8949: Sales of Capital Assets, which lists each transaction separately — the date you bought it, the date you sold it, your cost basis, the sale price, and the gain or loss. Form 8949 feeds into Schedule D: Capital Gains and Losses, which totals your long-term and short-term gains and losses separately. Schedule D then feeds into your main return, Form 1040.

If you sold securities through a brokerage, the broker sends you a Form 1099-B showing the sale price and date. However, the broker often does not know your cost basis — you have to calculate and enter that yourself on Form 8949. If you sold real estate, you typically do not receive a 1099 form, but you still must report the transaction on Schedule D.

If you have only a few transactions, you can report them directly on Schedule D without filing Form 8949, though the IRS prefers Form 8949. If you have many transactions, consider using tax software or a tax professional, as errors on these forms are common and can trigger IRS notices.

Special situations: inherited assets and wash sales

When you inherit an asset, you receive a stepped-up basis. This means your cost basis is the asset's fair market value on the date the previous owner died, not what they originally paid. If the asset has appreciated significantly since the original purchase, this can eliminate most or all of the capital gains tax you would owe if you sold it shortly after inheriting it. This is one of the largest tax benefits in the U.S. tax code, though it applies only to inherited assets, not gifts.

A wash sale occurs when you sell an investment at a loss and then buy the same or a substantially identical investment within 30 days before or after the sale. The IRS disallows the loss deduction in a wash sale, and instead adds the loss amount to your cost basis in the new purchase. This rule prevents people from harvesting losses 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 sell at a loss?

No, you do not owe tax on a loss. Instead, you can use the loss to offset capital gains from other sales. If losses exceed gains, you can deduct up to $3,000 against other income in that year. Any remaining loss carries forward to future years.

What if I do not know my original cost basis?

If you have no records, you can contact the broker or seller for historical information. If that is not possible, you can use the sale price as your basis, which means you will owe tax on the full sale price — a conservative approach. The IRS may also accept a reasonable estimate if you document your effort to find the actual basis.

Are cryptocurrency gains taxed the same way as stock gains?

Yes. The IRS treats cryptocurrency as property, not currency. When you sell crypto at a profit, it is a capital gain taxed at long-term or short-term rates depending on how long you held it. Even trading one cryptocurrency for another is a taxable event.

Do I have to report capital gains if they are small?

Yes. The IRS requires you to report all capital gains, regardless of size. There is no minimum threshold. However, if your total income is below the filing threshold for your age and status, you may not have to file a return at all — but if you do file, you must include all gains.

Can I avoid capital gains tax by holding an asset forever?

You avoid tax only by not selling. Once you sell, the gain is taxable. However, if you hold until death, your heirs receive a stepped-up basis, which eliminates the tax on gains that occurred during your lifetime.