Do I Have To Pay Tax On Stocks If I Sell And Reinvest?

Disclaimer: I may earn commission if you click through some of these links. Much appreciated if you do :) (but only if you want to).
person using smartphone and MacBook Pro

Stocks are a great way to invest your money. At an average rate of return of 12% per year, it’s no wonder so many people have taken an interest in trading stocks. 

But if there’s one thing to watch out for when it comes to stock investing, it’s taxes. At tax rates ranging from 0-37%, you need to make sure you’re making smart choices when buying and selling your stocks.

That leads us to your question: do you have to pay tax on stocks if you sell and reinvest?

Short answer: Yes you do. Unless you’re doing the selling and reinvesting in a tax-deferred retirement plan like a 401(k) or IRA.

Capital gains taxes

black and silver pen on white paper

First, let me briefly explain how stocks affect your taxes. The core concept here is capital gains taxes.

Capital gains are profits from the sale of capital assets. These “assets” include things like a business (for tech startup millionaires), piece of land (for colonialists, lords, and vassals), or a work of art (for billionaire art collectors). In our case, we are concerned with stocks.

Capital gains are generally included as a part of your taxable income if they are short-term gains (sold within a year of buying). However, long-term capital gains (sold after a year of buying) are taxed at a lower rate than your usual income tax.

Capital gains aren’t realized until the investment is sold. This means you don’t pay taxes until you lock in (realize) your gains by selling your investments.

You can think about the capital gains calculation like this: Capital gain = selling price – purchase price

For example, let’s say you bought 10 shares of stocks at $10 per share for a total of $100 in 2010. 5 years later in 2015, the stock price rose to $15 dollars per share leading to your total portfolio value to rise to $150. If you then sold all 10 stocks at this point, your capital gains for the year of 2015 would be $50 ($150 – $100 = $50).

What reinvesting has to do with capital gains taxes

The IRS has lots of provisions that let people reinvest proceeds from sales of property without capital gains taxes. However, these provisions don’t apply to taxable, non-retirement stock accounts

For some investments, you can reinvest and avoid capital gains, such as selling and reinvesting in real estate (1031 like-kind exchanges) or switching life insurance policies (1035 exchanges). But there are no provisions for regular taxable stock accounts.

Sorry to crush your hopes of hiding your hard-earned money from the government, but whenever you sell stocks that have turned a profit, you have to pay capital gains taxes. This is assuming you’re talking about stocks in an individual investment account, not a tax-deferred retirement plan.

How much tax you will have to pay on capital gains

How much tax you owe depends on two things: 1. How long you held your stocks and 2. Your income tax bracket. These rates were set by the The Tax Cuts and Jobs Act (TCJA) back in 2017.

If you owned the stock for a year or less, you pay short-term capital gains tax at your ordinary income tax rate. If you’ve held onto the stock for a year or more, the lower long-term capital gains rates apply. 

In almost all cases, the tax rates of long-term capital gains will be lower than the tax rate of short-term capital gains. This is why it’s preferred to play the long game when it comes to stocks.

The rates also depend on your income tax bracket. The higher your income is, the higher tax rate you get. 

In 2020, this could range from 10-37% for short-term capital gains and either 0%, 15% or 20% for long-term capital gains. The rates are also influenced by how you are filing your taxes: single, married, head, or married filing separately. 

There’s also the Net Investment Income Tax (NIIT) of 3.8% which applies to people with a modified adjusted gross income above a certain threshold. If you’re nowhere near making a six figure salary, you don’t need to worry about this. If you don’t know what a modified adjusted gross income is, check out Investopedia’s article on that. It’s a little complicated, but it’s basically a special way of calculating your income. 

If you’re curious about specific numbers for specific income thresholds for a specific filing status, you can check out Investopedia’s article. Nerdwallet also has a calculator you can use to help figure this out if you’re really curious about your particular situation.

How to avoid capital gains tax

brown Scottish fold in brown thick-pile blanket

While you can’t get away from taxes by simply selling and reinvesting, there are a few ways you can reduce your capital gains taxes.

Hold the stocks for a year or more

Long term capital gains are almost always lower than short-term capital gains. Because of this, it’s often a smart move to choose your investments wisely and stick with them long term. 

I don’t recommend frequently tweaking your stock portfolio or jumping from one hot stock to the next in hopes of beating the market. No one’s smart enough to do that, not even the experts.

There’s also another benefit to playing the long game: dying. When you die, you can pass on your investments to your heirs who don’t have to pay capital gains on a lifetime of growth. It’s almost like passing on your portfolio over with a clean slate. Now that’s what I call an inheritance.

Retirement Accounts

I’ve mentioned this before, but I’ll say it again: you don’t have to pay capital gains tax on any stocks sold/reinvested in a retirement plan. The taxes are already taken care of either when you put the money in or when you will take the money out in your retirement.

This is why it’s usually recommended to invest first in retirement accounts before individual, taxable accounts. Those tax benefits mean more of your money stays in your pocket. That small boost goes a long way when you’re talking about decades of compounding growth.

Offset capital gains with capital losses. 

A capital loss is basically the opposite of a capital gain: the selling price of your stock is lower than when it started. If your capital losses exceed your capital gains, they can be used as a deduction on your tax return (up to $3,000 per year).

This is often used as a way to get out of losing positions without actually “losing” all that money. This “lost” money can be used to offset any capital gains you made, thereby lowering your capital gains taxes. Luckily for you, these losses can be carried over indefinitely into the future until the capital losses are exhausted.

If you want to get technical, this is called “tax-loss harvesting”. Some broker platforms have tools that can help you figure out which stocks you should sell to get the best value capital losses. Alternatively, some robo-advisors can help manage this for you automatically for a small management fee. 

Did you know that many charities take stock donations? The next time you’re thinking about donating some money to a school, church, hospital, or nonprofit, contact them to see if they accept stocks. 

This can be a way to “sell” your stock, but without having to pay capital gains taxes. At the same time, you also get to deduct the full market-value of the donation from your income taxes, just as you normally would with a cash donation.

If you do the math, your stock donation is actually worth 15-20% more than if you sold the stock and donated the cash instead. This is because the money that would have been lost to taxes is now going to the charity.

As a side note, don’t worry about the charity taking on any taxes. When charities sell the stock, they are not subject to capital gains taxes.

A couple things to note: try to only transfer stocks you’ve had for at least a year. Only long-term stocks can have their full fair market value (today’s current price) deducted. Short term stocks can only have their cost basis deducted (their original buying price).

Only do this for stocks with capital gains and not for stocks with capital losses. It’s more advantageous to just sell your stocks with capital losses so you can write off the losses on your tax return.


If you want the short answer: yes you do pay taxes every time you sell a stock unless it’s in a tax-deferred retirement plan. Reinvesting your stocks does not let you get away from capital gains taxes like it does for other investment assets. 

I’m guessing if you happened to come across this article, you’re considering making some tweaks to your stock portfolio by selling off some stocks to buy others. If you want my personal advice, I would stay away from actively managing your stock portfolio. It’s unlikely your constant tweaking will lead to better returns.

I recommend buying and holding a low-cost, diversified index-fund that tries to match the market. If you’re just getting average results, that’s great! That’s already about a 10% average return on investment per year. It’s also a lot less stress and work on your part (and will probably give you better results).

If you want more advice on investing, check out some of these articles I’ve written about this:

Joe Wong

Sign up for my newsletter to get weekly money tips for ambitious youngsters. I'll also send you my 60 Minute Financial Planner and Excel Budgeting Spreadsheet to help set your finances straight right now.

Invalid email address
Unsubscribe anytime. I won't sell your email to Russian hackers (or anyone else) and I won't spam you.

1 thought on “Do I Have To Pay Tax On Stocks If I Sell And Reinvest?”

Leave a Comment