Tax-Loss Harvesting Guide: How to Offset Gains Without Disrupting Your Portfolio
tax planningcapital gainsportfolio managementwash-sale rule

Tax-Loss Harvesting Guide: How to Offset Gains Without Disrupting Your Portfolio

AArticles Invest Editorial Team
2026-12-04
7 min read

Learn how tax-loss harvesting can offset gains, avoid wash-sale problems, and preserve portfolio exposure with a repeatable review process.

Tax-loss harvesting can reduce the tax impact of investment gains while keeping your portfolio aligned with its long-term plan. This guide explains how to estimate the potential benefit, check short- and long-term tax treatment, avoid wash-sale problems, choose replacement investments, and decide when harvesting may not be worth the cost or complexity.

Overview

Tax-loss harvesting is the process of selling an investment that is below its tax basis to realize a capital loss. The loss can then be used to offset realized capital gains in a taxable brokerage account. The investor may purchase a different investment to maintain similar market exposure, provided the replacement does not create a wash-sale issue.

The strategy applies to realized transactions, not simply to positions showing an unrealized loss. A position with a declining market value does not affect your tax return until it is sold. Conversely, selling a position at a gain creates a taxable event even if the proceeds are immediately reinvested.

Tax-loss harvesting is not automatically beneficial. Selling may create trading costs, change your portfolio exposure, interrupt a carefully chosen holding period, or leave you with a replacement that does not match your investment plan. The tax benefit should be considered alongside risk, diversification, liquidity, and expected returns.

Item to checkWhy it matters
Realized gainsLosses may offset gains recognized during the tax year.
Short- or long-term classificationThe holding period can affect how gains and losses are matched and reported.
Tax basisThe basis determines the size of the realized gain or loss.
Wash-sale exposureA substantially identical purchase in the relevant window can defer or complicate the loss.
Replacement investmentThe substitute should preserve the intended portfolio exposure without undermining the strategy.
Costs and taxesCommissions, spreads, fund costs, and tax consequences can reduce the expected benefit.

How to estimate

Start with a tax-lot inventory rather than a single account balance. For each taxable position, record the number of shares, purchase date, adjusted cost basis, current value, and whether the lot is short-term or long-term. Your brokerage's tax-lot information is a useful starting point, but confirm the figures when multiple purchases, reinvested distributions, transfers, or corporate actions are involved.

Use this basic estimate:

Estimated realized loss = adjusted tax basis of the shares sold − sale proceeds − directly related selling costs

For a gain, reverse the order of the first two terms. Then group the results by holding period. In general, short-term gains and losses are considered separately from long-term gains and losses before the net amounts are combined. The exact reporting sequence and tax result depend on the full set of transactions for the year.

A practical worksheet can include these columns:

  • Security and account
  • Tax lot and acquisition date
  • Adjusted basis
  • Estimated sale proceeds
  • Short-term or long-term status
  • Estimated gain or loss
  • Replacement security
  • Potential wash-sale dates

After netting gains and losses, compare the result with your broader tax situation. A net capital loss may be carried forward under applicable rules when it cannot be used in the current year, but carryforward treatment and any deduction against other income depend on the taxpayer's circumstances and current law. State treatment may differ from federal treatment.

Inputs and assumptions

Tax basis and realized transactions

Use adjusted basis, not necessarily the amount originally paid. Reinvested dividends, return of capital, gifts, transfers, and certain fund distributions can affect basis. Include gains or losses already realized elsewhere, including another brokerage account, so the calculation does not evaluate one account in isolation.

Short-term versus long-term treatment

Holding period matters. A sale after a shorter holding period is generally classified differently from a sale after a longer holding period. Do not assume that a long-term loss is interchangeable with a short-term loss at every stage of the calculation. Confirm the classification on the account's tax records and review the applicable federal and state rules before trading.

The wash-sale rule

The wash-sale rule is designed to prevent an investor from claiming a loss while effectively replacing the same investment too quickly. It generally concerns a purchase of substantially identical shares or securities within the period beginning 30 days before and ending 30 days after the sale. The rule can also involve purchases in another account or purchases made by certain related parties, so reviewing only one brokerage account may be insufficient.

When a wash sale applies, the loss is generally disallowed for the current transaction and may be added to the basis of the replacement shares. Special complications can arise when replacement shares are acquired in a tax-advantaged account. Because the definition of “substantially identical” is fact-specific, changing from one broad-market fund to a different fund is not the same as simply buying the same fund again, but it still requires careful analysis.

Replacement investments

Choose the replacement based on the role the original investment plays. A broad equity fund might be replaced temporarily by another broadly diversified fund with a different index or mandate. A single company may require a more cautious substitute because a similar company can carry concentrated business risk. Avoid changing the portfolio merely to obtain a tax result.

Also account for bid-ask spreads, commissions where applicable, fund expense differences, foreign-exchange costs, and the possibility that the replacement will perform differently while it is held. Tax-loss harvesting can reduce tax friction, but it cannot guarantee a better investment outcome.

Worked examples

Example 1: Loss offsets a realized gain

Assume an investor has a taxable account containing a fund with an adjusted basis of $12,000 and a current value of $9,500. Selling the position would create an illustrative $2,500 loss before transaction costs. During the same tax year, the investor has already realized a $2,000 capital gain elsewhere.

The loss could offset the $2,000 gain, leaving a remaining net capital loss of approximately $500 before considering other transactions and tax rules. The investor might choose a replacement fund with a different index or portfolio mandate to maintain broad market exposure while reducing the chance of a wash-sale complication. The investor should document the sale, replacement purchase, dates, and tax-lot details.

Example 2: Losses exceed gains

Suppose realized losses total $6,000 while realized gains total $3,500. The initial net result is a $2,500 capital loss, subject to the applicable ordering and reporting rules. If the loss cannot all be used in the current year, the unused amount may be carried forward under applicable law. A carryforward is not a reason to sell an investment without a portfolio rationale; the value depends on future gains, income, tax rates, and the investor's ability to use it.

Example 3: Harvesting is not attractive

An investor has a small unrealized loss in a position that is central to the portfolio. Selling would create a wide spread, require an inconvenient replacement, and expose the investor to the risk of missing a rebound. If there are no meaningful realized gains and the expected tax benefit is modest, the costs and disruption may outweigh the benefit. Holding the position can be the more disciplined choice.

When to recalculate

Review tax-loss opportunities at least quarterly and again before the end of the tax year, but do not wait until the final trading days if the account contains many tax lots. Recalculate after a large sale, merger, fund distribution, transfer between accounts, or significant portfolio rebalance. Also review the plan after a change in employment income, residence, filing status, or expected tax bracket.

Before placing an order, use this checklist:

  1. List all realized gains and losses for the year across taxable accounts.
  2. Identify the specific tax lot to sell and confirm its adjusted basis.
  3. Estimate proceeds, costs, and the resulting short- or long-term loss.
  4. Search for purchases of the same or substantially identical investment in all relevant accounts during the wash-sale window.
  5. Select a replacement that supports the portfolio's target allocation.
  6. Record the trade date, proceeds, basis, replacement security, and review date.
  7. Recheck the year-end tax statement and provide the records to a qualified tax professional if the situation is complex.

Tax-loss harvesting works best as part of a broader investment policy, not as a standalone trading signal. Revisit the calculation when market values, realized transactions, tax rules, or portfolio goals change. For related planning, see our guide to building a diversified investment portfolio and our template for writing an investment policy statement. This article is general information, not individualized tax or investment advice; confirm current federal and state rules before acting.

Related Topics

#tax planning#capital gains#portfolio management#wash-sale rule
A

Articles Invest Editorial Team

Personal Finance Editors

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.