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
Capital gains tax is not charged while you hold a stock — only when you sell it and lock in a profit. The year you sell is the year you report the gain on your tax return. If you bought 100 shares at $50 each and sold them at $75 each, your gain is $2,500, and that $2,500 is what gets taxed in the year of the sale, not spread across the years you owned the stock.
The amount of tax you owe depends on how long you held the stock before selling. Stocks held for one year or less are taxed as short-term capital gains, which means they are taxed at your ordinary income tax rate — the same rate as your salary or wages. Stocks held for more than one year are taxed as long-term capital gains, which have lower tax rates set by the federal government. Most people pay less tax on long-term gains than on short-term gains.
Key Takeaways
- Capital gains tax is owed only in the year you sell the stock, not while you own it.
- Short-term gains (stocks held one year or less) are taxed at your regular income tax rate, which is higher than the long-term rate.
- Long-term gains (stocks held more than one year) are taxed at a lower federal rate, though the exact rate depends on your income level.
- You report capital gains on your tax return for the year of the sale, and your brokerage will send you a form showing what you sold and for how much.
How the holding period is measured
The holding period starts the day after you buy the stock and ends the day you sell it. If you bought a stock on March 15 and sold it on March 15 of the next year, you have held it for exactly one year, and it qualifies for long-term capital gains treatment. If you sold it on March 14 of the next year, it is short-term.
The date matters because the difference between short-term and long-term rates can be substantial. A short-term gain is taxed at your marginal income tax rate, which ranges from 10% to 37% depending on your income. A long-term gain is taxed at 0%, 15%, or 20% depending on your income — significantly lower for most people.
Short-term capital gains and your income tax bracket
When you sell a stock you have owned for one year or less, the profit is added to your other income for the year and taxed at your regular income tax rate. This means a short-term gain can push you into a higher tax bracket. If you earned $50,000 in salary and realized a $20,000 short-term capital gain, you are taxed on $70,000 of income for the year.
Your brokerage account will track your sales and send you a Form 1099-B by January 31 of the following year, showing the sale price and the date you sold. You use this form to calculate your gain and report it on your tax return. The IRS uses the same information to verify your report.
Long-term capital gains rates and income thresholds
Long-term capital gains are taxed at 0%, 15%, or 20%, depending on your taxable income for the year. The income thresholds change each year and vary by filing status — single, married filing jointly, head of household, and so on. For 2024, the 0% rate applies to single filers with taxable 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 thresholds are adjusted annually for inflation.
The thresholds are higher for married couples filing jointly and lower for married couples filing separately. Because the thresholds change yearly, you should check the current year's rates when you are planning a sale or preparing your return. The IRS publishes these rates each year in their tax guidance.
What happens if you sell at a loss
If you sell a stock for less than you paid for it, you have a capital loss. Capital losses can offset capital gains, reducing the amount of tax you owe. If you sold one stock at a $5,000 gain and another at a $3,000 loss in the same year, you report a net gain of $2,000 and pay tax only on that $2,000.
If your losses exceed your gains in a year, you can deduct up to $3,000 of the net loss against your other income. Any loss beyond $3,000 carries forward to future years and can be used to offset gains or income in those years. This is why many investors track their losses — they reduce your tax bill now or in the future.
How your brokerage reports your sales
Your brokerage sends you a Form 1099-B showing every stock you sold during the year, the sale price, and the date. The form also shows the cost basis — the price you paid — if the brokerage has that information. If you bought the stock through that same brokerage, they usually have your cost basis on file. If you transferred the stock from another account, you may need to provide the cost basis yourself.
You use the 1099-B to fill out Schedule D (Capital Gains and Losses) on your tax return. Schedule D separates short-term gains and losses from long-term gains and losses, calculates your net gain or loss in each category, and then combines them. The final number goes on your main tax return form.
Taxes on dividends versus capital gains
Dividends paid by a stock are taxed separately from capital gains. If a stock pays you a dividend while you own it, that dividend is taxed in the year you receive it, not when you sell the stock. may have access to dividends (paid by U.S. corporations and held for a certain period) are taxed at the same rates as long-term capital gains. Non-may have access to dividends are taxed at your ordinary income tax rate.
This means you can owe tax on a stock even if you have not sold it yet — if it paid dividends during the year. Capital gains tax, by contrast, is owed only when you sell and realize the gain.
Frequently Asked Questions
Do I owe capital gains tax if I have not sold the stock yet?
No. Capital gains tax is owed only when you sell. If the stock has gone up in value but you still own it, you owe nothing. You may owe tax on dividends the stock paid, but not on the unrealized gain.
What if I bought the stock years ago and forgot what I paid for it?
Your brokerage has records if you bought it through them. Contact them and ask for your cost basis. If you bought it through a different brokerage that no longer exists, you may need to search old statements or tax returns. If you cannot find the cost basis, the IRS may allow you to use the stock's value on a specific date, but you should consult a tax professional in this situation.
Can I avoid capital gains tax by holding the stock longer?
Holding longer changes the tax rate but does not eliminate the tax. Once you hold for more than one year, you may have access to for the lower long-term rate instead of the short-term rate. But you still owe tax when you sell. The only way to avoid the tax is to not sell, or to donate the stock to a charity, which may have different tax treatment.
If I sell at a loss, can I buy the same stock back right away?
You can buy it back, but the IRS has a wash sale rule that prevents you from deducting the loss if you buy the same or a substantially identical stock within 30 days before or after the sale. If you sell at a loss and buy back within that window, the loss is disallowed and added to the cost basis of the new shares instead.
Do I report capital gains differently if I use a robo-advisor or mutual fund?
Mutual funds and robo-advisors handle the sales internally and send you a Form 1099 showing your share of the gains and losses. You report these the same way as individual stock sales. If the fund or advisor sells stocks within the account, you owe tax on your share of those gains in the year of the sale, even if you did not sell your shares in the fund itself.
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.