Tax-Loss Harvesting: Definition, Formula & Example

Tax-loss harvesting is the practice of intentionally realizing an investment loss so that the loss can be used within applicable tax rules to offset capital gains and potentially reduce taxable income.
Suppose an investor realizes a $12,000 capital gain on one investment and a $7,000 allowable capital loss on another.
Before considering other gains, losses, or tax rules:
Net Capital Gain = $12,000 − $7,000
= $5,000
The strategy does not make the $7,000 investment loss disappear. Instead, it changes how gains and losses interact within the tax calculation.
Tax-loss harvesting therefore should be evaluated as both an investment decision and a tax-timing decision.
Tax-Loss Harvesting Formula
At its simplest:
Net Capital Gain or Loss = Realized Capital Gains − Realized Capital Losses
Suppose:
Realized Gains = $20,000
Realized Losses = $8,000
Then:
Net Gain = $20,000 − $8,000
= $12,000
The exact federal tax treatment requires gains and losses to be classified and netted under the applicable rules rather than treating every transaction as one undifferentiated total.
Calculate the Investment Loss First
Tax-loss harvesting begins with the economics of the investment.
Capital Gain or Loss = Amount Realized − Adjusted Basis
Suppose:
Adjusted Basis = $25,000
Net Sale Proceeds = $18,000
Then:
Capital Loss = $18,000 − $25,000
= −$7,000
The position has a $7,000 realized loss.
Until the investment is sold or otherwise disposed of in a taxable transaction, a decline in market value generally remains an unrealized loss rather than a completed harvesting transaction.
Tax-Loss Harvesting Example
Suppose an investor has two completed transactions during the year.
Investment A creates:
$15,000 Realized Capital Gain
Investment B creates:
$6,000 Realized Capital Loss
Simplified net amount:
$15,000 − $6,000
= $9,000 Net Capital Gain
Without Investment B’s realized loss, the investor would have $15,000 of modeled gain.
With the loss:
Gain Reduction = $6,000
That does not necessarily mean the investor saves $6,000 of tax.
Estimate the Potential Tax Effect
Suppose the $6,000 loss ultimately offsets gain that would otherwise face an illustrative 20% tax rate.
A simplified estimate is:
Estimated Tax Reduction = Harvested Loss × Applicable Tax Rate
$6,000 × 20%
= $1,200
The investor has realized a $6,000 economic loss and potentially reduced the modeled tax by $1,200.
That distinction matters.
Investment Loss ≠ Tax Savings
After-Tax Economic View
Suppose an investor realizes:
$6,000 Loss
and receives an estimated:
$1,200 Tax Benefit
The simplified after-tax economic loss is:
$6,000 − $1,200
= $4,800
Tax treatment softens the loss under this illustration but does not turn an unsuccessful investment into a profit.
Harvesting Losses Against Gains
Suppose the portfolio contains:
$25,000 Realized Gains
and:
$18,000 Realized Losses
Simplified net:
$25,000 − $18,000
= $7,000 Net Gain
If the investor had harvested only $5,000 of losses:
Net Gain = $20,000
The additional $13,000 of realized losses changes the amount remaining after netting.
Whether harvesting those losses was economically sensible still depends on the portfolio decision itself.
Losses Greater Than Gains
Suppose:
Realized Gains = $8,000
Realized Losses = $14,000
Simplified net:
$8,000 − $14,000
= −$6,000
The investor has an overall capital loss before applying the more detailed tax rules governing capital-loss deductions and carryforwards.
The tax effect should therefore not be calculated simply as:
$6,000 × Marginal Rate
without checking how much of the loss can actually affect the current year’s tax calculation.
Tax-Loss Harvesting and Taxable Income
A net capital loss can interact with taxable income under applicable tax rules.
This makes taxable income a later-stage result rather than the starting point for harvesting.
The logical sequence is:
Determine Investment Gain or Loss → Apply Capital Gain/Loss Netting Rules → Determine Tax Effect
Trying to reverse-engineer a harvesting amount directly from taxable income can overlook capital-loss limitations and classification rules.
The Wash-Sale Rule
For U.S. federal tax purposes, wash-sale rules can disallow a current loss when substantially identical stock or securities are acquired within the period beginning 30 days before and ending 30 days after the loss sale. A disallowed loss can instead affect the basis of replacement securities.
This means an investor cannot safely assume:
Sell at Loss Today + Immediately Repurchase Same Investment = Immediate Deductible Loss
The tax result can be different even though the portfolio quickly returns to essentially the same position.
Wash-Sale Timeline Example
Suppose shares are sold at a $4,000 loss on June 15.
A simplified wash-sale risk window extends around that transaction, including acquisitions during the 30 days before and 30 days after the loss sale when the replacement property is substantially identical.
The practical lesson is that tax-loss harvesting needs to consider both sale timing and replacement-investment choices.
A transaction can make investment sense while still failing to create the expected immediate tax loss.
Similar Does Not Automatically Mean Identical
Investors sometimes replace a sold position with another investment to maintain market exposure.
However, the tax question is whether replacement property is considered substantially identical under the applicable rules.
The answer should not be guessed merely from ticker symbols, fund names, or broad asset classes.
Tax-loss harvesting works best when the investment strategy and tax treatment are considered together rather than treating replacement selection as an afterthought.
Harvesting Is About Realized Losses
Suppose a portfolio contains:
Investment A:
Unrealized Loss = $10,000
Investment B:
Realized Gain = $10,000
The unrealized loss does not automatically offset the realized gain.
If Investment A is sold and the $10,000 loss becomes realized, then the capital-loss rules can become relevant.
The distinction is:
Market Decline ≠ Realized Tax Loss
until the required taxable transaction occurs.
Cost Basis Matters
Suppose an investor believes an asset cost $30,000.
Actual adjusted basis records show:
$34,000
Sale proceeds:
$28,000
Using the assumed basis:
Loss = $2,000
Using the correct adjusted basis:
Loss = $6,000
Difference:
$4,000
Tax-loss harvesting decisions can therefore be materially wrong when basis information is incomplete.
Harvesting Multiple Lots
Suppose an investor owns two lots of the same security.
Lot A:
Basis = $15,000
Value = $12,000
Potential loss:
$3,000
Lot B:
Basis = $8,000
Value = $11,000
Potential gain:
$3,000
Selling all shares produces a net economic result near zero before other transaction considerations.
Selling only Lot A could realize the loss while retaining Lot B, depending on proper lot identification and applicable tax rules.
Specific-lot accounting can therefore affect harvesting outcomes.
Tax Savings vs Portfolio Quality
Suppose an investor owns a fundamentally weak position with a $5,000 unrealized loss.
Selling may make sense even without a tax benefit if the capital can be redeployed more effectively.
Conversely, selling a desirable long-term investment solely to capture a small tax benefit can introduce transaction costs, tracking differences, or market-timing risk.
Tax considerations should support the investment strategy rather than replace it.
Reinvestment Risk
Imagine an investor sells an asset at $80 and waits before purchasing replacement exposure.
If the market rises to $88 during that period:
Market Rebound = $8 per Share
The tax benefit from the harvested loss may be smaller than the economic cost of missing the rebound.
This is one reason replacement strategy matters alongside the tax calculation.
Transaction Costs
Suppose harvesting a loss creates:
Estimated Tax Benefit = $600
but trading costs, bid-ask effects, and portfolio disruption total:
$250
Net modeled benefit:
$600 − $250
= $350
The headline tax benefit can overstate the economic advantage when implementation costs are ignored.
Tax Deferral vs Permanent Tax Savings
Tax-loss harvesting often changes when tax is paid rather than guaranteeing permanent tax elimination.
If a disallowed or deferred loss increases the basis of a replacement investment, future gains can be affected when that investment is eventually sold.
Even without a wash sale, reinvesting at a lower basis can create a larger future gain.
The lifetime tax benefit therefore depends on future transactions, rates, and portfolio decisions.
Tax-Loss Harvesting and Tax Deductions
A harvested capital loss should not simply be treated as an ordinary tax deduction equal to the entire loss.
Capital losses follow their own tax rules.
Although a qualifying net loss may eventually reduce an income-tax base, its treatment should be determined through the capital-gain and capital-loss framework first.
Tax-Loss Harvesting and Tax-Inclusive Prices
A tax-inclusive price contains transaction tax within a displayed price.
Tax-loss harvesting instead concerns investment basis, sale proceeds, and capital losses.
For example, paying $108 for a tax-inclusive consumer purchase does not create a $108 investment basis that can automatically be harvested later.
The underlying financial transaction must be classified correctly.
Tax-Loss Harvesting and Tax-Exclusive Prices
Likewise, a tax-exclusive price describes an amount before transaction tax.
The distinction between tax-exclusive and tax-inclusive consumer pricing has no direct role in deciding whether an investment sale generated an allowable capital loss.
Both subjects involve tax calculations, but their bases are entirely different.
Tax-Loss Harvesting and VAT
VAT is a consumption-tax mechanism applied to goods or services in jurisdictions that use it.
Tax-loss harvesting operates in investment taxation.
A VAT amount paid on a consumer transaction should not be mixed into a capital-loss harvesting calculation merely because both figures can affect after-tax cash flow.
Harvesting Before Year-End
Investors often evaluate unrealized gains and losses before the end of a tax year because completing a sale in one year rather than another can affect which year’s return includes the transaction.
However, a year-end deadline should not encourage rushed trades.
The investor still needs correct basis information, transaction settlement awareness where relevant, replacement planning, and wash-sale review.
Harvesting Gains and Losses Together
Suppose an investor wants to exit two positions.
Position A:
Gain = $10,000
Position B:
Loss = $8,000
Selling both produces:
Net Gain = $2,000
If both exits already make sense for the portfolio, coordinating their timing can also improve tax efficiency.
This is different from selling a strong investment solely because another holding happens to have a loss.
Common Tax-Loss Harvesting Mistakes
A frequent mistake is assuming the realized loss equals the tax savings.
Another is repurchasing substantially identical securities without considering wash-sale rules.
Investors also overlook adjusted basis, transaction costs, future tax consequences, or hold an undesirable investment solely because they are waiting for a tax-planning opportunity.
Frequently Asked Questions
What is tax-loss harvesting?
Tax-loss harvesting means intentionally realizing an investment loss so the loss can be used within applicable tax rules to offset gains or otherwise affect the tax calculation.
What is the basic capital-loss formula?
Capital Gain or Loss = Amount Realized − Adjusted Basis
Does a $10,000 harvested loss save $10,000 in tax?
No.
How can I estimate the tax effect?
A simplified estimate is:
Allowable Loss Affecting Tax × Applicable Tax Rate
but actual treatment depends on capital-loss rules.
Can unrealized losses offset realized gains?
Not simply because the market value has fallen. The loss generally needs to be realized through the applicable transaction.
What is a wash sale?
Under U.S. federal rules, a loss sale can face wash-sale treatment when substantially identical stock or securities are acquired within the relevant 30-day-before/30-day-after window.
Does a wash-sale loss disappear forever?
A disallowed loss can affect the basis of replacement securities under the applicable rules.
Does tax-loss harvesting guarantee a financial benefit?
No.
Why does cost basis matter?
Because the realized gain or loss is measured relative to adjusted basis.
Can transaction costs outweigh the tax benefit?
Yes.
Is tax-loss harvesting only about reducing current taxes?
No. It can also shift tax consequences between periods.
What should come first: investment strategy or tax savings?
The portfolio decision should remain economically sound even after the tax benefit is considered.



