What is tax-loss harvesting?

Selling at a loss to lower this year's tax, the yearly limit, and the wash-sale rule

Tax-loss harvesting is selling an investment in a taxable account for less than you paid, so the loss offsets capital gains and, up to a yearly limit, other income. Loss the limit does not let you use carries forward to later years, and the wash-sale rule disallows the loss if you buy the same or a substantially identical investment around the sale.

Losses first cancel your capital gains. What is left can reduce other income by up to $3,000 a year ($1,500 married filing separately), and the rest carries forward. Buying substantially identical shares within 30 days before or after the sale disallows the loss.

The limits and lines, 2027

20272026
Net capital loss you can take against other income$3,000$3,000
The same, married filing separately$1,500$1,500
Wash-sale window, before or after the sale30 days30 days
Top of the 0% long-term gains bracket, single (taxable income)$51,050$49,450
Top of the 0% long-term gains bracket, married filing jointly$102,100$98,900
Net investment income tax (3.8%) from modified AGI, single$200,000$200,000
The same, married filing jointly$250,000$250,000

Sources: IRS Topic 409 (the loss limit and carryover), IRS Publication 550 (wash sales), IRS Rev. Proc. 2026-35 (Nov 2026) for 2027 and IRS Rev. Proc. 2025-32 (Oct 2025); IRS IR-2025-103 (OBBBA amendments) for 2026.

Worked example: harvesting a loss in 2027

A single filer, 60, with $70,000 of other income, has $5,000 of long-term gains this year and sells other shares at a $20,000 loss:

Amount
Loss used against the gains$5,000
Loss taken against other income$3,000
Loss carried forward to next year$12,000
Federal tax without the loss$7,039.50
Federal tax with the loss$5,792.00
Tax lower this year$1,247.50

From the ReadyAimRetire tax engine on the 2027 brackets. Without the loss, the gains would have been taxed at 15%.

The $12,000 carried forward offsets gains in later years first, then up to $3,000 of other income a year, until it is used up. Shares bought back after the wash-sale window have their new price as their cost basis, so selling them later at the same value shows a larger gain.

How it is taxed

Going in
Only in a taxable account. A loss inside an IRA, 401(k) or Roth account is never deductible, and buying the same shares in your IRA or Roth IRA within the wash-sale window disallows a loss taken in the taxable account, without raising the IRA's basis (Rev. Rul. 2008-5).
While it grows
A loss counts only when you sell. A wash sale defers the loss rather than ending it: the disallowed loss is added to the cost of the new shares, and their holding period includes the old shares' (IRS Publication 550).
Coming out
Losses offset capital gains first, then up to $3,000 of other income ($1,500 married filing separately). The rest carries forward to later years until it is used up (IRS Topic 409).
At death
Losses the person carried forward can't be deducted on the estate's income tax return (IRS Publication 559). Shares held at death take their value at death as basis (a step-up, or a step down), so a loss not taken in life is not taken at all.

Tax-loss harvesting vs tax-gain harvesting

Tax-gain harvesting is the opposite: selling at a gain in a year when it falls in the 0% long-term gains bracket, then buying back so the cost basis is higher. The wash-sale rule applies only to losses, so the shares can be bought back at once.

A married couple, both 66, with $40,000 of Social Security and $40,000 of IRA withdrawals has $91,100 of room below the top of the 0% bracket in 2027 ($102,100 of taxable income). Gains also make more of their Social Security taxable ($14,400 more), so $76,625 of gains is what the 0% rate covers, and selling that much adds $1,447.50 of federal tax on their other income.

See a loss carryforward in your whole plan

In ReadyAimRetire, the Taxes box's Advanced Tax Modeling has a "Tax Loss Carryforward": the planner nets the carryover against each year's gains, then up to the yearly limit of other income, in the order of the IRS Capital Loss Carryover Worksheet. The planner does not sell at a loss for you; a taxable account's "Cost basis" on the Accounts page sets how much of each sale is gain.

Plan my retirement

Free to get started.

Related

Sources: IRS Topic 409, Capital gains and losses; IRS Publication 550, Investment Income and Expenses (Wash Sales); Rev. Rul. 2008-5 (Internal Revenue Bulletin 2008-3); IRS Publication 559, Survivors, Executors, and Administrators; 26 USC 1212; IRS Rev. Proc. 2026-35 (2027 tax brackets). For education only, not tax advice. Rules checked November 2026.

Tax-loss harvesting questions

Selling an investment in a taxable account for less than you paid, so the loss offsets capital gains and up to $3,000 a year of other income. Loss you can't use that year carries forward.

All of it against capital gains, then up to $3,000 against other income ($1,500 if married filing separately). The rest carries forward to later years until it is used up.

Selling at a loss and buying substantially identical stock or securities within 30 days before or after the sale, including in your IRA. The loss is disallowed for now and added to the new shares' cost; when the IRA bought them, the IRA's basis does not rise.

No. Gains and losses inside an IRA, 401(k) or Roth account are not taxed or deducted, so it works only in a taxable brokerage account.