Tax-loss harvesting means realizing an investment loss, then applying capital-gain and loss rules; it is not a way to make a loss disappear. A $4,000 realized capital loss can offset $4,000 of realized capital gains in a simple example, but a wash-sale rule can defer a stock loss when substantially identical securities are acquired within the relevant 61-day window.
What tax loss harvesting means
Tax-loss harvesting is the intentional realization of a capital loss to use under capital-gain and loss rules, subject to restrictions such as the wash-sale rule. A capital-gains calculation asks for a sale's gain or loss; tax-loss harvesting asks how that realized loss interacts with other transactions and tax rules.
| Realized gain | $7,000 |
|---|---|
| Realized loss | $4,000 |
| Simple net gain | $3,000 |
| Replacement purchase | 10 days later |
| Wash-sale window | 30 days before/after |
Tax-loss harvesting: what loss can and cannot offset: worked example
An account realizes a $7,000 gain in one sale and a $4,000 loss in another. Before other transactions and rules, the net capital gain is $3,000. If instead the loss sale is followed by an acquisition of substantially identical stock 10 days later, the IRS wash-sale rule can disallow the current loss and add it to the replacement shares' basis. The economic loss and tax timing are not the same question.
How to calculate tax loss harvesting
List every sale, its lot, basis, proceeds, holding period, and any replacement purchase. Net gains and losses by their categories only after confirming reporting rules. Preserve transaction dates around a loss sale, because a replacement purchase can change the current deduction result.
Use the relevant inputs with these related Calculatort pages: capital-gains estimator · cost basis explained · investment return scenario.
Read the numbers before making a decision
Realized gain check 1. A realized-loss ledger needs both sides of the transaction: the disposal that created the loss and every potentially matching replacement purchase around it on pass 1 when it examines realized gain at $7,000, realized loss at $4,000, and simple net gain at $3,000. Identify the unit for realized gain in pass 1 before changing a number: dollars, shares, months, a percentage, or a tax category. In check 1, recording the changed realized gain makes the result traceable rather than a headline number.
Realized loss check 2. A realized-loss ledger needs both sides of the transaction: the disposal that created the loss and every potentially matching replacement purchase around it on pass 2 when it examines realized loss at $4,000, simple net gain at $3,000, and replacement purchase at 10 days later. Identify the unit for realized loss in pass 2 before changing a number: dollars, shares, months, a percentage, or a tax category. In check 2, recording the changed realized loss makes the result traceable rather than a headline number.
Simple net gain check 3. A realized-loss ledger needs both sides of the transaction: the disposal that created the loss and every potentially matching replacement purchase around it on pass 3 when it examines simple net gain at $3,000, replacement purchase at 10 days later, and wash-sale window at 30 days before/after. Identify the unit for simple net gain in pass 3 before changing a number: dollars, shares, months, a percentage, or a tax category. In check 3, recording the changed simple net gain makes the result traceable rather than a headline number.
Replacement purchase check 4. A realized-loss ledger needs both sides of the transaction: the disposal that created the loss and every potentially matching replacement purchase around it on pass 4 when it examines replacement purchase at 10 days later, wash-sale window at 30 days before/after, and realized gain at $7,000. Identify the unit for replacement purchase in pass 4 before changing a number: dollars, shares, months, a percentage, or a tax category. In check 4, recording the changed replacement purchase makes the result traceable rather than a headline number.
Wash-sale window check 5. A realized-loss ledger needs both sides of the transaction: the disposal that created the loss and every potentially matching replacement purchase around it on pass 5 when it examines wash-sale window at 30 days before/after, realized gain at $7,000, and realized loss at $4,000. Identify the unit for wash-sale window in pass 5 before changing a number: dollars, shares, months, a percentage, or a tax category. In check 5, recording the changed wash-sale window makes the result traceable rather than a headline number.
Realized gain check 6. A realized-loss ledger needs both sides of the transaction: the disposal that created the loss and every potentially matching replacement purchase around it on pass 6 when it examines realized gain at $7,000, realized loss at $4,000, and simple net gain at $3,000. Identify the unit for realized gain in pass 6 before changing a number: dollars, shares, months, a percentage, or a tax category. In check 6, recording the changed realized gain makes the result traceable rather than a headline number.
Realized loss check 7. A realized-loss ledger needs both sides of the transaction: the disposal that created the loss and every potentially matching replacement purchase around it on pass 7 when it examines realized loss at $4,000, simple net gain at $3,000, and replacement purchase at 10 days later. Identify the unit for realized loss in pass 7 before changing a number: dollars, shares, months, a percentage, or a tax category. In check 7, recording the changed realized loss makes the result traceable rather than a headline number.
Simple net gain check 8. A realized-loss ledger needs both sides of the transaction: the disposal that created the loss and every potentially matching replacement purchase around it on pass 8 when it examines simple net gain at $3,000, replacement purchase at 10 days later, and wash-sale window at 30 days before/after. Identify the unit for simple net gain in pass 8 before changing a number: dollars, shares, months, a percentage, or a tax category. In check 8, recording the changed simple net gain makes the result traceable rather than a headline number.
Replacement purchase check 9. A realized-loss ledger needs both sides of the transaction: the disposal that created the loss and every potentially matching replacement purchase around it on pass 9 when it examines replacement purchase at 10 days later, wash-sale window at 30 days before/after, and realized gain at $7,000. Identify the unit for replacement purchase in pass 9 before changing a number: dollars, shares, months, a percentage, or a tax category. In check 9, recording the changed replacement purchase makes the result traceable rather than a headline number.
Wash-sale window check 10. A realized-loss ledger needs both sides of the transaction: the disposal that created the loss and every potentially matching replacement purchase around it on pass 10 when it examines wash-sale window at 30 days before/after, realized gain at $7,000, and realized loss at $4,000. Identify the unit for wash-sale window in pass 10 before changing a number: dollars, shares, months, a percentage, or a tax category. In check 10, recording the changed wash-sale window makes the result traceable rather than a headline number.
Realized gain check 11. A realized-loss ledger needs both sides of the transaction: the disposal that created the loss and every potentially matching replacement purchase around it on pass 11 when it examines realized gain at $7,000, realized loss at $4,000, and simple net gain at $3,000. Identify the unit for realized gain in pass 11 before changing a number: dollars, shares, months, a percentage, or a tax category. In check 11, recording the changed realized gain makes the result traceable rather than a headline number.
Common mistakes
Do not sell solely for a tax label, call an unrealized price decline a harvested loss, repurchase without checking the wash-sale window, or assume capital losses offset unlimited ordinary income.
Where this calculation stops
The IRS rules cover taxpayer and account facts that a simple illustration cannot resolve, including spouses, IRA transactions, carryovers, security identity, and state treatment.
Source and verification
IRS Publication 550 describes wash-sale treatment for substantially identical stock or securities acquired within 30 days before or after a loss sale, and IRS Publication 544 describes the general capital-loss offset rules. Read the named source. For this illustration, verify the source date and the controlling record for realized gain before relying on the result.