What capital gains tax is and when you pay it

Capital gains tax is a tax on profit you make when you sell something you own — a stock, a house, land, or a business. You only owe it if you sell at a price higher than what you paid. The difference between what you paid and what you sold it for is your gain, and that gain is taxable income.

You do not owe capital gains tax just for owning something that goes up in value. You owe it only when you actually sell and lock in the profit. If you buy a house for $300,000 and it is worth $400,000 ten years later, you owe nothing until the day you sell it. On the day you sell it for $400,000, your capital gain is $100,000, and that $100,000 is what gets taxed.

The tax rate depends on how long you held the asset before selling. Assets you hold for one year or less are taxed as short-term capital gains at your ordinary income tax rate — the same rate you pay on wages or salary. Assets you hold for more than one year are taxed as long-term capital gains at lower rates set by federal law, usually 0%, 15%, or 20% depending on your income.

Key Takeaways

  • You owe capital gains tax only when you sell an asset for more than you paid for it, not simply because it increased in value.
  • Short-term gains (held one year or less) are taxed at your regular income tax rate; long-term gains (held over one year) are taxed at lower federal rates of 0%, 15%, or 20%.
  • Your cost basis is what you originally paid plus any improvements or fees; this is subtracted from the sale price to find your gain.
  • You report capital gains on Schedule D of your tax return, and the IRS matches your report against what the seller reports to them.
  • Some assets like primary homes have exemptions; you can exclude up to $250,000 in gains if you are single or $500,000 if married filing jointly.

How to calculate your capital gain

Start with your cost basis — the original price you paid for the asset. This includes the purchase price itself, plus any fees or costs directly tied to buying it. If you bought a stock, add the broker's commission. If you bought a house, add the closing costs, inspection fees, and title insurance. If you made improvements to a house — a new roof, a deck, new plumbing — add those costs too. Do not add maintenance costs like painting or repairs.

Subtract your cost basis from the sale price. That number is your capital gain. If you paid $50,000 for a stock (including commission) and sold it for $75,000, your gain is $25,000. If you paid $300,000 for a house, spent $40,000 on a new roof and kitchen, and sold it for $420,000, your gain is $80,000 ($420,000 minus $340,000 in total basis).

If the sale price is lower than your cost basis, you have a capital loss. You can use capital losses to offset capital gains in the same year. If your losses exceed your gains, you can deduct up to $3,000 of the net loss against other income (wages, interest, dividends). Any loss beyond $3,000 carries forward to future years.

Short-term versus long-term rates and how they affect what you owe

The holding period matters because the tax rate is much lower for long-term gains. If you hold an asset for one year or less before selling, the gain is taxed at your ordinary income tax rate — the same bracket you fall into based on your total income for the year. For 2024, those rates range from 10% to 37% depending on income. If you hold for more than one year, the rate drops to 0%, 15%, or 20% depending on your income level.

The date you bought and the date you sold determine the holding period. If you bought on March 15, 2023, and sold on March 15, 2024, you held it exactly one year, so it qualifies for long-term treatment. If you sold on March 14, 2024, it is short-term. The IRS counts the day you sell but not the day you buy.

For 2024, long-term capital gains are taxed at 0% if your income is below certain thresholds (roughly $47,000 for single filers, $94,000 for married filing jointly), at 15% for income between those thresholds and higher ones (roughly $518,000 for single, $583,000 for married), and at 20% for income above those levels. These thresholds change each year with inflation. Short-term gains have no special rate — they are simply added to your other income and taxed at whatever bracket that puts you in.

Reporting capital gains on your tax return

You report capital gains on Schedule D (Form 1040, Capital Gains and Losses), which you file with your federal tax return. List each sale separately: the asset, the date bought, the date sold, the cost basis, the sale price, and the gain or loss. The IRS requires this level of detail because brokers and sellers report the same information to the IRS, and the agency matches the two reports.

If you sold stocks or mutual funds, your broker sends you a Form 1099-B showing the sale price and holding period. If you sold a house, the title company or real estate agent sends a Form 1099-S to both you and the IRS. If you sold other assets like collectibles or business property, you may not receive a form, but you still must report the sale on Schedule D.

After you complete Schedule D, the total long-term gains and short-term gains flow to your main tax return (Form 1040). Long-term gains are taxed at the preferential rates; short-term gains are added to your ordinary income. If you have a net capital loss for the year, you can deduct up to $3,000 against other income, and carry the remainder forward.

Special rules for homes and other assets

If you sell a primary residence, you may not owe tax on part or all of the gain. You can exclude up to $250,000 in gains if you are single, or $500,000 if you are married filing jointly, as long as you owned and lived in the home for at least two of the five years before the sale. This is called the Section 121 exclusion. If your gain is $150,000 and you are single, you owe nothing. If your gain is $350,000 and you are single, you owe tax on only $100,000.

Other assets have different rules. If you sell a business, you may be able to exclude part of the gain under Section 1202 (small business stock). If you sell collectibles like art or coins, the long-term rate is 28%, not 15% or 20%. If you sell real estate held for investment, you may owe an additional 3.8% net investment income tax if your income exceeds certain thresholds.

Inherited assets receive a step-up in basis. If your parent bought a stock for $10,000 and it is worth $50,000 when they die, your cost basis becomes $50,000, not $10,000. If you sell it immediately for $50,000, you owe no capital gains tax because your gain is zero. This applies to most inherited property, though the rules are complex and depend on the type of asset and when the person died.

How state and local taxes apply to capital gains

Federal capital gains tax is only part of what you owe. Most states also tax capital gains, usually at the same rate they tax ordinary income. If you live in a state with a 5% income tax, you owe 5% on your capital gains in addition to the federal rate. A few states — Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming — do not tax income at all, so there is no state capital gains tax. New Hampshire and Tennessee tax only dividends and interest, not capital gains.

Some states have recently passed special capital gains taxes that apply only to gains above a certain threshold. Washington State, for example, taxes long-term capital gains above $250,000 at 7%. California taxes all capital gains at the same rate as ordinary income, with no preferential rate. Check your state's tax authority website to learn the rules where you live.

Local taxes vary. New York City, for example, does not have a separate capital gains tax, but you owe city income tax on all income including gains. Some counties and municipalities have local income taxes that apply to capital gains as well. The total tax on a capital gain can easily reach 40% or more when you combine federal, state, and local rates.

What records you need to keep

Keep records of every purchase and sale for at least three years after you file the return reporting the gain. For stocks and mutual funds, save your broker statements showing the purchase date, number of shares, price per share, and total cost including commissions. Save the statement showing the sale date, number of shares sold, price per share, and proceeds. If you reinvested dividends, keep records of those too, because they increase your cost basis.

For real estate, keep the original purchase documents (deed, closing statement), receipts for any improvements you made (contractor invoices, permits, before-and-after photos), and the final sale documents (closing statement, Form 1099-S). If you sold a rental property, keep records of depreciation deductions you claimed, because those reduce your cost basis and increase your gain.

If you cannot find records of what you paid for an asset, the IRS may allow you to estimate the cost basis using historical price data, but this is difficult and often results in a higher tax bill. It is far easier to keep the original documents. Store them in a safe place — a filing cabinet, a safe deposit box, or a scanned digital copy in cloud storage.

Frequently Asked Questions

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

No. If you sell for less than you paid, you have a capital loss, not a gain. You can use the loss to offset capital gains from other sales in the same year. If losses exceed gains, you can deduct up to $3,000 of the net loss against wages, interest, or other income. Any remaining loss carries forward to future years.

What if I inherited an asset and then sold it?

Your cost basis is the value of the asset on the date the person died, not what they originally paid. If your parent bought a house for $200,000 and it was worth $400,000 when they died, your basis is $400,000. If you sell it for $420,000, your gain is only $20,000. This step-up in basis applies to most inherited property.

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

Count the days between the purchase date and the sale date. If it is one year or less, it is short-term. If it is more than one year, it is long-term. The IRS counts the sale date but not the purchase date. If you bought on January 15, 2023, and sold on January 16, 2024, it is long-term.

Can I avoid capital gains tax by donating the asset to charity instead of selling it?

Yes. If you donate an appreciated asset (stock, real estate, art) to a may have access to charity, you avoid the capital gains tax entirely and can deduct the fair market value of the asset as a charitable contribution. You must itemize deductions on your tax return for this to benefit you, and the asset must have been held long-term.

What if I sold cryptocurrency or digital assets?

Cryptocurrency is treated as property for tax purposes. When you sell it, trade it for another coin, or use it to buy something, you have a taxable event. Calculate your gain the same way: sale price minus cost basis. If you held it one year or less, it is short-term. If longer, it is long-term. Keep records of every transaction, including the date and price in U.S. dollars.