Tax-loss harvesting is the practice of intentionally selling investments that have lost value to realize a capital loss that can offset capital gains elsewhere in your portfolio. If your total losses exceed your total gains in a year, you can deduct up to $3,000 of the net loss against ordinary income, with any remaining losses carried forward to future years. The key is to immediately reinvest the proceeds in a similar but not identical position to maintain your market exposure — if you repurchase the same security within 30 days before or after the sale, the wash sale rule will disallow the loss. Tax-loss harvesting is most valuable in years when you have significant realized gains, and many robo-advisors now perform it automatically on a continuous basis throughout the year. Over a long investment horizon, consistent tax-loss harvesting can meaningfully improve after-tax returns by deferring taxes indefinitely — and if assets are eventually stepped up at death, those deferred taxes may never be collected at all.