Skip to main content
All posts
capital gainstaxestax-loss harvestinginvestingcapital losses

Capital Gains vs Capital Losses: A Complete Tax Guide

Helm Terminal·April 20, 2026·10 min read

Capital Gains vs Capital Losses: A Complete Tax Guide

Capital gains and capital losses are the tax consequences of selling investments for more or less than you paid for them. Understanding how capital gains tax works — and how capital losses can offset them — is essential for any investor who wants to keep more of their returns. The difference between smart and naive tax management can easily amount to 1-2% of portfolio value annually.

This guide covers everything you need to know about capital gains and losses in 2026: how they are calculated, how they are taxed, and how to use them strategically.

What Are Capital Gains?

A capital gain occurs when you sell an asset for more than your cost basis (what you paid for it, including commissions and fees).

Simple example:

  • You buy 100 shares of AAPL at $150/share = $15,000 cost basis
  • You sell those 100 shares at $200/share = $20,000 proceeds
  • Capital gain = $20,000 - $15,000 = $5,000

Realized vs. Unrealized Gains

  • Unrealized gains: Your investment has appreciated in value but you have not sold it. No tax is owed. Often called "paper gains."
  • Realized gains: You have sold the investment and locked in the profit. Tax is now owed for the year of the sale.

This distinction is critically important: you control when (and whether) to realize gains. This timing flexibility is the foundation of tax-efficient investing.

Short-Term vs. Long-Term Capital Gains

The IRS treats capital gains very differently based on how long you held the asset:

| Holding Period | Classification | Tax Rate | |---------------|---------------|----------| | 1 year or less | Short-term capital gain | Taxed as ordinary income (up to 37%) | | More than 1 year | Long-term capital gain | 0%, 15%, or 20% preferential rate |

2026 Long-Term Capital Gains Tax Rates:

| Filing Status | 0% Rate | 15% Rate | 20% Rate | |---------------|---------|----------|----------| | Single | Up to $48,350 | $48,351 - $533,400 | Over $533,400 | | Married Filing Jointly | Up to $96,700 | $96,701 - $600,050 | Over $600,050 |

Net Investment Income Tax (NIIT): An additional 3.8% surtax applies to investment income for individuals earning over $200,000 ($250,000 married). This brings the effective top rate on long-term gains to 23.8%.

What Are Capital Losses?

A capital loss occurs when you sell an asset for less than your cost basis.

Example:

  • You buy 200 shares of XYZ at $50/share = $10,000 cost basis
  • The stock drops and you sell at $35/share = $7,000 proceeds
  • Capital loss = $7,000 - $10,000 = -$3,000

How Capital Losses Offset Gains

Capital losses directly offset capital gains dollar-for-dollar:

  1. Short-term losses first offset short-term gains (most beneficial — offsets income taxed at up to 37%)
  2. Long-term losses first offset long-term gains (offsets income taxed at 15-20%)
  3. Net losses of one type offset gains of the other type
  4. If net losses exceed gains: Deduct up to $3,000 against ordinary income per year
  5. Remaining losses: Carry forward indefinitely to future years

Example of loss offset:

| Transaction | Type | Amount | |-------------|------|--------| | Gain from selling Stock A | Short-term | +$8,000 | | Loss from selling Stock B | Short-term | -$5,000 | | Gain from selling Stock C | Long-term | +$12,000 | | Loss from selling Stock D | Long-term | -$15,000 | | Net short-term gain | | +$3,000 | | Net long-term loss | | -$3,000 | | Overall net gain | | $0 (no tax owed) |

In this example, the investor realized $20,000 in total gains but owes zero capital gains tax because losses perfectly offset gains.

Tax-Loss Harvesting: Turning Losses into Tax Savings

Tax-loss harvesting is the practice of deliberately selling investments at a loss to offset gains elsewhere in your portfolio — then reinvesting the proceeds in a similar (but not identical) investment to maintain your market exposure.

How Tax-Loss Harvesting Works

  1. Identify positions with unrealized losses in your portfolio
  2. Sell the losing position to realize the capital loss
  3. Immediately reinvest in a similar but not "substantially identical" security
  4. Use the harvested loss to offset realized gains or up to $3,000 of ordinary income

The Wash Sale Rule

The IRS prevents you from selling at a loss and immediately rebuying the same security. The wash sale rule disallows the loss if you purchase a "substantially identical" security within 30 days before or after the sale.

What triggers a wash sale:

  • Buying the same stock within 30 days (before or after the loss sale)
  • Buying a call option on the same stock
  • Buying the stock in another account (IRA, spouse's account)
  • Receiving the stock via DRIP (dividend reinvestment) within 30 days

What does NOT trigger a wash sale:

  • Selling a Vanguard S&P 500 fund and buying a Schwab S&P 500 fund (different fund, same index — the IRS has not explicitly ruled this is "substantially identical," though this is debated)
  • Selling an individual stock and buying a sector ETF that contains it
  • Waiting 31 days to repurchase

Tax-Loss Harvesting Example

| Action | Details | |--------|---------| | Current holding | VTI (Vanguard Total Stock Market) — down $8,000 from purchase | | Sell VTI | Realize $8,000 capital loss | | Buy ITOT | iShares Core S&P Total US Stock Market (similar exposure, different fund) | | Tax benefit | $8,000 loss offsets other gains or $3,000/year against income | | Portfolio impact | Minimal — still holds broad US stock market exposure |

When Tax-Loss Harvesting Makes Sense

  • You have realized gains elsewhere (from rebalancing, RSU sales, or profitable exits)
  • You have significant unrealized losses in taxable accounts
  • You are in a high marginal tax bracket (32%+ federal)
  • You can maintain similar market exposure without triggering wash sale rules

When It Does NOT Make Sense

  • You are in the 0% capital gains bracket (no tax to offset)
  • Transaction costs exceed the tax benefit (very small losses)
  • You cannot find an adequate replacement investment
  • The position is in a tax-advantaged account (IRA, 401k) — losses are not deductible

Cost Basis Methods

When you sell shares you purchased at different prices over time, you must determine which shares you are selling. The method you choose affects your taxable gain or loss:

FIFO (First In, First Out)

Default method. Assumes you sell the oldest shares first. Often results in the largest gain (since oldest shares typically have the lowest cost basis due to appreciation over time).

Specific Identification

You choose exactly which lot to sell. Optimal for tax planning — sell highest-cost-basis shares first to minimize gains, or sell lots with losses for harvesting.

Average Cost

Only available for mutual funds. Averages the cost basis of all shares. Simple but inflexible.

Recommendation: Always use specific identification and sell highest-cost-basis lots first (unless you are deliberately harvesting a loss from a low-cost lot). Most brokerages support this if you specify at the time of sale.

Capital Gains Strategies for Different Situations

For RSU Holders

When RSU shares vest, your cost basis equals the market price on the vesting date. If the stock subsequently drops below your vesting price, you have a harvestable capital loss — even though you never "bought" the shares in the traditional sense.

This is one of the most commonly missed tax-loss harvesting opportunities for tech workers.

For Rebalancing

Portfolio rebalancing often requires selling appreciated assets. Offset these gains by simultaneously harvesting losses elsewhere in the portfolio. The net tax impact of a rebalancing event can be reduced to near-zero with planning.

For Concentrated Positions

If you hold a large concentrated stock position with substantial unrealized gains, consider:

  • Selling in installments across multiple tax years to stay in lower brackets
  • Donating appreciated shares directly to charity (avoid capital gains entirely)
  • Using qualified opportunity zone investments to defer gains
  • Gifting appreciated shares to family members in lower tax brackets

For Retirement Accounts

Capital gains and losses inside IRAs, 401(k)s, and other tax-advantaged accounts have NO tax consequences. You can buy and sell freely without worrying about wash sales, holding periods, or cost basis. All tax impact happens at withdrawal (traditional) or never (Roth).

This is why aggressive rebalancing and tax-inefficient strategies belong in tax-advantaged accounts.

Tracking Capital Gains and Losses

Effective capital gains management requires knowing:

  1. Cost basis of every lot: When you bought it and at what price
  2. Holding period of every lot: Has it crossed the 1-year threshold for long-term treatment?
  3. Unrealized gains/losses: Where do harvesting opportunities exist?
  4. Year-to-date realized gains: How much offset do you need?

When holdings are spread across multiple brokerage accounts, this tracking becomes complex. Each brokerage reports its own 1099-B, but none can see your tax picture across all accounts.

Helm Terminal aggregates your holdings across all accounts and tracks current market values — making it straightforward to identify which positions have unrealized losses available for harvesting and which have gains you might want to defer.

Year-End Capital Gains Checklist

Before December 31 each year:

  • [ ] Calculate year-to-date realized gains across all taxable accounts
  • [ ] Identify positions with unrealized losses for potential harvesting
  • [ ] Check holding periods — are any positions about to cross the 1-year long-term threshold?
  • [ ] Review mutual fund capital gains distribution estimates (they create gains even if you do not sell)
  • [ ] Consider accelerating gains into the current year if you expect to be in a higher bracket next year
  • [ ] Consider deferring gains if you expect to be in a lower bracket next year
  • [ ] Confirm you will not violate wash sale rules with January purchases

Track Your Gains, Losses, and Tax Position

Managing capital gains and losses effectively requires real-time visibility into your portfolio's cost basis and unrealized positions across every account. Waiting until tax time to discover you owe $15,000 in capital gains is a planning failure.

Helm Terminal keeps your complete portfolio picture current — showing where gains and losses sit across all your investment accounts so you can make tax-smart decisions throughout the year, not just in December.

Try Helm free to see your complete capital gains picture across all accounts.

The Bottom Line

Capital gains taxes are one of the largest drags on investment returns — and one of the most controllable. By understanding the difference between short-term and long-term rates, systematically harvesting losses, using specific lot identification, and timing realizations thoughtfully, you can keep significantly more of what your portfolio earns. The tax code penalizes the uninformed. Do not be uninformed.