Tax-Loss Harvesting: How to Turn Portfolio Losses Into Tax Savings
Learn how tax-loss harvesting works, from wash sale rules and capital loss netting to replacement fund strategies. See a worked example of the tax benefit calculation and understand when TLH is worth the effort.
What Tax-Loss Harvesting Is and Why It Matters
Tax-loss harvesting (TLH) is the practice of selling investments at a loss to offset capital gains taxes. You sell a losing position, claim the loss on your tax return, and immediately buy a similar (but not "substantially identical") investment to maintain your market exposure. You stay fully invested while generating a tax benefit.
The real power of TLH is not just the immediate tax savings. It is that the money you would have paid in taxes stays invested and compounds over time. A $10,000 harvested loss in the 24% bracket saves $2,400 in taxes. That $2,400, invested for 20 years at 7% real return, grows to roughly $9,300. The tax deferral itself generates returns.
TLH is not tax elimination. It is tax deferral with a compounding bonus. When you eventually sell the replacement investment, your cost basis will be lower, so you will owe taxes on a larger gain. But you have had years or decades of additional compounding on the deferred amount. For investors with long time horizons, this can add 0.5% to 1.0% per year to after-tax returns.
Calculate Your Tax Savings
Tax-Loss Harvesting Calculator
$2K
Tax Savings This Year
$8K
Compounded Benefit (20yr at 7%)
$7K
Annual Carry Forward
Tax Savings Breakdown
Your $10K long-term loss saves $2K in federal taxes (at 15% LTCG rate) + $500 in state taxes (at 5%) = $2K total.
TLH is tax deferral, not elimination. Your replacement investment has a lower cost basis, so you will owe taxes on a larger gain when you eventually sell. The compounded benefit above represents the value of investing the tax savings now instead of paying the IRS now. If you hold the replacement until death, the stepped-up basis may eliminate the deferred tax entirely.
$3,000 ordinary income offset: If your losses exceed capital gains, up to $3,000 can offset ordinary income, saving an additional $720 at your 24% marginal rate. The remaining $7K carries forward to future tax years indefinitely.
Track unrealized gains and losses across your portfolio with Summitward's tax-loss harvesting tool.
Capital Loss Netting: How the IRS Counts Losses
The IRS does not let you simply subtract losses from your income. Capital gains and losses follow specific netting rules on Schedule D of your tax return.
Step 1: Net Within Each Category
Short-term gains and losses (positions held one year or less) are netted against each other. Long-term gains and losses (positions held more than one year) are netted separately.
Step 2: Net Across Categories
If one category has a net gain and the other has a net loss, they offset each other. This is where TLH can be especially valuable: short-term losses can offset short-term gains that would otherwise be taxed at your full marginal income rate (up to 37%).
Step 3: The $3,000 Cap Against Ordinary Income
If your net capital losses exceed your capital gains, you can deduct up to $3,000 per year ($1,500 if married filing separately) against ordinary income. This is a hard cap. If you harvest $50,000 in losses and have no capital gains, you can only use $3,000 this year.
Step 4: Carryforward
Any unused losses carry forward indefinitely to future tax years. Those $47,000 in excess losses from the example above will be available to offset future capital gains, $3,000 per year against ordinary income until fully used. Losses never expire.
Short-Term vs. Long-Term: The Tax Rate Difference
| Gain Type | Tax Rate |
|---|---|
| Short-term capital gains (held ≤ 1 year) | Ordinary income rate (10-37%) |
| Long-term capital gains (held > 1 year) | 0%, 15%, or 20% (based on income) |
This rate difference makes TLH particularly valuable when you can use short-term losses to offset short-term gains. Offsetting a gain taxed at 32% saves more than offsetting one taxed at 15%.
The Wash Sale Rule
The wash sale rule is the IRS regulation that prevents you from harvesting a loss and immediately rebuying the same investment. If you sell a security at a loss and buy a "substantially identical" security within 30 days before or after the sale, the loss is disallowed.
What "Substantially Identical" Means
The IRS has never published a precise definition, but the consensus among tax professionals and case law is:
- Same security: Selling and rebuying shares of the same stock or fund (e.g., sell AAPL, buy AAPL) is always a wash sale.
- Same fund: Selling one share class and buying another of the same fund (e.g., VTSAX to VTI, which are the same Vanguard Total Stock Market fund) is generally treated as substantially identical.
- Different index, same exposure: Selling a Vanguard S&P 500 fund and buying a Schwab S&P 500 fund is a gray area. They track the same index but are different funds from different companies. Many tax professionals treat these as substantially identical, though the IRS has not ruled explicitly.
- Different index, similar exposure: Selling an S&P 500 fund and buying a total U.S. market fund is generally considered safe. They have significant overlap (the S&P 500 makes up roughly 80% of the total market by cap weight), but they track different indices. Most practitioners accept this as a valid replacement.
Cross-Account Traps
The wash sale rule applies across all your accounts, including your spouse's accounts. Common traps:
- Selling at a loss in your taxable brokerage while your 401(k) auto-purchases the same fund on payday
- Selling at a loss while dividend reinvestment (DRIP) in another account buys the same security within 30 days
- Your spouse buying the same security in their IRA within the 30-day window
The penalty for a wash sale is that the disallowed loss gets added to the cost basis of the replacement shares. The loss is not eliminated forever; it is deferred until you eventually sell the replacement shares without triggering another wash sale.
Replacement Fund Strategy
The key to effective TLH is having pre-planned replacement funds that maintain your target asset allocation while avoiding wash sale issues. You want investments that give you similar market exposure (so your portfolio stays on track) but are not substantially identical to what you sold.
Common Replacement Pairs
| Primary Holding | TLH Replacement | Exposure |
|---|---|---|
| Vanguard Total Stock (VTI) | Schwab U.S. Broad Market (SCHB) | U.S. total market |
| Vanguard S&P 500 (VOO) | iShares Core S&P 500 (IVV) | U.S. large cap |
| Vanguard Total Intl (VXUS) | iShares Core MSCI Intl (IXUS) | International developed + emerging |
| Vanguard Total Bond (BND) | iShares Core U.S. Aggregate (AGG) | U.S. investment grade bonds |
| Vanguard REIT (VNQ) | Schwab U.S. REIT (SCHH) | U.S. real estate |
The strategy is straightforward: sell the primary holding at a loss, immediately buy the replacement to maintain exposure, wait at least 31 days, then optionally swap back to your primary holding if you prefer it. The swap-back resets your holding period for the position.
When TLH Is Worth It (and When It Is Not)
TLH Is Most Valuable When:
- You have a long time horizon. The longer the deferred taxes stay invested, the more the compounding benefit accumulates. A 30-year-old investor benefits more than a 60-year- old.
- You are in a high tax bracket now and expect a lower bracket later. Deferring gains from a 35% bracket to a 15% bracket in retirement is a permanent tax rate arbitrage, not just deferral.
- You have large capital gains to offset. Selling concentrated stock (RSU vests, company stock, real estate) creates gains that harvested losses can offset dollar for dollar.
- Markets are volatile. Down markets create the most harvesting opportunities. The 2020 COVID crash and 2022 bear market were excellent TLH environments.
TLH Has Limited Value When:
- Your portfolio is mostly in tax-advantaged accounts. TLH only works in taxable accounts. Gains in a 401(k) or IRA are already tax-deferred.
- The loss is small relative to transaction friction. Harvesting a $200 loss to save $48 in taxes may not be worth the effort and tracking complexity.
- You expect to be in a higher tax bracket when you realize the gains. If your future rate is higher than your current rate, deferral can actually increase your lifetime tax bill.
- You plan to donate the shares. If you donate appreciated securities to charity, you get a deduction for the fair market value and never pay capital gains tax. In this case, a higher cost basis (from not harvesting) is actually less valuable.
- You plan to hold until death. Under current law, heirs receive a stepped-up cost basis at the date of death, permanently eliminating unrealized gains. If you will never sell, there is nothing to harvest against.
Worked Example: Tax Benefit Calculation
Alex has a taxable portfolio of $200,000. After a market downturn, one position has an unrealized loss:
- Vanguard Total Stock (VTI): purchased for $80,000, now worth $65,000 (unrealized loss of $15,000)
- Alex is in the 32% federal bracket and 5% state bracket (37% combined marginal rate)
- Alex has $8,000 in short-term capital gains from RSU sales this year
Step 1: Harvest the Loss
Alex sells VTI for $65,000, realizing a $15,000 long-term capital loss. Alex immediately buys $65,000 of Schwab U.S. Broad Market (SCHB) to maintain total market exposure.
Step 2: Apply the Loss
| Netting Step | Amount |
|---|---|
| Short-term gains (RSU sales) | +$8,000 |
| Long-term loss (VTI harvest) | -$15,000 |
| Net capital loss | -$7,000 |
| Deducted against ordinary income | -$3,000 |
| Carried forward to next year | -$4,000 |
Step 3: Calculate the Tax Savings
The remaining $4,000 in carryforward losses will offset future gains. At the same tax rate, that is an additional $1,480 in future tax savings, plus compounding on the deferred amount in the meantime.
Step 4: Understand the Tradeoff
Alex's SCHB position now has a cost basis of $65,000 instead of the original $80,000 VTI basis. When Alex eventually sells SCHB, the gain will be $15,000 larger. But Alex has had the use of that $4,070 in tax savings for years, generating additional returns. Over a 20-year holding period at 7% real return, that $4,070 grows to roughly $15,750, more than offsetting the deferred tax.
Related Guides
Tax-loss harvesting is one piece of a tax-aware investment strategy. These guides cover related concepts:
- Tax-Aware Long-Short: Real Tax Alpha or Marketing? is the long-short / SMA / HNW companion to this post: how leveraged TALS strategies extend loss capacity beyond the ~30% ceiling of long-only direct indexing, plus a hurdle calculator and the Section 1259 caveat.
- RSU Tax Strategy addresses the tax impact of employer stock vests and when TLH can offset the income from selling appreciated shares.
- Concentration Risk covers when a single position dominates your portfolio and how to diversify while using TLH to manage the tax cost.
- Roth Conversion Ladder explains another tax optimization strategy for early retirees, complementing TLH in taxable accounts.
- Safe Withdrawal Rate shows how tax-efficient withdrawals improve your effective spending rate in retirement.
Key Takeaways
- TLH is tax deferral, not elimination. You pay taxes later on a lower cost basis, but the deferred amount compounds in your portfolio. For long-horizon investors, the compounding benefit is substantial.
- The wash sale rule has a 61-day window. You cannot buy a substantially identical security 30 days before or after the loss sale. The rule applies across all your accounts, including your spouse's.
- Use pre-planned replacement pairs. Have a list of similar-but-not-identical funds ready (e.g., VTI to SCHB, VOO to IVV) so you can harvest quickly during downturns without disrupting your allocation.
- Short-term loss offsets are most valuable. Short- term gains are taxed at ordinary income rates (up to 37%). Using losses to offset short-term gains saves more per dollar than offsetting long-term gains (taxed at 0-20%).
- Harvest proactively in down markets. Do not wait until year-end. Monitor your portfolio during market downturns and harvest losses when they appear. Losses can vanish quickly in a recovery.
- TLH only works in taxable accounts. Gains and losses in 401(k)s, IRAs, and other tax-advantaged accounts are irrelevant for TLH purposes. Focus your harvesting on your taxable brokerage.
More in Tax Strategy
Browse all tax strategy guidesGet new guides by email
Evidence-based, no jargon. At most two emails a month. Unsubscribe any time.
Try it in Summitward
See tax-loss harvesting calculator in action with your own financial data. Free to start, no credit card required.