Federal capital gains tax is the tax you owe the IRS when you sell something for more than you paid for it

When you sell a stock, real estate, or other asset at a profit, that profit is called a capital gain. The federal government taxes this gain at rates that depend on how long you held the asset and how much total income you earned that year. The tax is separate from income tax on wages or salary — it uses its own tax brackets and rules.

The IRS treats short-term gains (assets held one year or less) as ordinary income, taxed at your regular income tax rate. Long-term gains (assets held more than one year) get preferential rates: 0%, 15%, or 20% depending on your total income. This difference means the same $10,000 profit can be taxed very differently depending on how long you owned the asset.

Key Takeaways

  • Long-term capital gains are taxed at 0%, 15%, or 20% based on your income bracket, while short-term gains are taxed as ordinary income at rates up to 37%.
  • You only owe capital gains tax when you actually sell the asset; simply owning something that increased in value does not trigger a tax bill.
  • The IRS requires you to report all capital gains on Schedule D of your tax return, and your broker will send you a Form 1099-B showing what you sold.
  • You can reduce capital gains by subtracting losses from other sales in the same year, and unused losses can carry forward to future years.
  • State and local taxes may add to your federal capital gains tax bill, and some states tax capital gains differently than the federal government does.

Long-Term vs. Short-Term Capital Gains Rates

The holding period — how long you owned the asset before selling — determines which tax rate applies. If you sell within one year of purchase, the gain is short-term and taxed as ordinary income. Your short-term rate depends on your total income for the year and your filing status. For 2024, short-term rates range from 10% to 37%.

Long-term gains get lower rates if you held the asset for more than one year. The 0% rate applies to lower-income filers (roughly $47,000 or less in income for single filers in 2024, though this varies by year and filing status). The 15% rate covers middle-income filers. The 20% rate applies to high-income filers. These thresholds change annually and depend on whether you file as single, married filing jointly, or head of household.

The difference matters substantially. A $50,000 long-term gain taxed at 15% costs $7,500 in federal tax. The same gain as a short-term gain, taxed at 37%, costs $18,500. Holding an asset just long enough to may have access to for long-term treatment can save thousands in taxes.

When You Owe Capital Gains Tax

You owe capital gains tax only when you sell the asset and realize the gain. Owning a stock that doubled in value does not create a tax bill. Selling that stock does. This is called a "realized" gain, and it is the only kind the IRS taxes.

The sale does not have to be for cash. Trading one asset for another of equal or greater value, or receiving an asset as payment, counts as a sale for tax purposes. Donating an appreciated asset to charity also triggers a capital gains tax event in some situations, though charitable donations have their own rules.

If you inherit an asset, the tax basis resets to the value on the date of death. This means if your parent bought a house for $200,000 and it was worth $500,000 when they died, your basis is $500,000. If you sell it immediately for $500,000, you owe no capital gains tax. This is called a "step-up in basis" and applies to most inherited assets.

How to Calculate Your Capital Gain

Your capital gain is the sale price minus your cost basis. Cost basis is usually what you paid for the asset, including any fees or commissions. If you bought 100 shares at $50 per share plus a $10 commission, your basis per share is $50.10, for a total basis of $5,010.

When you sell, subtract your basis from the sale proceeds. If you sell those 100 shares for $7,500, your capital gain is $7,500 minus $5,010, or $2,490. That $2,490 is what gets taxed, not the full $7,500.

Basis can be complicated if you received the asset as a gift, inherited it, or received it as payment. If you received a gift, your basis is usually the donor's basis (what they paid), not the value when you received it. Keep records of how you acquired each asset and what you paid, because the IRS will ask for proof if you are audited.

Capital Losses and Offsetting Gains

If you sell an asset for less than you paid, you have a capital loss. Capital losses can offset capital gains in the same year, reducing your tax bill. If you have $30,000 in long-term gains and $10,000 in losses, you report a net gain of $20,000 and pay tax only on that amount.

If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against ordinary income (wages, salary, interest). Any remaining loss carries forward to future years and can be used to offset future gains or income. This means a large loss in one year can reduce your taxes over several years.

The IRS has a rule called "wash sale" that prevents you from claiming a loss and then buying the same or substantially identical security within 30 days before or after the sale. If you do, the loss is disallowed and added to your basis in the new purchase instead.

Reporting Capital Gains on Your Tax Return

You report capital gains on Schedule D (Form 1040), which is part of your federal income tax return. Your broker sends you a Form 1099-B in January showing all sales from the previous year, including the sale price and date. Use this form to fill out Schedule D.

Schedule D separates short-term gains and losses from long-term ones. You calculate net short-term gain or loss, then net long-term gain or loss, then combine them. The result goes on your main tax return (Form 1040) and affects your total taxable income.

If you sold real estate, you may also need to file Form 8949 (Sales of Capital Assets) before completing Schedule D. The rules for real estate can be more complex, especially if you used the property for business or rental purposes. Keep all purchase documents, sale documents, and records of improvements or repairs, as these affect your basis.

State and Local Capital Gains Taxes

Most states tax capital gains as part of ordinary income using their regular income tax rates. A few states — including California, New York, and Washington — have separate capital gains taxes on top of income tax. Washington's capital gains tax, for example, applies a 7% tax to long-term gains over $250,000 per year.

Some states do not tax capital gains at all. If you live in one of these states (Florida, Texas, Wyoming, and others), you owe only federal capital gains tax. If you moved during the year you sold an asset, you may owe tax to both your old state and your new state, depending on when the sale occurred and each state's rules.

Local taxes in some cities and counties can also apply. New York City, for example, taxes capital gains as part of city income tax. Check your state and local tax authority websites to understand what you owe beyond federal tax.

Special Rules for Specific Assets

Collectibles — art, coins, stamps, and similar items — are taxed at a maximum rate of 28% on long-term gains, even if your income would normally put you in the 15% or 0% bracket. This is higher than the standard long-term rate and applies regardless of your income level.

Real estate used as your primary residence gets special treatment. If you are single and lived in the home for at least two of the last five years, you can exclude up to $250,000 of gain from tax. Married couples filing jointly can exclude up to $500,000. This exclusion applies once every two years and is one of the largest tax breaks available.

may have access to small business stock has its own rules. If you held stock in a C corporation with gross assets under $50 million and meet other requirements, you may be able to exclude 50%, 75%, or even 100% of your gain from tax. This is a specialized rule that requires careful documentation and usually benefits entrepreneurs who sell their own businesses.

Frequently Asked Questions

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

No, you owe no tax on a loss. Instead, you can use the loss to reduce capital gains from other sales in the same year. If losses exceed gains, you can deduct up to $3,000 against ordinary income, with any remainder carrying forward to future years.

What if I do not know my original purchase price?

Contact your broker or the institution where you held the asset — they may have records going back years. If records are truly unavailable, you can estimate based on historical price data, but the IRS may challenge this. Keep whatever documentation you can find and explain what happened if audited.

How do I know if my gain is long-term or short-term?

Count the days from purchase to sale. If you bought on January 15 and sold on January 16 of the next year, that is short-term (one day short of one year). If you sold on January 17, it is long-term. Your broker's 1099-B will mark transactions as long-term or short-term based on the holding period.

Can I avoid capital gains tax by not selling?

Yes — you owe no tax on unrealized gains, only on sales. However, this does not eliminate the tax permanently; it only delays it. When you eventually sell or pass the asset to heirs, the tax becomes due (though heirs get a step-up in basis that may eliminate it entirely).

What if I sold an asset in a previous year and never reported it?

Contact a tax professional or the IRS. Filing an amended return is better than waiting for an audit. The IRS has a statute of limitations (usually three years, but longer if you underreported income by 25% or more), and penalties increase the longer you wait.