Many companies featured on Money advertise with us. Opinions are our own, but compensation and
in-depth research may determine where and how companies appear. Learn more about how we make money.

Money is not a client of any investment adviser featured on this page. The information provided on this page is for educational purposes only and is not intended as investment advice. Money does not offer advisory services.

Guide explorer in head of uncle Sam
Kiersten Essenpreis for Money

The stock-market has been on a tear, hitting a string of record highs. One downside: Millions of investors who realized big gains trading stocks (or bonds or even bitcoins) may soon owe Uncle Sam a hefty tax bill.

While investments aren’t always taxed as heavily as income, depending on where you live, how much you earn, and how long you hold the investment, you may be on the hook for 30% or more of your profits.

Plenty of investors seem to not fully understand the nuances. The IRS has recently taken several steps to make sure traders of Bitcoin and other cryptocurrencies pay what they owe. And many observers have warned that novices, drawn to rapid-fire trading platforms like Robinhood, may be in for unpleasant surprises when they file their 2020 tax return.

While you can’t avoid taxes, anyone who trades stocks, bonds or any other type of investment needs to know the basics of how they work:

How are stock trades taxed?

Profits you earn from trading stocks are taxed by the federal government and, depending on where you live, also by your state.

Trading profits are considered capital gains, as opposed to income. That means they may be taxed a lower rate than your salary, if you held the stocks (or other assets, like bonds or cryptocurrency) for more than a year. This is also true of qualified dividends.

On the other hand, short-term trading profits (on assets held less than one year) are taxed like income.

While capital gains on most financial assets are taxed alike, it’s worth noting that gold and other metals are considered “collectibles,” with long-term gains taxed at a top rate of 28%. The rate typically applies even if you hold them through an investment vehicles like an ETF.

What is the top tax rate for stock trades?

Most investors will pay 15% to 20% on long-term capital gains and qualified dividends. See the table below.

Capital Gains Tax Brackets for 2021
The rate you pay on long-term capital gains depends on your taxable income.
Rate Single filers Couples filing jointly Heads of household
0% Income below $40,400 Below $80,800 Below $54,100
15% $40,401 to $445,850 $80,801 to $501,600 $54,101 ro $473,750
20% $445,851 and up $501,601 and up $473,751 and up
Source: Internal Revenue Source/Tax Foundation

However, high earners could pay slightly more. That’s because single filers earning more than $200,000 (or couples earning $250,000) also owe an additional 3.8% tax Net Investment Income Tax on so-called investment income, that includes short- and long-term capital gains and dividends (as well as other interest and rental income.)

The NIIT was passed in 2010 to help pay for the Affordable Care Act, according to Mark Luscombe, principal analyst at Wolters Kluwer Tax & Accounting. “There are unfortunately many somewhat redundant provisions” in the tax code, he says.

The upshot: For the highest earners, the top rate federal tax rate on long-term capital gains is actually 23.8%.

Do states tax stock trades?

In addition to Uncle Sam, some individual states also tax trading profits. What’s more, unlike the Feds, states typically don’t offer special, lower rates for long-term capital gains or qualified dividends. “Most states that tax capital gains, tax them the same as regular income,” says Erica York, an economist at the Tax Foundation, a think tank.

The upshot is wildly different tax treatment depending on where you live: For taxpayers earning more than $1 million, California taxes both short- and long-term capital gains at to 13.3% on top of the federal rate (although some state taxes are federally deductible.) By contrast, a similar investor living in Florida would pay nothing, since Florida has no income tax.

You can find a full list of state income tax rates and whether or not those states tax capital gains and dividends in tables 13 and 14 of the Tax Foundation’s 2021 State Business Tax Climate Index report.

When do I owe taxes on my stock trading profits?

If you earn a salary, chances are your employer withholds part of your pay every two weeks to cover the taxes you owe throughout the year. With investment income, this typically isn’t the case. That means you need to pay estimated taxes to the IRS (and perhaps to your state) each quarter, not wait until you file your taxes in April.

If you fail to make those quarterly payments, you could owe a penalty based on how much you ended up underpaying and for how long.

What forms do I need to pay taxes on my stock trades?

As tax time approaches, your brokerage (the company through which you buy and sell shares of stocks or mutual funds) should send you one or more versions of Form 1099, which you report to the IRS when you file your taxes. Form 1099-B lists capital gains and losses, while Form 1099-DIV has dividends. There are also plenty of others.

You or your accountant typically must then attach the Form 1099-B to your 1040 by filling out Schedule D (along with Form 8949, if required.) Qualified dividends listed on Form 1099-Div can usually be reported directly on your 1040.

Can I owe taxes even if I don’t trade?

Investors can owe taxes on capital gains and dividends, even if they never sell their shares. When a stock pays a dividend (or a mutual fund passes one along), the IRS considers it taxable income even if it is automatically re-invested.

For investors who own mutual funds, the same can be true of capital gains. While you may not buy or sell mutual fund shares during the year, chances are your mutual fund has been trading stocks. Fund are required to “pass out” these capital gains each year, and investors owe capital gains taxes on them, even if these payouts are automatically re-invested in the fund. (Don't worry about keeping track of your funds's trading profits. If your fund does register capital gains, you should get a 1099 from the fund company ahead of tax time.)

One piece of good news: Any capital gains distribution you receive and re-invest should increase the “cost basis” of your fund investment. The “cost basis” is essentially the price at which you bought in, in the eyes of the IRS. So whatever gains you are obliged to report now, should lower the size of your gains in the future when you do decide to sell your fund shares.

What is tax-loss harvesting?

If you frequently trade stocks, chances are you will end up with some winners and some losers. The good news is the IRS only taxes you on your net trading profits for the year. That means any stock or mutual fund you sell at a loss can be used to offset your gains for tax purposes. (These losses can also be carried forward to offset gains in future years.)

Can you eliminate capital gains by selling a losing investment to register the loss for tax purposes, then buying it back? As it happens, the IRS permits this stratagem — up to a point. Investors who sell a losing investment are not permitted to repurchase it, or one that is “substantially identical,” (and still count the loss for tax purposes) for a period of 30 days.

However, waiting 31 days to buy back the same security — or replacing a losing investment with one that similar but not identical within less than 30 days — is a common investment strategy known as tax loss harvesting and regarded as perfectly legitimate.

What is similar but not identical? The IRS hasn’t been crystal clear, says Luscombe. But he says most tax pros would regard replacing, say, an individual FAANG stock (Facebook, Amazon, Apple, Netflix or Google) with a tech industry ETF as a safe move.

More from Money:

Robinhood for Beginners: A Complete Guide to Investing With the Controversial Stocks App

5 Ways the Stock Market Looks Just Like the 1999 Dot-Com Bubble

How to Invest in Bitcoin Alongside Stocks and Bonds