Tax-loss harvesting is the practice of deliberately selling an investment at a loss to offset capital gains elsewhere in your portfolio — and, once gains are fully offset, up to $3,000 of ordinary income per year. It's one of the few tax strategies that turns a market downturn into a genuine, quantifiable tax benefit, and it's available to any investor with a taxable brokerage account (it doesn't work in tax-advantaged accounts like 401(k)s or IRAs, since gains and losses inside those accounts aren't reported to the IRS).
This guide covers exactly how tax-loss harvesting works, the $3,000 annual ordinary-income offset limit, the unlimited capital-loss carryforward rule, the 30-day wash-sale rule that can disallow your loss if you're not careful, the short-term-vs-long-term loss ordering rules, and a full worked numeric example showing the mechanics end to end.
Tax-loss harvesting follows a specific netting order defined by the IRS on Schedule D of Form 1040:
Because long-term capital gains are typically taxed at lower rates (0%/15%/20%) than short-term gains (taxed as ordinary income up to 37%), the type of loss you harvest matters: a short-term loss offsetting a short-term gain saves you more per dollar than the same loss offsetting a long-term gain, since it displaces income that would otherwise be taxed at your higher marginal rate.
Per IRS Topic No. 409, once your capital losses have fully offset all your capital gains for the year, you can deduct the lesser of $3,000 ($1,500 if married filing separately) or your total remaining net capital loss against ordinary income like wages and interest. This limit has been fixed by statute at $3,000 since 1978 and is not adjusted for inflation.
Any loss beyond that $3,000 annual cap doesn't disappear — it carries forward indefinitely to future tax years, where it can offset future capital gains (dollar for dollar, with no annual cap on gain offsets) and, again, up to $3,000 per year against ordinary income until fully used up.
An investor in 2026 has: a $12,000 long-term gain from selling one stock, a $9,000 long-term loss from tax-loss harvesting a different position, and a $4,000 short-term loss from a third position held less than a year.
| Step | Calculation | Result |
|---|---|---|
| Net long-term (gain − loss) | $12,000 − $9,000 | +$3,000 net long-term gain |
| Net short-term | No short-term gains to offset | −$4,000 net short-term loss |
| Combine both categories | $3,000 − $4,000 | −$1,000 total net capital loss |
| Deduct against ordinary income | Full $1,000 is under the $3,000 cap | $1,000 deducted from wages/other income |
| Carryforward to 2027 | Nothing left to carry forward | $0 |
In this example, the investor completely eliminated tax on their $12,000 long-term gain (which otherwise would have been taxed at 15% or 20%) and additionally reduced their ordinary taxable income by $1,000 — all from proactively harvesting a $9,000 loss and a $4,000 loss before year-end.
The wash-sale rule, under IRC §1091 and detailed in IRS Publication 550, prevents you from claiming a tax loss if you buy "substantially identical" stock or securities within a 61-day window: 30 days before the sale through 30 days after the sale. This applies whether you buy the replacement shares outright, acquire them in a fully taxable trade, acquire an option or contract to buy them, or buy them inside an IRA or Roth IRA.
If your loss is disallowed under the wash-sale rule, it isn't permanently lost — per IRS Publication 550, you add the disallowed loss to the cost basis of the new (replacement) shares, and the replacement shares inherit the holding period of the original shares. This defers the loss until you eventually sell the replacement shares, rather than eliminating it.
You buy 100 shares of Stock X for $1,000. You sell those shares for $750 (a $250 loss) and, within 30 days of the sale, buy 100 shares of the same stock again for $800. Because you repurchased substantially identical stock inside the 30-day window, you cannot deduct the $250 loss on your 2026 return. Instead, the $250 disallowed loss is added to your new stock's $800 cost, giving you a basis of $1,050 in the replacement shares — the loss is preserved, just deferred until you eventually sell those shares.
The wash-sale rule applies to stocks and securities (including options and futures contracts on them) but does not apply to commodity futures contracts, foreign currencies, or — as of 2026 — cryptocurrency, which the IRS classifies as property rather than a security. Congress has periodically proposed extending wash-sale treatment to crypto, so this carve-out could change in future tax years.
When you carry a capital loss forward to a future year, it retains its original character: a long-term loss stays long-term, and a short-term loss stays short-term. Per IRS Publication 550, a long-term capital loss carried forward reduces the following year's long-term capital gains before it reduces that year's short-term capital gains, and vice versa for short-term carryforward losses.
Additionally, when you're figuring how much of your loss counts against the $3,000 annual limit, the IRS requires you to use your short-term capital losses first, even if you incurred them after a long-term loss during the same year. If you haven't reached the $3,000 limit after applying short-term losses, you then apply long-term losses until you hit the cap.
A few things to keep in mind when harvesting losses in a taxable account: settlement dates, not just trade dates, can matter for precise wash-sale timing, so leave a buffer around the 30-day window rather than trading right at the edge. ETFs tracking similar (but not identical) indexes — for example, selling one S&P 500 ETF at a loss and buying a different provider's S&P 500 ETF — are generally not considered "substantially identical" under current IRS guidance, giving investors a way to maintain market exposure while banking the loss, though this remains a facts-and-circumstances test rather than a bright-line safe harbor.
Also remember that tax-loss harvesting only applies to taxable brokerage accounts — losses inside a 401(k), traditional IRA, or Roth IRA are not reported to the IRS and cannot be harvested for a tax benefit, since gains and losses inside those accounts aren't taxed as they occur in the first place.
CountryTaxCalc.com is reader-supported. When you use our partner links, we may earn a commission at no cost to you. This helps us provide free tax calculators and comparison tools. Learn more about our affiliate partnerships
★ 4.3 Trustpilot · 287,413 reviews
Send money internationally at the real mid-market rate. Free to open. 14.8M customers worldwide. 4.3★ / 287,000+ Trustpilot reviews.
⚠ For currency exchange only — not a bank account replacement.
Send Money Internationally →★ 4.8 Trustpilot · 1,625 reviews
Moving abroad from the US? Greenback's CPAs specialise in FEIE, foreign tax credits and FBAR. Dedicated CPA, flat fee from $565, no surprises. 71,000+ expat returns filed. 4.8★ / 1,625 Trustpilot reviews.
⚠ Not the cheapest option — best for complex situations and expats who want a dedicated CPA.
Get Expert US Expat Tax Help →Interested in reaching this audience? Advertise on CountryTaxCalc →