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

When you sell a stock, rental property, or other asset for a profit, the IRS taxes that profit as capital gains. You do not pay tax on the full sale price — only on the difference between what you paid (your cost basis) and what you sold it for. The tax rate depends on how long you held the asset and your income level.

You report capital gains on your federal tax return, usually on Schedule D (Form 1040), and pay the tax when you file. Some states also tax capital gains. The process is straightforward once you know which gains you owe tax on and which rate applies to you.

Key Takeaways

  • Long-term capital gains (assets held over one year) are taxed at 0%, 15%, or 20% depending on your income, while short-term gains are taxed as ordinary income at your regular tax bracket rate.
  • You calculate the gain by subtracting your original purchase price from the sale price, and you report it on Schedule D when you file your tax return.
  • The IRS requires you to report all capital gains, including losses, which can offset gains and reduce your tax bill.
  • Some states impose their own capital gains tax on top of federal tax, so check your state's rules if you live outside the nine states with no income tax.

Understanding long-term versus short-term capital gains

The IRS divides capital gains into two categories based on how long you owned the asset. Long-term capital gains explore to assets you held for more than one year. Short-term capital gains explore to assets you held for one year or less. The holding period matters because the tax rates are very different.

Long-term capital gains are taxed at preferential rates: 0%, 15%, or 20%, depending on your taxable income and filing status. Short-term capital gains are taxed as ordinary income at your regular tax bracket rate, which can be as high as 37%. This means selling an asset too soon can cost you significantly more in taxes.

For example, if you buy a stock for $1,000 and sell it for $1,500 after eight months, that $500 gain is short-term and taxed at your ordinary rate. If you wait four more months and sell for the same price, the same $500 gain is long-term and taxed at 0%, 15%, or 20% instead.

How to calculate your capital gain or loss

Calculating a capital gain is straightforward subtraction. Take the sale price (the amount you received when you sold the asset) and subtract your cost basis (what you paid for it, plus any improvements or fees). The result is your gain or loss.

Cost basis includes the original purchase price plus any commissions, fees, or improvements you made. For real estate, improvements are things like a new roof or addition — not routine maintenance. For stocks, cost basis includes the purchase price plus any brokerage fees. If you inherited an asset, your cost basis is usually the fair market value on the date of death, not what the original owner paid.

If you sell for less than your cost basis, you have a capital loss. You can use losses to offset gains in the same year. If losses exceed gains, you can deduct up to $3,000 of the excess loss against ordinary income, and carry forward any remaining loss to future years.

Reporting capital gains on your tax return

You report capital gains on Schedule D (Form 1040), which you attach to your federal tax return. Schedule D has two parts: one for long-term gains and losses, and one for short-term gains and losses. You list each sale separately with the date acquired, date sold, cost basis, and sale price.

Your brokerage or investment firm sends you a Form 1099-B (Proceeds from Broker and Barter Exchange Transactions) that lists your sales. Your real estate closing statement shows the sale price and closing costs. Use these documents to fill out Schedule D accurately.

After you complete Schedule D, the net gain or loss carries to line 7 of Schedule 1 (Form 1040), which feeds into your main tax return. If you have a net long-term gain, you will also need to complete Form 8949 (Sales of Capital Assets) to reconcile your reported gains with what appears on your 1099-B.

Understanding the long-term capital gains tax rates

Long-term capital gains are taxed at three rates: 0%, 15%, or 20%. Which rate you pay depends on your taxable income and filing status. The IRS adjusts the income thresholds each year for inflation.

For 2024, the 0% rate applies to single filers with taxable income up to $47,025 and married couples filing jointly up to $94,050. The 15% rate applies to income above those thresholds up to $518,900 (single) or $583,750 (married filing jointly). The 20% rate applies to income above those amounts. These thresholds change annually, so check the IRS website or your tax software for the current year.

Your long-term gains are stacked on top of your ordinary income to determine which bracket you fall into. If you are near a threshold, timing when you sell assets can affect your rate. Selling in a lower-income year might save you thousands in taxes.

State capital gains taxes and special situations

Nine states have no income tax and therefore no capital gains tax: Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, Wyoming, and New Hampshire (which taxes only dividends and interest, not capital gains). If you live in any other state, you likely owe state capital gains tax on top of federal tax.

State rates vary widely. California taxes capital gains as ordinary income at rates up to 13.3%. New York tops out at 10.9%. Some states like Illinois have a flat capital gains tax of 4.75%. Check your state's Department of Revenue website to find your rate and filing requirements.

Special situations include selling a primary residence (you may exclude up to $250,000 of gain if single or $500,000 if married filing jointly, if you meet ownership and use tests), selling inherited assets (you get a "step-up" in basis), and selling business property (which may may have access to for different treatment under Section 1231).

When and how to pay capital gains tax

You pay capital gains tax when you file your annual tax return, not when you sell the asset. If you expect a large capital gain, you can make estimated tax payments to the IRS in quarterly installments (April 15, June 15, September 15, and January 15) to avoid penalties. Use Form 1040-ES to calculate what you owe.

If you sell an asset late in the year and realize a large gain, you do not have to pay until you file your return the following spring. However, if you do not pay enough through withholding or estimated payments, you may owe a penalty when you file.

File Schedule D and your tax return by April 15 of the year following the sale. If you need more time, you can request an extension to October 15, but the extension applies only to filing — you still owe the tax by April 15.

Frequently Asked Questions

Do I have to report capital losses if I did not have any gains?

Yes. You report all capital losses on Schedule D, even if you have no gains. If your losses exceed gains, you can deduct up to $3,000 against ordinary income in that year. Any excess carries forward to future years indefinitely, so it is worth documenting even if you cannot use it when ready.

What is the difference between cost basis and fair market value?

Cost basis is what you paid for the asset. Fair market value is what it is worth on a given date. For inherited assets, your cost basis is the fair market value on the date of death, not what the original owner paid. This "step-up" in basis can eliminate or reduce capital gains tax on inherited property.

Can I deduct investment losses against my salary or wages?

No. Capital losses can only offset capital gains. If losses exceed gains, you can deduct up to $3,000 of the excess against ordinary income (wages, salary, interest). Any remaining loss carries forward to future years to offset future gains or ordinary income.

Do I owe capital gains tax on mutual funds or ETFs I hold in a retirement account?

No. Gains inside a 401(k), IRA, or other may have access to retirement account are not taxed when they occur. You pay tax only when you withdraw money from the account in retirement, and the rate depends on the account type (traditional accounts are taxed as ordinary income; Roth accounts are tax-free).

What happens if I sell an asset at a loss and buy it back a few weeks later?

The loss is disallowed under the wash-sale rule if you buy the same or substantially identical security within 30 days before or after the sale. The loss is added to the cost basis of the new purchase instead. This rule prevents you from claiming a loss for tax purposes while maintaining your investment position.