Tax · 7 min read
Capital Gains and Tax-Loss Harvesting
Year-end is when investors can deliberately realize losses to offset gains — but only if trades settle in the right tax year and you avoid the wash-sale trap.
How capital gains are taxed
- Short-term (held ≤1 year): taxed at ordinary income rates
- Long-term (held >1 year): preferred rates of 0%, 15%, or 20% depending on income
- Net investment income tax (NIIT) of 3.8% may apply on top for higher earners
- State tax usually treats all gains as ordinary income — model both layers
Tax-loss harvesting mechanics
Selling a losing position generates a capital loss that first offsets capital gains of the same character (short vs. long), then offsets the other character, and finally up to $3,000 of ordinary income per year. Unused losses carry forward indefinitely.
- Net short-term losses against short-term gains first (best because they offset higher-taxed gains)
- Then net against long-term gains
- Excess loss: up to $3,000 against ordinary income each year
- Carryforward what you can't use — it doesn't expire
