If I sell a stock 10 days after I bought it but some shares are a loss and some are a gain, can I claim the loss?

Checked on February 7, 2026
Disclaimer: Factually can make mistakes. Please verify important information or breaking news. Learn more.

Executive summary

When an investor sells different lots of the same stock within 10 days of purchase—some at a gain and some at a loss—the losses on lots actually sold at a loss are generally usable to offset gains, subject to normal capital gains netting rules and the IRS wash-sale restriction; the key risk is triggering a wash sale by repurchasing the same or “substantially identical” security within 30 days before or after the loss sale, which would disallow the immediate deduction [1] [2]. Short‑term treatment, carryforwards and basis adjustments shape the ultimate tax outcome [1] [3].

1. How gains and losses from different lots interact under IRS rules

When different purchase lots are sold in the same year, each lot’s gain or loss is realized separately and then aggregated under the IRS netting rules: short‑term gains and losses are netted against short‑term gains and losses first, long‑term against long‑term, and then the two nets are combined to produce the year’s capital gain or loss [1] [4]. If total losses exceed total gains, up to $3,000 of the excess loss can offset ordinary income in a tax year and any remaining loss can be carried forward to future years [1] [3].

2. The wash‑sale rule: the 61‑day window that can nullify a loss

The wash‑sale rule prevents claiming a loss if the taxpayer buys the same or a “substantially identical” security within the 61‑day window that runs 30 days before and 30 days after the loss sale (effectively a 30‑day wait to be safe) — repurchasing within that window disallows the deduction for current tax purposes [5] [2]. Brokerages and tax guidance emphasize that this includes purchases by the taxpayer’s spouse and certain transactions into retirement accounts, so seemingly innocuous trades can still trigger the rule [6] [3].

3. Practical plumbing: what happens if a wash sale is triggered

If a wash sale is triggered, the immediate loss deduction is disallowed but the disallowed loss is generally added to the cost basis of the replacement shares, deferring the tax benefit until those replacement shares are sold [3] [6]. That mechanism prevents “locking in” a tax loss while keeping an effectively identical market position; it’s why advisers warn about repurchasing too quickly if the goal is a current‑year tax deduction [4] [7].

4. Short‑term sales, holding periods and tax rates matter

Selling only 10 days after purchase makes any realized gain or loss short‑term, which is taxed as ordinary income when it’s a gain and offset against other short‑term gains when it’s a loss — a mix of short‑term gains and losses in the same year follows the standard ordering and netting rules described by the IRS [1] [8]. That means a short‑term loss can be especially valuable if it offsets short‑term gains taxed at higher ordinary rates, but the wash‑sale rule still governs whether the loss can be claimed now [4] [7].

5. Edge cases and precautions: multiple accounts, spouse, and retirement accounts

The wash‑sale rule covers more than obvious repurchases: buys in another taxable account, purchases by a spouse, and even repurchases inside an IRA can disqualify the loss, so the timing and the account used matter [6] [3]. Brokerage tools and tax‑loss harvesting services can track lots and wash‑sale exposure, but investors should document cost basis and holding periods carefully because the disallowed loss must be tracked and applied to the basis of replacement shares [2] [3].

Bottom line

Losses on the specific shares sold at a loss can be claimed against gains—subject to standard netting and the $3,000 ordinary income limit—with the crucial caveat that any repurchase of the same or substantially identical security within 30 days before or after the loss sale will disallow the deduction for now and instead adjust the basis of the replacement shares under the wash‑sale rules [1] [2] [3]. If uncertain about lot selection, settlement timing, or cross‑account activity, consult the IRS guidance and consider a tax professional because brokerage lot accounting and wash‑sale tracking can be technical and consequential [1] [2].

Want to dive deeper?
How does the wash‑sale rule treat purchases made in an IRA or other retirement account?
What is the step‑by‑step method to identify which specific lot’s basis and holding period apply when selling partial shares?
How do wash‑sale rules apply to ETFs and mutual funds that track the same index—are they 'substantially identical'?