How Long Do I Have To Wait To Buy A Stock After Selling It?

Disclaimer: I may earn commission if you click through some of these links. Much appreciated if you do :) (but only if you want to).
man in black pants and pair of brown leather lace-up shoes sitting on brown carpeted stairs inside room

Can’t wait to get back into the market after selling off your stock? You better watch yourself before making your next investment. You could be missing out on some tax benefits if you get back in the market too quickly.

So how long do you have to wait before you can buy a stock after selling it?

Here’s the short answer: Technically, you don’t have to wait any time at all if you want to buy the same stocks after selling previously owned stocks. However, if you had any capital losses from the sale and you want to lock in tax benefits, you have to wait 30 days after selling your stocks before buying the same or “substantially identical” stock again.

This doesn’t apply just to stocks by the way. It applies to securities in general (stocks, bonds, options)

Potential Scenarios

There’s a few possible situations you might be thinking about when asking the question posed in the title. Here’s a table that sorts out each scenario:

A. I sold my stock at a profit and want to buy it backYou can buy your stock back any time after you sold it. You just have to pay capital gains taxes because you “realized” your gains when you sold your stock.
B. I sold my stock at a profit and want to buy a different stockSame as scenario A.
C. I sold my stock at a loss and want to buy a different stockYou can buy this second stock any time after you sold your first stock. You will get your capital loss tax benefits.
D. I sold my stock at a loss and want to buy the same stock backIf you want to lock in capital loss tax benefits, you will have to wait 30 days until you can buy the same stock back. You can buy it back within 30 days, but you trigger something called a wash sale.

For the most part, the only time you would want to sell then buy back a stock is to take advantage of capital losses (scenario D). The rest of this post aims to address scenario D and clarify what’s going on behind the scenes when you want to lock in capital loss benefits of a stock, but want to keep that stock in your portfolio.

But before we do a deep dive into what’s happening behind the scenes here, first we have to understand two things: capital losses and wash sales.

Capital loss

In contrast to a capital gain in stock trading, which is profits from the sale of stocks that have increased in value, capital loss is when you sell your stocks at a loss. As long as the price you sold your stock is lower than the price you bought your stock, that counts as a capital loss.

When you earn a capital gain, your gains/profits are included in your taxable income, meaning you’ll need to pay taxes on it. Similarly, when you have a capital loss, you can deduct that amount from your taxable income and thereby pay less taxes. 

Capital gains and losses cancel each other out, so it’s the net value that matters in terms of how it affects your taxes. 

There are other details that go into how it works, but it’s enough to know that capital losses can reduce your taxable income. Now that we understand the tax benefits of having capital losses, we can look into wash sales.

Wash sale

In one sentence, a wash sale refers to when you sell your stocks at a loss, and then purchase them again within a 30-day time frame (from 30 days before to 30 days after) of the date you sold your stocks. 

The intent of a wash sale is to “wash” (reap the tax benefits of) the capital losses collected from your investment without entirely ridding yourself of the investment from your portfolio. You can think of it like giving your stocks a quick rinse to clean off the accumulated capital losses.

A wash sale is discouraged by the government because it brings tax benefits to you that bring little to no value to the economy. They don’t want people to sell their stocks and quickly buy them again, for the sole purpose of claiming a loss and reaping tax benefits. 

On your end, you also want to avoid executing a wash sale because the IRS has a wash sale rule (also called the 30-day rule) in place to stop you from locking in your capital losses.

The 30-day rule

The 30-day rule/wash-sale rule is an IRS regulation (Publication 550) to prevent people from getting quick and easy tax advantages through wash sales. The rule states that, if a wash sale happens, then that loss will be disallowed for tax purposes. 

Instead, that loss would be added to the cost basis (the original purchase price, for capital gains/loss tax calculation purposes) of the new stocks/replacement stocks. 

In addition, the holding period of the original stock gets added into the holding period of the replacement stock (e.g. if you held your original stock for a year, your new stock is now considered to have been owned for a year). This could be beneficial if it boosts your stock into the long-term capital gains category when it comes time to calculate your capital gains taxes.

For example, suppose you buy 100 shares of X stock for $10 per share ($1,000 of stock). One year later, the stock starts dropping, so you sell your 100 shares for $8 per share — a $200 loss. Three weeks later, X is trading at $6 per share and you decide that price is too good to pass up, so you repurchase the 100 shares for $600. This triggers a wash sale.

As a result, the $200 loss is disallowed as a deduction on your current-year tax return and added to the cost basis of the repurchased stock. That bumps the cost basis of your $600 of replacement stock up to $800, so if you later sell that stock for $1,000, your taxable gains will be $200 instead of $400. And because you previously held X for a year, it will automatically be treated as a long-term capital gain, even if you sell it after just a few months.

Basically, a wash sale just carries over the capital losses to your next investment (as it should be).

Wash sale “loopholes”

Here’s a few wash sale regulations that likely cover up any loopholes you might be thinking of:

1. Wash sales are not just limited to buying the exact same stock again within a 30-day time frame. It also includes stocks that are “substantially identical”. Unfortunately, the government has not provided a clear definition of what is“substantially identical.” You will have to use your best judgment. Odds are, if you are intending on buying something very similar to what you just sold off, it probably counts as “substantially identical”.

2. Wash-sale rules apply across all of your accounts. You can’t get away with selling a stock and just buying it back in another account. Don’t forget, your brokers have all the information they need to identify exactly who you are.

3. It also counts if you sell the security at a loss, and your spouse or a company they control buys a substantially similar security within 30 days.

4. Wash sales are not constrained to a calendar year. For example, if you sell at the end of the year and buy it early next year, it still counts as a wash sale as long as it’s within 30 days of the time you sold the stock.

5. According to Revenue Ruling 2008-5, executing a wash sale in an IRA will still trigger the wash sale rule.

Is a wash sale illegal?

A wash sale is not illegal. It’s just a rule put in place by the IRS to properly keep track of investor’s fair share of taxes. If you trigger a wash sale, you would just have to report the transaction on Form 8949.

When you trigger a wash sale, no one’s slapping you with any penalties or fines and you didn’t commit tax fraud or do anything illegal. IRS Publication 550 explains all the details and more if you’re feeling very paranoid.


While there are no rules stopping you from buying a stock back immediately from selling it, you should be aware of the wash sale rule. If you want to lock in your capital losses and reap the tax benefits, make sure to wait 30 days before buying back your stock. Otherwise the IRS is just going to add the capital losses to your next stock purchase. 

Long story short, you can’t cheat the tax system by quickly selling and buying back a stock. You have to execute your trades 30 days apart to lock in your capital losses.
If you want to learn more about how taxes affect your stocks, check out this article. If you want to learn more about trading stocks in general, check out this article.

Jenny Wang

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.

Leave a Comment