Can I Sell a Stock and Buy It Back the Same Day?

Yes, you can sell a stock and buy it back the same day. It happens millions of times a day on U.S. exchanges and is perfectly legal. What matters is which rules apply to your situation: the IRS wash sale rule if you sold at a loss, FINRA’s pattern day trader rule if you do this often in a margin account, and cash account settlement rules if you’re not trading on margin. Which ones bite depends on your account type, how often you trade, and whether the sale produced a gain or a loss.

If You Sold at a Loss, the Wash Sale Rule Kicks In

This is where most people get tripped up. Under 26 U.S.C. ยง 1091, the IRS disallows a loss deduction whenever you buy a “substantially identical” security within 30 days before or after the sale.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities A same-day repurchase sits right in the middle of that 61-day window, so the loss is disallowed.

The loss isn’t lost forever. It gets added to the cost basis of the replacement shares.2eCFR. 26 CFR 1.1091-1 – Losses From Wash Sales of Stock or Securities If you sell 100 shares for a $500 loss and buy them back an hour later at roughly the same price, you can’t claim that $500 this year. Instead, the $500 is tacked onto the basis of the new shares, so a later non-wash-sale transaction produces either a smaller gain or a larger deductible loss. The tax benefit is deferred, not destroyed.

If you sold at a gain, the wash sale rule doesn’t apply. It only governs losses.

What Counts as Substantially Identical

The statute uses the phrase “substantially identical stock or securities” but doesn’t define it, and the IRS has kept the standard deliberately vague. IRS Publication 550 points to “all the facts and circumstances.” A few things are clear enough: shares of the same company are substantially identical to each other, while shares of two different companies generally are not. Preferred stock and bonds of a company are ordinarily not considered substantially identical to that company’s common stock.

The gray zone involves funds and options. Two S&P 500 index funds from different providers look dangerously similar even with different tickers, and the IRS hasn’t issued a definitive ruling on that scenario. Contracts and options to buy or sell a stock are explicitly covered by the statute, so buying a call option on the same stock you just sold at a loss can trigger a wash sale.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities The safest route around a wash sale is switching to a genuinely different sector or asset class during the 61-day window.

The IRA Trap

This one hurts people who don’t see it coming. If you sell a stock at a loss in your taxable brokerage account and buy the same stock within 30 days inside an IRA or Roth IRA, the wash sale rule still applies and the loss in your taxable account is disallowed.3Internal Revenue Service. Revenue Ruling 2008-5 – Loss From Wash Sales of Stock or Securities The critical difference: your basis in the IRA shares is not increased to preserve the loss. The loss simply vanishes. IRAs don’t track cost basis the way taxable accounts do, so there’s no mechanism to recover it later. Revenue Ruling 2008-5 makes this explicit, and it covers both traditional and Roth IRAs.

Your broker may not catch this. Brokers are only required to report wash sales on Form 1099-B when both transactions occur in the same account.1Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities Wash sales that span a taxable account and an IRA, or two different brokerages, are yours to identify and report.

If You Sold at a Gain, Expect Short-Term Rates

Every profitable same-day round trip is a short-term capital gain, because you held the stock less than a year. Short-term gains are taxed at ordinary income rates, which run from 10% to 37% for 2025 depending on your taxable income and filing status. That’s noticeably higher than the 0%, 15%, or 20% long-term rate on stocks held more than a year.

Taxes aren’t withheld from brokerage gains the way they are from a paycheck, so active traders who stack up profitable trades can land in a higher bracket than they expected. If day trading is a meaningful income source, quarterly estimated tax payments help you avoid underpayment penalties.

Pattern Day Trader Rules in a Margin Account

FINRA defines a pattern day trader as anyone who executes four or more day trades within five business days in a margin account, where those day trades make up more than six percent of total trading activity in that account during the same window.4FINRA. Day Trading A day trade means buying and selling the same security on the same day. Once your brokerage flags you, you have to keep at least $25,000 in equity in that margin account on every day you place a day trade.5FINRA.org. FINRA Rule 4210 – Margin Requirements That equity can be cash and eligible securities combined, but it has to be there before the market opens on a day you plan to day trade.

Fall below the threshold or exceed your day-trading buying power and the brokerage issues a margin call. You get at most five business days to deposit enough funds or securities to cover the shortfall.6SEC.gov. Margin Rules for Day Trading Miss that deadline and the account is restricted to cash-available-only trading for 90 days or until the call is satisfied.4FINRA. Day Trading

If you don’t want the pattern day trader label, you can do up to three day trades in any rolling five-business-day period. Many brokerage platforms show a day-trade counter. Hit four in five days with those trades over six percent of your margin account activity and the designation sticks.

Cash Account Settlement Traps

A cash account sidesteps the $25,000 pattern day trader requirement, but it comes with a different problem: settlement timing. Under SEC Rule 15c6-1, stock trades settle on a T+1 basis, so the cash from a sale doesn’t officially land in your account until one business day after the trade.7SEC.gov. Shortening the Securities Transaction Settlement Cycle Trying to trade faster than your cash settles can produce two kinds of violations.

A good faith violation happens when you use unsettled proceeds from one sale to buy a new security, then sell that new security before the original proceeds have settled. Say you sell Stock A on Monday morning, use the unsettled proceeds to buy Stock B that afternoon, then sell Stock B before Tuesday’s close. Brokerages typically allow two of these in a 12-month period. A third within 12 months generally triggers a 90-day restriction requiring settled cash before any buy order.

A freeriding violation is more serious. Under Federal Reserve Regulation T, freeriding occurs when you buy a security in a cash account without having the funds to pay for it, then sell that security to generate the cash to cover the original purchase.8eCFR. 12 CFR 220.8 – Cash Account A single freeriding violation triggers an immediate 90-day account restriction, during which you can only buy securities with settled cash already in the account. This is a regulatory requirement, not a brokerage policy, so there’s no appeal.

Mark-to-Market Election for Active Traders

Traders who qualify as running a securities trading business can make an election under Section 475(f) that changes the picture. With a valid mark-to-market election, wash sale rules no longer apply to your trading activity.9Internal Revenue Service. Topic No. 429 – Traders in Securities Gains and losses become ordinary income or ordinary losses, and you mark every open position to fair market value on the last business day of the year as if you had sold it.10United States Code. 26 USC 475 – Mark to Market Accounting Method for Dealers in Securities You can sell and rebuy the same stock at a loss as often as you want without wash sale complications, and losses are fully deductible against ordinary income with no $3,000 annual cap.

Qualifying is the hard part. The IRS requires that you seek to profit from daily price movements rather than dividends or long-term appreciation, that your trading activity is substantial in both frequency and dollar volume, and that you pursue it with continuity and regularity.9Internal Revenue Service. Topic No. 429 – Traders in Securities Occasional day trading alongside a full-time job almost certainly doesn’t clear the bar.

Timing matters too. The written election statement must be filed with your tax return for the year before the election takes effect. To use mark-to-market for the 2026 tax year, the statement had to be attached to your 2025 return or extension request by April 15, 2026. Once made, the election applies to that year and all future years unless the IRS consents to revoke it.10United States Code. 26 USC 475 – Mark to Market Accounting Method for Dealers in Securities Miss the deadline and wash sale rules apply for the full year.