Skip to main content

HomeAll guides

When You Owe Capital Gains Tax on Stocks

You pay capital gains tax when you sell a stock for more than you paid for it, and the tax is due the year you sell — not when you buy or hold

Capital gains tax is a tax on profit. If you buy 100 shares at $10 each and sell them at $15 each, your profit is $500. That $500 is your capital gain, and it is taxable income in the year you sell. You do not owe tax while you hold the stock, only when you actually sell it and lock in the profit.

The IRS taxes capital gains differently depending on how long you held the stock. If you held it for one year or less, it counts as a short-term capital gain and is taxed at your ordinary income tax rate — the same rate as wages or salary. If you held it for more than one year, it counts as a long-term capital gain and is taxed at a lower rate (0%, 15%, or 20%, depending on your income). Most people pay less tax on long-term gains than short-term gains.

Key Takeaways

  • You owe capital gains tax only in the year you sell the stock, based on the profit you made from the sale price minus what you originally paid.
  • Short-term capital gains (stocks held one year or less) are taxed at your regular income tax rate, which is usually higher than the long-term rate.
  • Long-term capital gains (stocks held more than one year) are taxed at preferential rates of 0%, 15%, or 20%, depending on your total income for the year.
  • You report capital gains on your tax return using Form 8949 and Schedule D, and your brokerage will send you a Form 1099-B showing your sales.

How the holding period works

The holding period is the number of days between when you buy a stock and when you sell it. The IRS counts the day you sell but not the day you buy. If you buy on January 15 and sell on January 15 of the next year, you have held it for exactly one year, and it qualifies for long-term treatment.

The holding period matters because it determines your tax rate. A stock you hold for 13 months gets the long-term rate. A stock you hold for 11 months gets the short-term rate — your ordinary income tax rate, which could be 10%, 12%, 22%, 24%, 32%, 35%, or 37% depending on your income and filing status. The difference can be substantial. If you are in the 24% bracket, a short-term gain is taxed at 24%, but a long-term gain is taxed at 15%.

Short-term capital gains and your tax bracket

Short-term capital gains are added to your other income for the year and taxed at whatever rate applies to your total income. If you earn $60,000 in salary and have a $10,000 short-term capital gain, you are taxed as if you earned $70,000 total. This can push you into a higher tax bracket.

Your brokerage account does not withhold tax on short-term gains automatically. You are responsible for setting aside money to pay the tax when you file your return in April. Some people make quarterly estimated tax payments if they expect a large gain.

Long-term capital gains rates and income thresholds

Long-term capital gains are taxed at preferential rates, but the rate you pay depends on your income level. The thresholds change each year and vary by filing status. For 2024, the 0% rate applies to single filers with income up to $47,025, the 15% rate applies to income between $47,025 and $518,900, and the 20% rate applies to income above $518,900. These numbers are different for married filing jointly, head of household, and other filing statuses.

This means a long-term gain can be taxed at 0% if your total income for the year falls below the threshold. A married couple filing jointly with $100,000 in combined income could have $50,000 in long-term capital gains taxed at 0% if their income stays below the 15% threshold. Your brokerage does not know your total income, so you calculate the tax yourself when you file.

What happens if you have losses

If you sell a stock for less than you paid for it, you have a capital loss. You can use capital losses to offset capital gains. If you have $5,000 in gains and $3,000 in losses, you report a net gain of $2,000. If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against your other income. Any losses beyond that carry forward to future years.

This is why some people sell losing positions in December — to harvest the loss and use it to reduce their tax bill. The loss is real and permanent; you are just timing when you claim it.

How to report capital gains on your tax return

Your brokerage sends you a Form 1099-B by January 31 showing every stock sale you made during the year, the sale price, and the date sold. You use this form to fill out Form 8949 (Sales of Capital Assets), which lists each sale with the date acquired, date sold, cost basis, and proceeds. Form 8949 feeds into Schedule D, which summarizes your short-term and long-term gains and losses and calculates your net capital gain or loss for the year.

Schedule D is then attached to your Form 1040 (your main tax return). If you use tax software, it usually imports the 1099-B data automatically and walks you through the forms. If you file by hand or with a tax professional, you will need the 1099-B and your own records of what you paid for each stock (your cost basis).

Wash sale rules and timing

The IRS has a rule called the wash sale rule that prevents you from claiming a loss if you buy the same stock (or a substantially identical one) within 30 days before or after the sale. If you sell a stock at a loss on December 15 and buy it back on December 20, the loss is disallowed, and the loss amount is added to the cost basis of the new shares instead. This rule exists to prevent people from harvesting losses while maintaining their position in the stock.

The 30-day window is strict: 30 days before the sale, the day of the sale, and 30 days after. If you want to claim the loss and stay invested in the same company, you can buy a similar but not identical security (like a different share class or an ETF that holds the stock) and wait 31 days before buying back the original stock.

State and local taxes on capital gains

Federal capital gains tax is only part of the picture. Some states tax capital gains as ordinary income, some tax them at a lower rate, and some do not tax them at all. New York, California, and Massachusetts tax long-term capital gains at the same rate as ordinary income. States like Florida, Texas, and Wyoming have no state income tax at all. If you live in a state with a capital gains tax, you will owe that tax in addition to federal tax.

A few states, including Washington and Oregon, have recently passed capital gains taxes that explore only to long-term gains above a certain threshold. The rules vary, so check your state's tax authority website or ask a tax professional if you are unsure whether your state taxes capital gains.

Frequently Asked Questions

Do I owe capital gains tax if I do not sell the stock?

No. You owe capital gains tax only when you sell. If you buy a stock at $50 and it rises to $100 but you never sell, you owe no tax. The gain is unrealized. Tax is due only when you sell and the gain becomes real.

What if I inherited stock from someone?

Inherited stock gets a step-up in basis. If your parent bought a stock at $20 and it was worth $100 when they died, your cost basis becomes $100. If you sell it at $105, you owe tax on only $5 of gain, not $80. This applies to most inherited assets, not just stocks.

Can I deduct losses from my stock sales?

Yes, but with limits. You can use losses to offset gains dollar-for-dollar. If losses exceed gains, you can deduct up to $3,000 of the excess against your other income in that year. Any remaining losses carry forward to future years with no time limit.

How do I know my cost basis if I lost my records?

Your brokerage has records going back several years. Contact them and request a cost basis report. If the brokerage acquired your account from another firm, they may have records from the previous firm. If records are truly unavailable, you can reconstruct cost basis using historical stock prices, though this is tedious and may require a tax professional.

Is there a way to reduce capital gains tax legally?

Yes. Holding stocks for more than one year qualifies them for lower long-term rates. Harvesting losses to offset gains reduces your net taxable gain. Donating appreciated stock to charity avoids the capital gains tax entirely and gives you a charitable deduction. Placing stocks in a retirement account like a 401(k) or IRA defers or eliminates capital gains tax on those holdings.

This guide is for general information only and is not medical, financial, legal, or other professional advice. For decisions specific to your situation, consult a qualified professional. See our Editorial Policy.