Capital gains tax strategies for selling stocks and other investments

Tax-loss harvesting is treated as an automatic win in most capital gains tax discussions. Sell a loser, offset a winner, defer the bill. The math looks clean on a single-year spreadsheet, but it falls apart once you layer in the 3.8% Net Investment Income Tax, shifting bracket thresholds, and the diminishing value of carried-forward losses. In many cases, realizing gains in a low-rate year beats banking losses for a future that may never arrive.

When tax-loss harvesting backfires: NIIT exposure and bracket math

The NIIT applies a flat 3.8% surcharge on the lesser of net investment income or the amount by which modified adjusted gross income exceeds the statutory threshold. Those thresholds are not indexed for inflation, which means a gain that would have cleared the line a decade ago may now trigger the surcharge even when the regular long-term capital gains rate stays at the same bracket.

You may also like: Child tax credit eligibility and planning for 2026

Consider a taxpayer whose ordinary income sits just below the NIIT threshold. Harvesting a loss this year reduces taxable investment income by the harvested amount, saving tax at the combined long-term rate plus the 3.8% NIIT.

The problem appears in year two: the replacement position has a lower cost basis. When eventually sold, the gain is larger, and if income has risen even modestly, the NIIT kicks in on dollars that would have been taxed at a lower effective rate had the original gain been realized earlier.

Related reading: Tax-loss harvesting strategies for taxable investment accounts

The comparison that matters is not “tax saved today” versus “tax owed later.” It is the present value of the deferred tax minus the NIIT delta across both years. If the taxpayer’s income trajectory is flat or rising, deferral through harvesting can produce a net cost, not a savings.

Professional woman presenting stock investment and capital gains tax strategies in a corporate office

Realizing gains at the 0% long-term capital gains rate

The 0% long-term capital gains bracket exists for taxable income below a specific threshold that adjusts annually for inflation. Retirees in their first years of Social Security, individuals between jobs, or anyone with a gap year of low ordinary income can deliberately realize long-term gains and pay zero federal tax on them.

This is the mirror image of loss harvesting: gain harvesting resets cost basis upward at no federal tax cost. The position is sold and immediately repurchased (no wash-sale rule applies to gains), and the new, higher basis reduces future taxable gains permanently.

Carried-forward capital losses complicate this. If a taxpayer has accumulated loss carryforwards, those losses automatically offset gains dollar for dollar before the 0% bracket applies. The losses get consumed, the basis does not reset, and the opportunity is wasted. In that scenario, the prior-year harvest actively prevented the taxpayer from using a 0% rate window.

Comparing loss carryforward value to a 0% gain realization

A carried-forward loss offsets future gains at whatever rate those gains would have been taxed. If the taxpayer expects to be in the 0% bracket next year, the carryforward offsets gains that would have been tax-free anyway, producing zero benefit.

If the taxpayer expects to be in the top bracket plus NIIT, the carryforward is worth more than twenty cents on the dollar. The decision to harvest should depend on a realistic projection of future rates, not on the reflexive assumption that deferral always wins.

Specific-lot identification and holding-period tactics for selling stocks

Brokers default to FIFO (first in, first out) when selling stocks unless the taxpayer elects a different method at or before the time of sale. Specific-lot identification lets the investor choose exactly which shares to sell, controlling both the gain amount and whether it qualifies as long-term or short-term.

  • Selling the highest-cost lot first minimizes the realized gain, which directly reduces exposure to both the regular capital gains rate and the NIIT surcharge.
  • Selling a lot held for just over one year converts what would have been a short-term gain (taxed at ordinary income rates, potentially the top bracket) into a long-term gain at a substantially lower rate.
  • Selling a lot with a loss while simultaneously selling a different lot with a gain in the same security is permitted, as long as the loss lot is specifically identified and the repurchase does not trigger wash-sale rules on the loss side.

Failing to specify lots before execution means FIFO applies by default, and the oldest shares, often the ones with the lowest basis and largest gain, go first. This is the single most common mechanical error in capital gains tax management.

Digital asset tax lots: wash-sale gaps and recordkeeping traps

Digital assets sit in a regulatory gray zone that creates both risk and opportunity for capital gains strategies. The choice of tax-lot method generally must be documented by the time of sale; absent specific identification, FIFO is the presumed default for crypto dispositions.

Broker reporting for digital assets is changing, but the forms brokers issue may report proceeds without reliable basis information. Investors should reconcile broker-issued documents with their own acquisition records rather than treating a proceeds report as proof of basis. Overstating basis leads to underreported gains; understating it means overpaying tax.

Wash-sale rules and the crypto distinction

Directly held cryptocurrency is not classified as a security under the wash-sale rule as it currently stands. A taxpayer can sell a crypto position at a loss and immediately repurchase the same asset without disallowing the loss.

Crypto-linked securities (ETFs, trusts, futures) do not share this treatment and remain subject to the standard 30-day wash-sale window. Before relying on a loss-harvesting plan, verify the asset’s legal and tax classification, because the line between a digital asset and a digital-asset security determines whether the harvest is valid.

  • Directly held Bitcoin or Ethereum sold at a loss can be repurchased immediately without wash-sale disallowance.
  • A Bitcoin ETF sold at a loss triggers the wash-sale rule if substantially identical shares are bought within 30 days before or after the sale.
  • Mixed portfolios holding both spot crypto and crypto-linked funds require careful sequencing to avoid inadvertently disallowing losses on the fund side.

Person annotating capital gains tax planning worksheet on tablet at kitchen table

Building a multi-year capital gains tax plan

Single-year optimization is where most strategies stop, and where most value is lost. A multi-year plan models projected income, expected portfolio turnover, and the interaction between ordinary income brackets, the NIIT threshold, and available loss carryforwards.

The core question is not whether to harvest or realize, but which year offers the lowest combined marginal rate on a given dollar of gain. For a taxpayer approaching retirement with declining ordinary income, the answer may be to realize gains now. For a mid-career professional with rising income, deferral through harvesting may genuinely reduce lifetime tax. The NIIT’s static thresholds make this projection more important with each passing year, as inflation pushes more taxpayers above the line.

We find that investors who model a three-to-five-year income trajectory before executing any harvest or realization make fewer costly timing errors. A capital gains tax strategy is not a checklist of annual moves. It is a projection problem, and the projection has to include brackets, surcharges, and the real present value of every dollar deferred.

Don't miss any news