Taxes on Stocks: What You Have to Pay and How to Pay Less

Learn how dividends and capital gains can affect your tax bill, and how you can reduce what you pay.
Tina Orem
Sabrina Parys
By Sabrina Parys and  Tina Orem 
Edited by Sheri Gordon Reviewed by Lei Han

Many or all of the products featured here are from our partners who compensate us. This influences which products we write about and where and how the product appears on a page. However, this does not influence our evaluations. Our opinions are our own. Here is a list of our partners and here's how we make money.

Nerdy takeaways
  • Any profit you make from selling a stock is taxable at either 0%, 15% or 20% if you held the shares for more than a year.

  • If you held the shares for a year or less, you'll be taxed at your ordinary tax rate.

  • You may be able to reduce your taxes on stocks by holding investments in a tax-advantaged account, holding them for more than a year, and using losses to offset gains.


Investing in stocks can be a great way to build wealth and financial security, but it’s important to understand how taxes on stocks could affect your tax bill.

Do you pay capital gains tax on stocks?

If you sell stocks for a profit, you'll likely have to pay capital gains taxes. Generally, any profit you make on the sale of a stock is taxable at either 0%, 15% or 20% if you held the shares for more than a year, or at your ordinary tax rate if you held the shares for a year or less. Any dividends you receive from a stock are also usually taxable.

There are two types of capital gains taxes on realized stock gains:

Short-term capital gains tax

Short-term capital gains tax is a tax on profits from the sale of an asset held for a year or less. Short-term capital gains tax rates are the same as your income tax bracket. » MORE: Not sure what tax bracket you’re in? Learn about federal tax brackets.

Long-term capital gains tax

Long-term capital gains tax is a tax on profits from the sale of an asset held for longer than a year. Long-term capital gains tax rates are 0%, 15% or 20% depending on your taxable income and filing status.

Long-term capital gains tax rates are usually lower than those on short-term capital gains. That can mean paying lower taxes on stock sales.

Net investment income tax

Some high-income investors may also be subject to an additional 3.8% tax called the net investment income tax. The IRS imposes this tax on either your net investment income, or the amount by which your modified adjusted gross income exceeds a certain threshold (below), whichever one ends up being less.

The income thresholds for the net investment income tax are $250,000 for those married filing jointly, $125,000 for those married filing separately, and $200,000 for single filers and heads of household.

Internal Revenue Service. Topic No. 559 Net Investment Income Tax. Accessed Mar 14, 2023.

Tax Planning Made Easy
There's still time to get your taxes done right with Harness Tax.

How are dividends taxed?

For tax purposes, there are two kinds of dividends: qualified and nonqualified. Nonqualified dividends are sometimes called ordinary dividends. The tax rate on nonqualified dividends is the same as your regular income tax bracket. The tax rate on qualified dividends is 0%, 15% or 20%, depending on your taxable income and filing status. This is usually lower than the rate for nonqualified dividends.

  • In both cases, people in higher tax brackets pay more taxes on dividends.

  • How and when you own a dividend-paying investment can dramatically change the tax bill on the dividends.

  • There are many exceptions and unusual scenarios with special rules; see IRS Publication 550 for the details.

  • Federal: $50.95 to $94.95. Free version available for simple tax returns only.

  • State: $39.95 to $54.95.

  • Xpert Assist add-on provides access to tax pro and final review.

Promotion: NerdWallet users get 25% off federal and state filing costs.

  • Federal: $55 to $115. Free version available for simple tax returns only.

  • State: $0 to $49 per state.

  • Online Assist add-on gets you on-demand tax help.

  • Federal: $69 to $129. Free version available for simple returns only; not all taxpayers qualify.

  • State: $0 to $59 per state.

  • Live Assisted gets you access to a tax pro and a final review.

Promotion: NerdWallet users can save up to $15 on TurboTax.

  • Federal: $34.95 to $64.95 Free version available for simple tax returns only.

  • State: $0 to $39.95 per state.

  • On-demand tax help at Premium and Self-Employed tiers.

Promotion: NerdWallet users get 30% off federal filing costs. Use code NERD30.

How to pay lower taxes on stocks

Think long term versus short term

  • You might pay less tax on your dividends by holding the shares long enough for the dividends to count as qualified. Just be sure that doing so aligns with your other investment objectives.

  • Whenever possible, consider holding an asset for longer than a year, so you can qualify for the long-term capital gains tax rate when you sell. That tax rate is significantly lower than the short-term capital gains rate for most assets. But again, be sure that holding the investment for that long aligns with your investment goals.

Consider using investment capital losses to offset gains

The difference between your capital gains and your capital losses is called your “net capital gain.” If your losses exceed your gains, however, that's called a "net capital loss," and you can use it to offset your ordinary income by up to $3,000 ($1,500 for those married filing separately).

That's helpful in years when the stock market is down or volatile. Any additional losses can be carried forward to future years to offset capital gains or up to $3,000 of ordinary income per year.

Hold the shares inside an IRA, 401(k) or other tax-advantaged account

  • Dividends and capital gains on stock held inside a traditional IRA are tax-deferred, and tax-free if you have a Roth IRA; dividends and capital gains on stocks in a regular brokerage account typically aren’t.

  • Once money is in your 401(k), and as long as the money remains in the account, you pay no taxes on investment growth, interest, dividends or investment gains.

  • You can convert a traditional IRA into a Roth IRA so that withdrawals in retirement are tax-free. But note, only post-tax dollars get to go into Roth IRAs. So if you deducted traditional IRA contributions on your taxes and then decide to convert this to a Roth, you’ll need to pay taxes on the money you contributed, just like everyone else who invests in a Roth IRA. A backdoor Roth IRA allows individuals with high incomes to enjoy the benefit of a Roth IRA despite the IRS income limit.

  • If you invest with a robo-advisor, many offer free tax-loss harvesting, which involves selling losing investments to offset the taxes resulting from a capital gain.

Call in a pro

Your situation may be more complicated, so consider talking to a qualified tax preparer to help you make the right moves.

Frequently asked questions

Taxes on stocks, like capital gains tax and dividend tax, apply to the tax year during which a stock sale or dividend payment is made, and they are reported on your tax return the following year. So if you received dividends from a stock and sold it for a gain in 2023, you'd generally have to pay dividend and capital gains tax when you file in April 2024.

People who aren't subject to income tax withholding are often required to make quarterly estimated tax payments. If you're in that group, your dividend and capital gains tax would be due on the quarterly due date following the dividend receipt and/or sale.

You incur capital gains tax when you sell an investment for a profit — so no sale means no capital gains tax. But you incur dividend tax whenever you receive a dividend payment from an investment, regardless of when you sell it.

Got investment goals?
Track your net worth and use our Nerdy tools to learn about how to save more for retirement.
Get more smart money moves – straight to your inbox
Sign up and we’ll send you Nerdy articles about the money topics that matter most to you along with other ways to help you get more from your money.