BlogBuilding a PortfolioLesson 13 of 17

Capital Gains, Tax-Loss Harvesting and the Wash-Sale Rule (US)

A graphite calendar, matching steel-blue tokens and a silver coin represent replacement purchases and tax timing.

You sell shares for a $1,500 loss and buy them back ten days later. You own the same number of shares again. Yet the loss you expected to deduct may have to wait.

The investment loss is real. Whether you can use it on a tax return is a separate question.

The examples use 2025 US federal tax rules for a US resident individual holding common stock in a taxable account. This is a framework for understanding a sale; your circumstances and state or local taxes can change the bill.

A sale turns a change into a tax event

Your adjusted tax basis is your cost for tax purposes. For purchased shares, it starts with what you paid, then changes with any required tax adjustments.

An unrealized gain is value above that basis while you still own the shares; an unrealized loss is value below it. Selling turns that change into a realized capital gain or loss.

Realized gain or loss=Sale proceeds − Adjusted tax basis

Say you bought 100 shares for $10,000 and sell them all for $8,500, with no fees or basis adjustments. Your result is $8,500 − $10,000 = −$1,500: a loss of $15 per share.

That batch is a tax lot: shares from one purchase, with their own date and basis. Buying the same stock on three dates creates three lots. Each can have a different gain or loss and holding period. One stock name can hide several tax histories.

Holding time changes the tax rate

For a regular stock purchase, more than one year is long term; one year or less is short term. Say you held the 100 shares for 18 months: the $1,500 loss is long term.

Net short-term capital gains face ordinary income tax rates, like wages. Net long-term capital gains on these shares can receive lower rates. The same dollar of profit can get a different tax rate depending on how long you held the shares.

Dividends count toward total return, but their tax rate has its own holding-period test.

Qualified dividends are those eligible for capital-gain tax rates. The payer must be a US corporation or a qualifying foreign corporation, and you must hold the shares long enough.

For common stock, that means more than 60 days within a 121-day window starting 60 days before the ex-dividend date. That is when shares begin trading without the right to that dividend. Both holding-period tests exclude the purchase day and include the sale day.

Receiving a dividend and qualifying for its lower tax rate are different tests.

Reinvesting dividends creates new tax lots using money earned inside the account. A taxable dividend stays taxable even if you never take the cash out.

What harvesting a loss changes

Tax-loss harvesting means selling an investment at a loss so that loss can offset taxable gains or, within limits, other income. Buying a suitable replacement can keep you invested.

Suppose you also have $4,000 of realized long-term gains in the same tax year. Use an assumed flat 15% rate on these gains, with no other gains, losses, rate changes or additional taxes. With the entire $1,500 loss usable:

  • Net gain: $4,000 − $1,500 = $2,500.
  • Tax without the loss: $4,000 × 15% = $600.
  • Tax with the loss: $2,500 × 15% = $375.

The $225 tax reduction softens the $1,500 investment loss. It does not undo it.

Harvesting can defer tax: a replacement bought at a lower cost can leave you with a larger taxable gain when you sell later. The benefit depends on future prices and tax rates, trading costs and how the replacement behaves. A tax benefit does not make two investments interchangeable.

Losses offset gains first. Short-term gains and losses are netted against each other, as are long-term gains and losses. An excess loss in one group can then offset a gain in the other.

Any net loss left can offset up to $3,000 of other income a year, or $1,500 if married filing separately. Unused losses become a capital-loss carryforward for later years. The limit applies after offsetting gains: $10,000 of usable capital losses can still offset $10,000 of capital gains.

Check both sides of the sale date

A wash sale blocks a loss deduction when you sell shares at a loss and buy replacements within 30 days before or after the sale. It covers the same or substantially identical securities: investments treated as effectively the same for this tax rule.

The window covers 61 calendar days, including the sale date. Buying first and selling later can trigger it too.

Change the example: ten days after the loss sale, you buy back all 100 shares for $8,700 and keep them through year-end. This is an alternative to the usable-loss case. Day +10 falls inside the window:

The purchase check starts before you sell
61 calendar days, including the sale date
Illustrative trades within the IRS Publication 550 (2025) window; spacing shows order, not elapsed time.

The $1,500 loss is disallowed now and added to the replacement shares' cost: $8,700 + $1,500 = $10,200 of adjusted basis. Their holding period also includes the time you held the original shares.

That higher basis reduces a later gain or increases a later loss. For the sale year, the $4,000 of gains stays taxable, and the tax on those gains stays at $600.

Compare the two outcomes for the sale year. “New basis” belongs to the replacement shares:

CaseUsable lossNet gainNew basis
No wash sale$1,500$2,500n/a
Full repurchase$0$4,000$10,200

Automatic dividend reinvestments count as purchases. Purchases in your other accounts or by your spouse can also trigger the rule. A broker's tax statement may miss these connections; a loss can be disallowed even when the statement shows no wash sale.

Only the loss on matched shares is affected. If just 20 of the 100 shares were replaced within the window, $15 × 20 = $300 would be disallowed. A small reinvestment can block part of a deduction without blocking all of it.

Keep the investment decision first

Whether two securities are “substantially identical” depends on the investments and the details of the transaction. A different ETF ticker or fund issuer does not, by itself, guarantee that a replacement avoids the rule.

Before counting on a tax benefit from a sale, check:

  • Account and lot. The account type, basis and holding period of the shares being sold.
  • Net result. Other realized gains, losses and carryforwards.
  • Replacement purchases. Both sides of the sale date, including other accounts, your spouse and reinvestments.

Purchase and sale confirmations and records of basis adjustments support that calculation.

Taxes are one cost of rebalancing and one input to deciding when to sell. An unsuitable risk does not become suitable because selling it creates a tax bill. The next lesson compares accounts that change how investments are taxed and when money is accessible.

In short

  • Realized gain or loss equals sale proceeds minus adjusted tax basis.
  • Holding shares for more than a year changes how gains are taxed; qualified dividends have a separate holding-period test.
  • A usable loss can reduce tax on gains; it does not repay the investment loss.
  • Check purchases before and after a loss sale, including other accounts and reinvestments.
  • In a taxable account, a wash-sale loss moves into the replacement shares' basis. An IRA replacement does not preserve it.
All posts

For education only, not investment advice.