What happens to the profit when you sell an investment
When you sell an investment for more than you paid for it, the profit is called a capital gain, and the IRS taxes it. The tax rate depends on how long you held the investment before selling. If you held it for more than one year, you pay the long-term capital gains rate, which is lower. If you held it for one year or less, you pay the short-term capital gains rate, which is the same as your ordinary income tax rate.
The IRS does not automatically take this tax from the sale proceeds. Instead, you owe it when you file your tax return for the year you sold the investment. Your brokerage will send you a form called a 1099-B that lists what you sold and for how much, and you use that to calculate what you owe.
You only pay tax on the gain itself, not on the full sale price. If you bought 100 shares of stock for $1,000 and sold them for $1,500, your capital gain is $500, and that is the amount subject to tax.
Key Takeaways
- Long-term capital gains (held over one year) are taxed at a lower rate than short-term gains, which are taxed as ordinary income.
- You calculate your gain by subtracting what you paid for an investment from what you sold it for, and you only pay tax on that difference.
- Your brokerage sends you a 1099-B form after the year ends, showing your sales and proceeds, which you use to report the gain on your tax return.
- You can reduce your capital gains tax by offsetting gains with losses from other investments sold in the same year.
Long-term versus short-term capital gains rates
The rate you pay depends entirely on how long you owned the investment before you sold it. Long-term capital gains are profits from investments you held for more than one year. The IRS taxes these at 0%, 15%, or 20%, depending on your total income for the year. These rates are much lower than ordinary income tax rates.
Short-term capital gains are profits from investments you held for one year or less. The IRS taxes these at your ordinary income tax rate, which can be 10%, 12%, 22%, 24%, 32%, 35%, or 37%, depending on your income bracket. This is why holding an investment longer can save you significant money in taxes.
The holding period starts the day after you buy and ends the day you sell. If you bought a stock on March 15 and sold it on March 16 of the following year, you 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
The calculation is straightforward: subtract your cost basis from your sale price. Your cost basis is what you paid for the investment, including any fees or commissions your broker charged you to buy it. If you bought 50 shares at $20 per share and paid a $10 commission, your total cost basis is $1,010, or $20.20 per share.
When you sell, multiply the number of shares by the price you received per share, then subtract your total cost basis. If you sold those 50 shares for $25 per share and received $1,250, your capital gain is $1,250 minus $1,010, or $240.
If the sale price is lower than your cost basis, you have a capital loss instead of a gain. You can use capital losses to reduce capital gains from other investments sold in the same year, which lowers your tax bill. If your losses exceed your gains, you can deduct up to $3,000 of the excess loss against your ordinary income in that year, and carry any remaining loss forward to future years.
When you receive the 1099-B form and what it shows
After the calendar year ends, your brokerage sends you a 1099-B form by January 31. This form lists every investment you sold during the year, the date you sold it, the proceeds you received, and sometimes your cost basis. The form has multiple copies: one for you, one for the IRS, and one for your state tax authority if your state has income tax.
The 1099-B does not calculate your gain for you. It shows the sale price and may show your cost basis if your brokerage has that information on file, but you are responsible for doing the math and reporting it correctly on your tax return. If you bought an investment through a different brokerage years ago and transferred it, your current brokerage may not have the original cost basis, and you will need to find that information yourself.
If you sold investments through multiple brokerages, you will receive multiple 1099-B forms. You must report all of them on your tax return, even if you only received one.
How to report capital gains on your tax return
You report capital gains on Schedule D, a form that attaches to your Form 1040 federal income tax return. Schedule D has two sections: one for long-term gains and losses, and one for short-term gains and losses. You list each sale separately, showing the date acquired, date sold, proceeds, cost basis, and gain or loss.
After you fill in Schedule D, it calculates your net long-term gain or loss and your net short-term gain or loss. If you have both long-term and short-term gains, the long-term gains are taxed at the lower rate. If you have losses, they offset gains first, then reduce your ordinary income up to the $3,000 annual limit.
If you use tax software, it usually walks you through entering your 1099-B information and fills in Schedule D for you. If you file by hand or with a tax professional, bring all your 1099-B forms and any records showing your cost basis.
State and local taxes on capital gains
Most states with income tax also tax capital gains as ordinary income, meaning you pay your state income tax rate on the gain. A few states have special capital gains taxes: Washington State, for example, taxes long-term capital gains on certain high-value sales at a flat rate separate from income tax. Other states, including Florida, Texas, and Wyoming, have no income tax at all, so residents pay no state capital gains tax.
Some cities and counties also tax capital gains or investment income. New York City, for instance, includes capital gains in taxable income for city tax purposes. Check your state and local tax rules or ask a tax professional if you are unsure whether you owe state or local tax on your gains.
Your 1099-B is sent to your state tax authority as well as the IRS, so if you do not report a gain on your state return when you should have, the state may contact you about it.
Using losses to reduce your capital gains tax
If you sold some investments at a loss in the same year you sold others at a gain, you can use the losses to offset the gains. This is called tax-loss harvesting. If you had $5,000 in long-term gains and $2,000 in long-term losses, your net long-term gain is $3,000, and you only pay tax on $3,000.
Losses can also offset gains from different categories. A short-term loss can reduce a long-term gain, and vice versa. After all gains and losses are netted, if you still have a net loss, you can deduct up to $3,000 against your ordinary income in that year. Any loss beyond $3,000 carries forward to the next year, where you can use it again.
One rule to watch: 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 wash-sale rule applies. The IRS will not let you deduct the loss, and instead adds it to your cost basis in the new investment. This rule prevents people from selling at a loss just for the tax deduction and when ready buying back the same thing.
Frequently Asked Questions
Do I have to pay capital gains tax when ready when I sell?
No. You owe the tax when you file your tax return for the year you sold the investment, which is usually due April 15 of the following year. Your brokerage does not withhold the tax automatically, so you need to set aside money to pay it or make quarterly estimated tax payments if you expect a large bill.
What if I inherited an investment — do I pay capital gains tax on it?
No. When you inherit an investment, your cost basis is reset to its value on the date of the person's death. If you then sell it, you only pay tax on gains that happen after you inherited it. This is called a step-up in basis and can save you significant tax.
Can I deduct investment losses if I did not have any gains?
Yes, but only up to $3,000 per year against your ordinary income. If your losses are larger than $3,000, you carry the excess forward to future years and can deduct $3,000 per year until the loss is used up.
What is the difference between capital gains and dividends?
Capital gains are profits from selling an investment for more than you paid. Dividends are payments a company makes to shareholders from its earnings. Both are taxed, but dividends are taxed differently depending on whether they are may have access to or nonqualified, and the rules are separate from capital gains.
Do I report capital gains differently if I use a financial advisor?
No. You are responsible for reporting all capital gains on your tax return, regardless of who manages your investments. Your advisor may help you track the information, but you or your tax preparer must report it to the IRS on Schedule D.