Skip to main content

When You Have to Pay Taxes on Stocks

Yes, you owe tax on stock gains, but the amount depends on how long you held the stock and how much you made

The IRS taxes the profit you make when you sell a stock — not the stock itself. If you buy 100 shares at $10 each and sell them at $15 each, you owe tax on the $500 gain. You do not owe tax simply for owning the stock, and you do not owe tax when the price goes up, only when you sell and lock in the profit.

The tax rate depends on two things: how long you held the stock before selling, and your total income for the year. Stocks held for less than a year are taxed as ordinary income — the same rate as your salary. Stocks held for a year or longer get a lower rate, called the long-term capital gains rate. That rate is 0%, 15%, or 20% depending on your income bracket, which is usually much better than the ordinary income rate.

You also owe tax on dividends — the cash payments some companies send to shareholders. may have access to dividends (from US companies and most foreign companies) are taxed at the same long-term rate as long-held stocks. Non-may have access to dividends are taxed as ordinary income.

Key Takeaways

  • You owe federal income tax on the profit when you sell a stock, not on the stock itself or on price increases before you sell.
  • Profits from stocks held less than a year are taxed at your ordinary income rate, which is usually higher than the capital gains rate.
  • Profits from stocks held a year or longer are taxed at the long-term capital gains rate: 0%, 15%, or 20% depending on your income.
  • Dividends from stocks are taxed either as ordinary income or at the long-term rate, depending on the type of dividend and how long you held the stock.
  • You report stock sales and dividends on your tax return, and your brokerage sends you a form (1099-B or 1099-DIV) listing what you owe tax on.

How short-term and long-term capital gains are taxed differently

The holding period matters because Congress taxes long-term gains at a lower rate to encourage people to hold stocks rather than trade them constantly. If you sell a stock within a year of buying it, the profit is a short-term capital gain and is taxed at your ordinary income tax rate — the same rate as your wages. For 2024, that ranges from 10% to 37% depending on your income bracket.

If you hold the stock for more than one year before selling, the profit is a long-term capital gain and is taxed at a preferential rate. That rate is 0%, 15%, or 20% depending on your income bracket, and it is almost always lower than your ordinary rate. A person in the 24% ordinary income bracket, for example, pays only 15% on long-term gains.

The one-year clock starts the day after you buy the stock. If you buy on January 15, 2024, you can sell on January 15, 2025, and may have access to for the long-term rate. If you sell on January 14, 2025, it is still short-term.

Losses and how they reduce your tax bill

If you sell a stock for less than you paid, you have a capital loss. You can use losses to offset gains — if you had $5,000 in gains and $2,000 in losses, you owe tax on only $3,000 of profit. This is called tax-loss harvesting, and it is one of the few ways to reduce your taxable income from investments.

If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against your ordinary income. Any loss beyond that carries forward to future years. So if you had $10,000 in losses and no gains, you could deduct $3,000 against your salary or other income this year, and carry the remaining $7,000 forward to use in future years.

There is one catch: the wash-sale rule. If you sell a stock at a loss and buy the same stock (or a substantially identical one) within 30 days before or after the sale, the IRS disallows the loss. The rule is meant to prevent people from selling for a tax break and immediately buying back in. If you want to harvest a loss, you must either wait 31 days to rebuy or switch to a similar but different stock in the meantime.

Dividends and how they are taxed

Many stocks pay dividends — regular cash payments to shareholders, usually quarterly. The tax treatment depends on the type of dividend. may have access to dividends from US corporations and most foreign corporations are taxed at the long-term capital gains rate (0%, 15%, or 20%). Non-may have access to dividends are taxed at your ordinary income rate.

To may have access to for the lower rate, you must have held the stock for at least 60 days during the 121-day period centered on the dividend payment date. For most stocks, this means holding for at least two months around the payment date. Your brokerage will tell you which dividends are may have access to and which are not on your tax forms.

Dividends from real estate investment trusts (REITs) and master limited partnerships (MLPs) are usually taxed as ordinary income, even if you held the stock for years. This is one reason REITs are often held in retirement accounts, where you do not owe tax on dividends until you withdraw the money.

What your brokerage reports and when you owe tax

Your brokerage tracks your stock sales and dividends and sends you a tax form by January 31 each year. For stock sales, you receive Form 1099-B, which lists each sale, the date you bought and sold, and the proceeds. For dividends, you receive Form 1099-DIV, which breaks down may have access to and non-may have access to dividends.

You report these on your tax return — usually Schedule D for capital gains and losses, and Schedule B or the main form for dividends. The IRS receives a copy of your forms, so your brokerage's numbers must match what you report. If they do not match, the IRS will contact you.

You owe tax on gains in the year you sell the stock, not the year you bought it. If you sell in December 2024, you owe tax on that gain in 2024, even if you do not receive the cash until January 2025. If you hold the stock into 2025 without selling, you owe no tax that year — only when you eventually sell.

Tax-advantaged accounts and when you avoid tax on stocks

Stocks held in a 401(k), IRA, or other retirement account are not taxed when you sell them or when they pay dividends. You can buy and sell as much as you want inside the account without owing any tax. Instead, you owe tax when you withdraw the money in retirement — and the tax depends on the account type.

In a traditional IRA or 401(k), withdrawals are taxed as ordinary income. In a Roth IRA or Roth 401(k), may have access to withdrawals are tax-free. This is why retirement accounts are useful for active traders or dividend-heavy portfolios — you can avoid the annual tax bill on gains and dividends while you are still working.

Stocks in a regular taxable brokerage account are always taxed on gains and dividends each year. This is why many investors use retirement accounts first, up to the annual limit, and then use taxable accounts for additional savings.

State and local taxes on stocks

Most states do not tax capital gains separately — they are taxed as ordinary income under your state income tax. A few states tax capital gains at a special rate: California, Hawaii, New Jersey, and Vermont have capital gains taxes ranging from 3.8% to 13.3% on top of federal tax. New York taxes long-term gains at the same rate as ordinary income.

If you live in a state with no income tax — Florida, Texas, Wyoming, and others — you owe no state tax on stock gains. If you move states, the state where you lived when you sold the stock is the one that taxes the gain, not the state you move to.

Local taxes on stocks are rare. A few cities tax investment income, but most do not. Check your state and local tax authority's website if you are unsure whether your location taxes capital gains.

Frequently Asked Questions

Do I owe tax if the stock price goes up but I have not sold?

No. You owe tax only when you sell and lock in the profit. Unrealized gains — profits on stocks you still own — are not taxed. You can hold a stock that has doubled in value and owe nothing until you sell it.

What if I sell a stock at a loss?

You can use the loss to offset gains from other stock sales. If you have no gains, you can deduct up to $3,000 of losses against your ordinary income. Any loss beyond that carries to future years. Be aware of the wash-sale rule: if you buy the same stock within 30 days of selling at a loss, the loss is disallowed.

How do I know if a dividend is may have access to or non-may have access to?

Your brokerage reports this on Form 1099-DIV. Generally, dividends from US corporations are may have access to if you held the stock for at least 60 days around the payment date. Dividends from REITs, preferred stocks, and some foreign companies are usually non-may have access to.

Can I avoid taxes by holding a stock forever?

Yes, as long as you do not sell. But when you die, your heirs inherit the stock at its value on the date of death, not your original purchase price. This is called a "step-up in basis" and erases the tax on your gains. However, this is an estate planning benefit, not a strategy for living investors.

Do I owe tax on stocks in a 401(k) or IRA?

No, not while the money is in the account. You can buy and sell stocks inside a retirement account without owing any annual tax. You owe tax when you withdraw the money, and the rate depends on the account type — ordinary income for traditional accounts, tax-free for may have access to Roth withdrawals.