What happens to your taxes when you sell an investment

When you sell a stock, bond, mutual fund, or other investment for more than you paid for it, the profit is taxable income. The IRS calls this a capital gain. How much tax you owe depends on two things: how much you made, and how long you held the investment before selling it. A profit on something you owned for less than a year is taxed as ordinary income at your regular tax rate. A profit on something you owned for more than a year gets a lower tax rate, called the long-term capital gains rate.

If you sell an investment for less than you paid for it, that loss can reduce your taxable income. You can use investment losses to offset investment gains dollar-for-dollar. If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against other income (like wages or interest). Any remaining loss carries forward to future years.

The tax bill arrives when you file your return in the year you sell, not when you buy. You report the sale on Schedule D, a form that lists each transaction and calculates your total gain or loss for the year.

Key Takeaways

  • Profits on investments held one year or less are taxed at your ordinary income tax rate; profits on investments held longer than one year receive a lower long-term capital gains rate.
  • The long-term capital gains rate is 0%, 15%, or 20% depending on your total income for the year, which is lower than most people's ordinary tax rates.
  • Investment losses can reduce your taxable income by offsetting gains, and up to $3,000 of excess losses can reduce other income each year.
  • You report investment sales on Schedule D when you file taxes in the year you sell, and your broker sends you a Form 1099-B documenting the transaction.
  • Timing a sale to cross the one-year holding period can significantly reduce your tax bill if you are in a higher tax bracket.

Short-term versus long-term capital gains rates

A short-term capital gain is a profit on an investment you owned for one year or less. It is taxed at your ordinary income tax rate — the same rate you pay on wages, interest, or other regular income. If you are in the 24% tax bracket, a short-term gain is taxed at 24%. If you are in the 37% bracket, it is taxed at 37%.

A long-term capital gain is a profit on an investment you owned for more than one year. It is taxed at a preferential rate: 0%, 15%, or 20%, depending on your total taxable income for the year. Most people in the middle income range pay 15%. The 0% rate applies to lower-income filers; the 20% rate applies to high-income filers. These rates are much lower than ordinary income tax rates, which is why holding an investment past the one-year mark can save significant money.

The holding period starts the day after you buy and ends the day you sell. If you buy on January 15 and sell on January 16 of the following year, you have held it for more than one year and may have access to for the long-term rate.

How to calculate your capital gain or loss

Your capital gain or loss is the difference between what you sold the investment for and what you paid for it, minus any fees or commissions. If you bought 100 shares at $50 per share and sold them at $75 per share, your gain is $2,500 before costs. If you paid a $25 commission to sell, your actual gain is $2,475.

Your broker reports the sale to the IRS on a Form 1099-B, which shows the sale price and the date sold. You receive a copy in January or February of the following year. The form may or may not include your original purchase price — this depends on when you bought and what type of investment it is. If the purchase price is missing, you must find your original records (the confirmation slip, brokerage statement, or purchase receipt) and calculate the gain yourself.

If you own shares in the same company bought at different times and prices, you can choose which shares to sell. This is called cost basis selection. You might sell the highest-cost shares first to minimize your gain, or the lowest-cost shares to maximize a loss. You must tell your broker in writing which shares you want to sell before the transaction settles, or the IRS assumes you sold the oldest shares first (called FIFO, or first-in-first-out).

Using losses to reduce your tax bill

Investment losses are valuable because they reduce your taxable income. If you have $10,000 in capital gains and $6,000 in capital losses in the same year, your net gain is $4,000. You report this net amount on your tax return.

If your losses exceed your gains, you can deduct up to $3,000 of the excess loss against wages, interest, dividends, or other ordinary income in that year. If you have $10,000 in losses and $2,000 in gains, you can deduct $3,000 against 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. Some investors intentionally sell losing positions late in the year to offset gains from winning positions. However, there is a rule called the wash-sale rule: if you sell an investment at a loss and buy the same or a substantially identical investment within 30 days before or after the sale, the loss is disallowed. You can buy a similar but not identical investment (for example, a different tech stock instead of the same one) to avoid this rule.

State and local taxes on investment sales

Federal capital gains tax is only part of the bill. Most states also tax capital gains, either as ordinary income or at a separate rate. New York, California, and several other states tax long-term capital gains at the same rate as ordinary income. A few states, like Hawaii and North Carolina, have separate long-term capital gains rates. Some states, including Florida, Texas, and Washington, do not tax capital gains at all.

Your city or county may also impose a tax on investment income. New York City, for example, taxes capital gains as part of its local income tax. Check your state and local tax authority's website to find the rate that applies to you.

When you file your federal return, you also file a state return (in states that have income tax) and possibly a local return. Your broker's 1099-B is sent to both the IRS and your state tax authority, so you cannot omit the sale from your state return even if you do not owe federal tax on it.

Reporting investment sales on your tax return

You report all investment sales on Schedule D, a form attached to your federal tax return. You list each transaction separately: the investment name, the date bought, the date sold, the purchase price, the sale price, and the gain or loss. If you have many transactions, you can attach a summary instead of listing each one individually.

Schedule D calculates your total short-term gains and losses, then your total long-term gains and losses. The form then combines these to show your net capital gain or loss for the year. If you have a net gain, it flows to your main tax return (Form 1040) and is added to your taxable income. If you have a net loss, you can deduct up to $3,000 against other income, with any excess carrying forward.

You do not need to file Schedule D if you have no investment sales in the year. However, if you receive a 1099-B from your broker, the IRS knows you sold something, and filing a return without Schedule D will trigger a notice.

Planning ahead to reduce your tax bill

Timing matters. If you are close to the one-year holding mark on a profitable investment, waiting a few weeks or months to cross that threshold can cut your tax rate significantly. An investment worth $10,000 in gains taxed at 24% (short-term) costs $2,400 in federal tax. The same gain taxed at 15% (long-term) costs $1,500 — a savings of $900.

Similarly, if you have losses sitting in your portfolio, you can harvest them strategically to offset gains you expect to realize. If you know you will sell a winning stock in November, you might sell a losing position in October to reduce the tax impact.

If you receive an inheritance of stocks or mutual funds, the cost basis is "stepped up" to the market value on the date of death. This means if your parent bought a stock for $50 and it was worth $200 when they died, your basis is $200. If you sell it the next day for $200, you owe no tax. This is a major tax advantage of inherited investments.

Frequently Asked Questions

Do I owe taxes if I sell an investment at a loss?

No federal tax is owed on the loss itself. However, you must report the sale on Schedule D. The loss reduces any capital gains you have that year, and if losses exceed gains, you can deduct up to $3,000 against other income. Excess losses carry forward to future years.

What if I do not know my original purchase price?

Contact your broker and request your purchase records or account history. If the investment was bought many years ago and records are unavailable, you may need to estimate the cost basis using historical price data. In difficult cases, consult a tax professional or CPA.

Can I avoid capital gains tax by holding an investment forever?

Yes, as long as you do not sell. Tax is owed only when you sell. However, when you die, your heirs inherit the investment with a stepped-up basis, meaning they owe no tax on gains that occurred during your lifetime. This is why some investors hold appreciated assets until death.

Do I have to report investment sales if I made a small profit?

Yes. All sales must be reported on Schedule D, regardless of the amount. Your broker reports the sale to the IRS, so omitting it will likely trigger an audit notice.

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

A capital gain is profit from selling an investment for more than you paid. A dividend is income paid by a company to shareholders while you still own the stock. Dividends are taxed differently: may have access to dividends (held for 60+ days around the ex-dividend date) are taxed at long-term capital gains rates; non-may have access to dividends are taxed as ordinary income.