Capital gains tax is the tax you owe when you sell an investment for more than you paid for it

When you sell a stock, real estate, or other asset for a profit, that profit is called a capital gain. The IRS taxes this gain, but the rate depends on how long you held the asset and how much money you made. The federal rate ranges from 0% to 20%, depending on your income level and how long you owned the thing you sold. Most states also tax capital gains, and those rates vary widely—some states have no capital gains tax at all, while others charge up to 13%.

The key split is between long-term and short-term capital gains. If you held the asset for more than one year before selling, it is a long-term gain and gets the lower federal rates. If you sold it within one year, it is a short-term gain and gets taxed at your ordinary income tax rate, which is usually higher. This distinction matters more than almost anything else in how much you will owe.

Key Takeaways

  • Long-term capital gains (assets held over one year) are taxed at 0%, 15%, or 20% federally, depending on your income bracket.
  • Short-term capital gains (assets held one year or less) are taxed as ordinary income, at rates from 10% to 37%.
  • Your state may add its own capital gains tax on top of the federal rate, ranging from 0% to 13% depending on where you live.
  • The date you bought and the date you sold determine whether a gain is long-term or short-term; one day over one year makes the difference.
  • You report capital gains on Schedule D of your tax return, and the IRS matches your brokerage statements to verify the amounts.

Long-term capital gains rates: 0%, 15%, or 20%

If you held an investment for more than one year, your federal tax rate on the profit is 0%, 15%, or 20%. Which rate you pay depends on your taxable income for the year. The IRS sets income thresholds that change each year. For 2024, the 0% rate applies to single filers with taxable income up to $47,025, married filing jointly up to $94,050, and head of household up to $63,000. The 15% rate applies to income above those thresholds up to a higher ceiling. Anything above that ceiling is taxed at 20%.

These thresholds shift slightly each year to account for inflation, so the exact numbers change. The IRS publishes updated brackets in January or February of each tax year. If you are unsure which bracket you fall into, your tax software or a tax preparer can calculate it based on your total income for the year. The 0% rate is often overlooked—if your income is low enough, you may owe no federal tax on long-term gains at all, even though you made a profit.

Short-term capital gains rates: your ordinary income tax rate

If you sold an asset you owned for one year or less, the profit is taxed as ordinary income. This means it is taxed at the same rate as your wages or salary. Federal ordinary income tax rates run from 10% to 37%, depending on your total income for the year. Because short-term gains are added to your other income, they can push you into a higher tax bracket and increase the tax on everything you earned that year.

For example, if you are a single filer in the 22% tax bracket and you sell a stock you held for six months and make a $10,000 gain, that $10,000 is taxed at 22%, not at the 15% long-term rate. If the gain pushes your total income high enough, part of it might even be taxed at 24%. This is why holding an investment just a few months longer to cross the one-year mark can save you thousands in taxes on a large gain.

How state capital gains taxes add to your federal bill

Nine states have no capital gains tax: Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, Wyoming, and New Hampshire (though New Hampshire taxes only dividends and interest, not gains). The other 41 states and Washington, D.C. tax capital gains, usually as part of ordinary income tax. A few states—California, Hawaii, Illinois, and Oregon—have separate capital gains taxes on top of income tax.

State rates vary widely. Some states tax capital gains at the same rate as ordinary income, which can be 5% to 13% depending on the state and your income bracket. Other states use a flat rate. California, for instance, taxes long-term and short-term gains the same way as ordinary income, with rates up to 13.3% for high earners. If you live in a high-tax state and sell a large investment, the state tax can be as much as or more than the federal tax. Moving to a no-tax state before selling a major asset is a strategy some people use, though the IRS has rules about this—you must genuinely move and establish residency, not just claim it on paper.

How the IRS knows what you sold and when

When you sell stock, bonds, real estate, or other investments through a broker or financial institution, that institution sends a report to the IRS. For stocks and bonds, your broker sends Form 1099-B, which lists every transaction, the date you bought it, the date you sold it, and the proceeds. For real estate, the title company or real estate agent sends Form 1099-S. The IRS receives a copy of these forms and matches them to your tax return.

You report your capital gains on Schedule D of your federal tax return (Form 1040). You list each transaction separately, calculate the gain or loss, and total them up. The IRS computer system compares your Schedule D to the 1099 forms it received from your broker. If the numbers do not match, you will receive a notice. This is why it is important to report the exact proceeds and dates from your 1099 forms, even if you think the broker made a mistake—you can correct it later with an amended return if needed.

Losses can offset gains and reduce your tax bill

If you sell an investment at a loss, you can use that loss to reduce your capital gains. If you had $15,000 in long-term gains and $5,000 in losses, you would report a net gain of $10,000 and pay tax only on that amount. This is called tax-loss harvesting—selling losing positions specifically to offset gains from winning ones. Many investors do this in December to reduce their tax bill for the year.

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 that carries forward to future years, so you can use it to offset gains in years to come. This rule applies whether the losses are long-term or short-term. Keeping records of all your transactions—wins and losses—is essential, because the IRS will ask for proof if your return is audited.

Special situations: inherited assets and like-kind exchanges

If you inherit an investment, you receive what is called a stepped-up basis. This means the value of the asset on the date the person died becomes your starting point for calculating gain or loss. If your parent bought a stock for $10,000 and it was worth $50,000 when they died, your basis is $50,000. If you sell it for $52,000 the next week, you owe tax on only $2,000 of gain, not $42,000. This is a major tax advantage of inherited assets and is one reason people hold investments until death rather than selling them during their lifetime.

Another special case is a like-kind exchange under Section 1031 of the tax code. If you sell real estate and use the proceeds to buy similar real estate within a set time frame, you can defer the capital gains tax. This applies mainly to real estate investors who want to trade up to a larger property without triggering a tax bill. The rules are strict—you must identify the replacement property within 45 days and close on it within 180 days—and you should work with a may have access to intermediary and a tax professional to do this correctly.

Frequently Asked Questions

Do I have to pay capital gains tax if I sell at a loss?

No. If you sell an investment for less than you paid for it, you have a capital loss, not a gain, and you owe no tax on the sale itself. You can use the loss to reduce any capital gains you have that year, or to reduce up to $3,000 of ordinary income. Losses beyond that carry forward to future years.

What if I bought a stock years ago and do not know what I paid for it?

Your broker should have records going back several years, and you can request a cost basis report. If records are truly lost, the IRS allows you to estimate based on historical price data, though you should document your method. If you cannot find the original cost, you may want to consult a tax professional before filing.

Does the one-year holding period count from the purchase date or the settlement date?

It counts from the settlement date, which is typically two business days after you buy the stock. If you buy on January 10 and it settles on January 12, the one-year mark is January 12 of the following year. You must hold until at least January 13 to may have access to for long-term rates.

Can I deduct investment losses from my regular income?

Yes, but only up to $3,000 per year. If you have $10,000 in capital losses and no gains, you can deduct $3,000 against your wages, salary, or other income. The remaining $7,000 carries forward to next year, when you can deduct another $3,000, and so on until the loss is used up.

Do I owe capital gains tax on cryptocurrency?

Yes. The IRS treats cryptocurrency like any other asset. If you buy Bitcoin for $20,000 and sell it for $35,000, the $15,000 gain is a capital gain. It is long-term if you held it over one year, short-term if less. You report it on Schedule D just like stock gains.