Skip to main content

HomeAll guides

How Selling Investments Affects Your Taxes

What happens to your taxes when you sell stocks, bonds, or mutual funds

When you sell an investment for more than you paid for it, the profit is taxable income. The IRS calls this a capital gain, and you owe tax on it in the year you sell — not when you buy, and not when the investment grows in value. The amount of tax depends on how long you held the investment and your overall income that year.

If you sell an investment for less than you paid, that loss can reduce your tax bill. You can use capital losses to offset capital gains, and if your losses exceed your gains, you can deduct up to $3,000 of the excess loss against other income in that tax year. Any remaining loss carries forward to future years.

The tax treatment is different depending on whether you held the investment for a short time or a long time. This distinction matters more than almost anything else about the sale.

Key Takeaways

  • Short-term capital gains (investments held one year or less) are taxed as ordinary income at your regular tax rate, which can be as high as 37 percent.
  • Long-term capital gains (investments held more than one year) are taxed at lower rates: 0 percent, 15 percent, or 20 percent depending on your income level.
  • You must report all sales on Schedule D of your tax return, and your broker sends you a Form 1099-B showing what you sold and when.
  • Capital losses can reduce your capital gains dollar-for-dollar, and excess losses can reduce other income by up to $3,000 per year.
  • The date you sell matters: selling one day before the one-year mark costs you thousands in taxes on large gains.

Short-term capital gains and your ordinary tax rate

If you sell an investment you have owned for one year or less, the profit is a short-term capital gain. The IRS taxes this as ordinary income, meaning it is added to your wages, interest, and other income and taxed at your regular bracket.

Your regular tax bracket depends on your total income for the year. In 2024, the brackets range from 10 percent to 37 percent. If you are in the 24 percent bracket and you sell a stock for a $10,000 gain, that gain is taxed at 24 percent, costing you $2,400 in federal tax (before state taxes, which vary by location).

Short-term gains are taxed the same way whether you held the investment for one month or eleven months. There is no partial credit for time held. This is why the one-year threshold is so important: crossing it can cut your tax bill in half or more on the same sale.

Long-term capital gains and preferential tax rates

If you sell an investment you have owned for more than one year, the profit is a long-term capital gain. These are taxed at preferential rates that are lower than your ordinary income tax rate.

The long-term capital gains rates are 0 percent, 15 percent, or 20 percent, depending on your income level. The 0 percent rate applies to lower-income filers; the 15 percent rate applies to most middle-income filers; and the 20 percent rate applies to high-income filers. These thresholds change each year and vary based on your filing status (single, married filing jointly, and so on).

To find out which rate applies to you, you need to know your taxable income before the capital gain is added. If you are single with $50,000 in wages and you sell a stock for a $20,000 long-term gain, you would owe 15 percent tax on the gain ($3,000), not 24 percent or higher. The same sale held short-term could cost you $4,800 or more.

How your broker reports the sale to the IRS

Your brokerage firm sends you a Form 1099-B after the end of the year showing every sale you made. This form lists the security sold, the date you bought it, the date you sold it, the sale price, and your cost basis (what you paid for it). The IRS receives a copy of this form, so your tax return must match it.

The 1099-B does not calculate your gain or loss — that is your job. You take the sale price, subtract your cost basis, and the result is your gain or loss. If you bought 100 shares of a stock at $50 per share ($5,000 total) and sold them at $75 per share ($7,500 total), your gain is $2,500.

You report all sales on Schedule D of your tax return (Form 1040). Schedule D separates short-term sales from long-term sales and calculates your net gain or loss in each category. If you have multiple sales, you list each one. If you have only one or two sales, the form is straightforward; if you have many, a tax professional or tax software can help organize them.

Using capital losses to reduce your tax bill

If you sell an investment for less than you paid, you have a capital loss. Capital losses are valuable because they can offset capital gains dollar-for-dollar. If you have $10,000 in long-term gains and $6,000 in long-term losses, your net gain is $4,000, and you owe tax only on that $4,000.

If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against wages, interest, and other ordinary income. If you have $10,000 in losses and $2,000 in gains, you can deduct $3,000 against your other income, reducing your taxable income by $3,000. The remaining $5,000 in losses carries forward to the next year, where you can use it again.

This strategy is called tax-loss harvesting: selling losing positions to capture the loss for tax purposes, often while reinvesting the proceeds in a similar investment. It is legal and common, but there is one rule to watch: the wash-sale rule. If you sell a security at a loss and buy the same security (or a substantially identical one) within 30 days before or after the sale, the loss is disallowed and added to the cost basis of the new purchase instead. The rule exists to prevent people from claiming the same loss twice.

State and local taxes on investment sales

Federal capital gains tax is only part of the picture. Most states also tax capital gains, and the rate varies widely. Some states tax capital gains as ordinary income (using the same brackets as wages), while others have a separate, lower rate. A few states do not tax capital gains at all.

New York, California, and New Jersey, for example, tax long-term capital gains as ordinary income, which can add 5 to 13 percent to your federal bill depending on the state and your income. Other states like Colorado and North Carolina have lower capital gains rates. If you live in a state with no income tax — such as Florida, Texas, or Washington — you owe no state tax on the gain, only federal.

If you moved during the year you sold an investment, you may owe tax to both states. The rules for this vary, and it is worth checking with a tax professional if you relocated.

Timing the sale to manage your tax bill

Because the one-year holding period is the dividing line between short-term and long-term rates, the timing of a sale can have a large impact. If you bought a stock on March 15, 2023, and sell it on March 14, 2024, the gain is short-term. If you sell it on March 15, 2024, the gain is long-term. One day makes the difference between being taxed at your ordinary rate (possibly 37 percent) and being taxed at 20 percent or less.

You can also manage your tax bill by choosing which shares to sell if you own multiple lots of the same security. If you bought shares at different prices over time, you can specify which shares you are selling — usually the highest-cost shares first — to minimize your gain. This is called specific lot identification. Your broker can help you do this, and you must document your choice at the time of sale.

Another strategy is to bunch gains and losses into the same year. If you have both winners and losers, selling them in the same year lets you offset them. If you have only winners, you might delay a sale until the next year when you expect to have losses, or vice versa.

Frequently Asked Questions

Do I owe tax on an investment gain if I do not sell?

No. You owe tax only when you sell and realize the gain. If a stock doubles in value but you hold it, there is no tax due that year. This is why holding investments long-term can be tax-efficient — you defer the tax bill until you need the money.

What if I inherited an investment — do I owe tax on the gain from before I inherited it?

No. When you inherit an investment, your cost basis is "stepped up" to the market value on the date of death. If your parent bought a stock for $10,000 and it was worth $50,000 when they died, your new cost basis is $50,000. If you sell it for $55,000, you owe tax only on the $5,000 gain, not the $40,000 gain that occurred before you inherited it.

Can I deduct investment losses against my salary or wages?

Only up to $3,000 per year. If you have $10,000 in capital losses and no capital gains, you can deduct $3,000 against your wages, interest, and other income. The remaining $7,000 carries forward to future years, where you can deduct another $3,000 per year until it is used up.

What is the difference between a capital gain and a dividend?

A capital gain is the profit from selling an investment for more than you paid. A dividend is a payment a company makes to shareholders from its earnings, usually paid while you still own the stock. Dividends are also taxable, but they are taxed differently — may have access to dividends (from U.S. companies held for at least 60 days) are taxed at the same preferential rates as long-term capital gains.

Do I have to report sales if I had a loss?

Yes. You report all sales on Schedule D, whether they are gains or losses. Losses are valuable for tax purposes, so you want the IRS to know about them. Your broker reports the sale to the IRS anyway, so you must report it too.

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.