
Tax-Loss Harvesting Explained: How It Works, Rules & Benefits
Financial Guidance Disclaimer
This article provides educational information only and does not constitute financial advice. Financial decisions should be based on your personal circumstances.
Investing inevitably involves both gains and losses. While gains are welcome, they often come with a tax bill. Losses, on the other hand, can offer a silver lining: they can be used to offset gains and reduce taxable income through a strategy known as tax-loss harvesting. This technique does not make a losing investment profitable, but when applied correctly, it can lower your current tax liability and improve after‑tax returns.
Tax-loss harvesting is an investment strategy where investors sell securities that have declined in value to realize capital losses, which may be used to offset realized capital gains and, up to certain limits, ordinary income, while adhering to IRS rules including the wash‑sale rule. It defers rather than eliminates taxes and must be executed with a clear understanding of the rules and a focus on your broader investment goals.
What Is Tax-Loss Harvesting in One Sentence?
Tax-loss harvesting is a tax-management strategy in which an investor sells investments at a loss to offset realized capital gains and, up to $3,000 per year, ordinary income, while reinvesting the proceeds in a similar but not substantially identical asset to maintain market exposure. The tax benefit is a deferral, not a permanent savings.
Key Takeaways
Tax-loss harvesting involves selling investments at a loss to offset realized capital gains and, if losses exceed gains, up to $3,000 of ordinary income per year.
The wash‑sale rule prohibits repurchasing the same or a substantially identical security within 30 days before or after the sale, or the loss will be disallowed.
The strategy defers taxes, not eliminates them. Selling a losing investment lowers your cost basis in the replacement, which may increase future taxable gains.
Tax-loss harvesting is only available in taxable brokerage accounts; retirement accounts do not generate annual taxable gains and losses.
Investment decisions should drive tax decisions, not the reverse. A sound long‑term strategy should never be compromised solely for a current‑year tax benefit.
Professional guidance is recommended for complex situations, multiple accounts, or large portfolios.
What Is Tax-Loss Harvesting?
Tax-loss harvesting operates within the tax rules for capital gains and losses. A capital gain arises when you sell an investment for more than your cost basis—the amount you paid, adjusted for commissions, reinvested dividends, and corporate actions. A capital loss occurs when you sell for less than your cost basis.
These gains and losses become realized only when you sell the asset. While you continue to hold an investment, any change in value is an unrealized gain or loss, which does not trigger a tax event.
Tax-loss harvesting involves intentionally selling investments that have declined below their cost basis to realize a capital loss. This loss can then be used to offset realized capital gains in the same tax year. If losses exceed gains, up to $3,000 of the net loss ($1,500 for married individuals filing separately) may be deducted from ordinary income. Unused losses can be carried forward indefinitely to offset future gains or income. The Internal Revenue Code permits this netting as a way to tax only net economic gains.
How Tax-Loss Harvesting Works
The process follows a systematic sequence, but each step requires attention to detail.
Step 1: Identify losing positions. Review your taxable brokerage account for securities trading below their cost basis. Only taxable accounts qualify; tax‑advantaged retirement accounts do not generate annual taxable gains and losses.
Step 2: Sell the security to realize the loss. Execute the sell order. For example, if you purchased 100 shares of a stock for $5,000 and sell them for $3,500, you have realized a $1,500 loss. The transaction date determines the tax year in which the loss is recognized.
Step 3: Offset gains or income. Apply the loss against realized gains of the same type (short‑term losses offset short‑term gains; long‑term losses offset long‑term gains). If one type of loss exceeds its corresponding gains, it can offset the other type. After netting, if total losses still exceed total gains, up to $3,000 can be deducted from ordinary income. Any remainder carries forward to future years.
Step 4: Reinvest while respecting the wash‑sale rule. To maintain your desired asset allocation, you may want to reinvest the proceeds. However, if you repurchase the same or a “substantially identical” security within 30 days before or after the sale, the loss will be disallowed under the wash‑sale rule. Many investors choose a similar but not identical investment—for example, selling an S&P 500 index fund and buying a total U.S. stock market fund—but the IRS has not precisely defined “substantially identical.”
Step 5: Report correctly. Your brokerage will issue Form 1099‑B summarizing proceeds and cost basis. You must report the sales on Form 8949 and Schedule D of your tax return. Accurate records are essential.
Capital Gains and Capital Losses Explained
Understanding tax-loss harvesting requires a clear grasp of how gains and losses are taxed.
Short‑term capital gains result from selling investments held for one year or less. These are generally taxed as ordinary income, with federal rates ranging from 10% to 37% depending on taxable income.
Long‑term capital gains apply to investments held more than one year. These benefit from preferential tax rates: 0%, 15%, or 20%, depending on taxable income. High‑income taxpayers may also owe an additional 3.8% Net Investment Income Tax (NIIT) on investment income above certain thresholds.
Capital losses are categorized as short‑term or long‑term based on the holding period of the asset sold. Losses offset gains of the same character first. If a net loss remains, it can offset the other type of gain. After all netting, a net capital loss of up to $3,000 ($1,500 if married filing separately) can be deducted from ordinary income in the current year. Any unused loss carries forward indefinitely.
State tax treatment of capital gains varies, and some states do not recognize federal deductions. Tax laws are subject to change, so investors should verify current rates and rules with the IRS or a qualified tax professional.
The Wash-Sale Rule Explained
The wash‑sale rule (Internal Revenue Code Section 1091) is a critical guardrail that prevents investors from recognizing a tax loss without meaningfully changing their economic exposure. Under this rule, a loss is disallowed if you purchase the same or a “substantially identical” security within 30 days before or after the sale.
What is “substantially identical”? The IRS has not provided a comprehensive list, but the term clearly includes the same stock or an identical ETF. It may also encompass an option or contract to acquire the security. Swapping one S&P 500 index fund for another from a different provider is widely viewed by tax professionals as substantially identical, but swapping an S&P 500 fund for a total market fund is generally not, because the underlying portfolios differ. Because the definition involves judgment, investors should exercise caution and consider professional guidance.
How wash sales affect your basis. When a loss is disallowed, the amount is added to the cost basis of the newly acquired shares. This defers, rather than eliminates, the tax benefit. The loss is effectively recognized when the replacement shares are later sold in a non‑wash‑sale transaction.
Common triggers. Wash sales can occur inadvertently through:
Buying the same stock or fund in a different account (including a spouse’s account, depending on ownership).
Automatic dividend reinvestment plans that purchase additional shares around the time of a sale.
Selling a stock at a loss and buying a call option on the same stock within the window.
Strictly monitoring trades across all household accounts during the 61‑day window (30 days before, day of sale, and 30 days after) is essential.
Benefits of Tax-Loss Harvesting
When properly executed, tax-loss harvesting can offer several potential advantages:
Current‑year tax reduction: Realized losses can directly offset realized gains, potentially reducing or eliminating the tax owed on profitable sales.
Ordinary income offset: Up to $3,000 of net capital losses can be deducted against ordinary income annually, providing an immediate tax benefit even in the absence of capital gains.
Loss carryforward: Unused losses can be carried forward indefinitely, creating a deferred tax asset that can offset future gains or income.
Portfolio rebalancing opportunity: Harvesting losses provides a natural moment to review your holdings and reallocate toward your target asset allocation without triggering additional taxable gains.
Behavioral discipline: The strategy can encourage investors to sell losing positions they might otherwise hold for emotional reasons, thereby improving portfolio quality and diversification.
It is important to remember that tax-loss harvesting defers taxes rather than eliminating them. Because you sell at a lower price and reinvest at a similarly low price, the replacement investment will have a lower cost basis. When you eventually sell that replacement, the taxable gain may be larger. The primary benefit lies in the time value of money—deferring a tax payment into the future can be advantageous, particularly if you expect to be in a lower tax bracket later.
Limitations and Risks
Tax-loss harvesting is not universally beneficial and carries its own set of risks and complexities.
Tax deferral, not elimination. The eventual tax liability remains. If future tax rates are higher, or if your income bracket increases, the deferred tax could exceed the initial savings.
Transaction costs. While many brokers offer commission‑free stock and ETF trades, bid‑ask spreads and possible fees on mutual fund transactions can reduce the net benefit, particularly for small losses.
Market risk. There is a brief period when you are out of the market. In a rapidly rising market, missed gains could exceed the tax savings.
Complexity. The strategy adds recordkeeping and tax‑filing complexity. You must track cost basis accurately and correctly report wash sales, especially if you hold similar securities in multiple accounts.
Wash‑sale pitfalls. Even meticulous investors can inadvertently violate the rule, especially when dividend reinvestment or automated transactions are involved.
Not applicable in retirement accounts. Tax‑advantaged accounts like IRAs and 401(k)s already defer or eliminate taxes on investment gains; selling within these accounts has no impact on your current tax liability.
Who May Benefit From Tax-Loss Harvesting?
Tax-loss harvesting is most relevant for investors who:
Hold significant assets in taxable brokerage accounts.
Have realized capital gains during the tax year from sales or mutual fund capital gain distributions.
Are in a higher marginal tax bracket, where offsetting short‑term gains or ordinary income provides a larger tax saving.
Actively manage their portfolios or work with a professional who does.
It is generally less useful for investors whose holdings are entirely within tax‑advantaged retirement accounts, who have negligible realized gains, or who are in very low tax brackets.
When Tax-Loss Harvesting May Not Make Sense
There are several situations in which tax-loss harvesting may offer limited benefit or even be counterproductive:
No taxable account or no gains. If all your investments are in retirement accounts, or you have no realized gains, there is little to offset.
Small potential savings. For small losses, the tax benefit may not justify the transaction costs and administrative effort.
Unclear replacement strategy. If you do not have a suitable replacement investment that maintains your target allocation, you risk deviating from your long‑term plan.
Purely tax‑motivated selling. Selling a fundamentally sound investment solely for a tax loss could harm your portfolio’s long‑term performance.
Anticipated near‑term sale of the replacement. If you expect to sell the replacement investment soon, the deferred tax may not be deferred long enough to provide meaningful value.
Tax considerations overriding investment discipline. The tax tail should not wag the investment dog. Your financial goals, risk tolerance, and time horizon should drive decisions; taxes are a secondary consideration.
Tax-Loss Harvesting Does Not Mean Market Timing
It is important to distinguish tax‑loss harvesting from market timing. Harvesting losses is not about predicting market bottoms or top‑calling; it is simply a tax‑management technique. You are not selling because you expect further declines; you are selling to realize a tax loss and immediately reinvesting in a similar asset to maintain market exposure. The goal is to capture the tax benefit while staying invested according to your long‑term strategy.
Avoiding emotional decisions is critical. Investors sometimes hold losing positions out of hope that they will recover, or sell out of fear during a downturn. Tax-loss harvesting, when approached systematically, can provide a disciplined framework for acting on losses rather than reacting to market noise.
Tax-Loss Harvesting vs Retirement Accounts
Feature | Taxable Brokerage Account | Traditional IRA / 401(k) | |
|---|---|---|---|
Tax on gains while invested | Capital gains taxed only when realized | Gains not taxed until withdrawal | Gains not taxed if qualified |
Tax-loss harvesting available? | Yes, by selling losing positions | No; transactions within the account are not taxable events | No |
Contribution limits | No limits, but no tax deduction for contributions | Annual limits apply; contributions may be deductible | Annual limits apply; contributions are after‑tax |
Tax on withdrawals | Only gains are taxed; preferential rates for long‑term gains | Withdrawals taxed as ordinary income | Withdrawals tax‑free if qualified |
Complexity | Higher; must track cost basis and wash sales | Lower; only contributions and withdrawals have tax implications | Lower; tracking contributions and conversions matters |
Tax-loss harvesting is exclusively a taxable‑account strategy. Attempting to harvest losses in an IRA, for example, would provide no tax benefit because sales within an IRA do not generate taxable gains or losses. Importantly, buying a security in an IRA that you also sold at a loss in a taxable account can still trigger a wash‑sale rule violation, according to IRS guidance, so cross‑account monitoring is necessary.
Common Tax-Loss Harvesting Mistakes
Mistake | Better Approach |
|---|---|
Letting tax benefits override investment goals | Maintain a long‑term investment plan; tax savings are secondary. |
Violating wash‑sale rules | Monitor all accounts for identical or substantially identical purchases within the 61‑day window. |
Ignoring transaction costs | Ensure the net tax benefit exceeds any bid‑ask spreads, commissions, or fees. |
Failing to track cost basis accurately | Use your brokerage’s cost basis records and keep your own documentation. |
Assuming losses always improve after‑tax returns | Evaluate whether the deferral benefit is meaningful given your tax situation and time horizon. |
Making emotional decisions | Use a predetermined, systematic approach rather than reacting to market movements. |
Forgetting about dividend reinvestment | Temporarily suspend automatic reinvestment or direct dividends to cash before harvesting. |
A Behavioral Perspective
Behavioral finance research helps explain why tax-loss harvesting can be both appealing and challenging. The disposition effect, first documented by Shefrin and Statman (1985), describes the tendency of investors to sell winning investments too early and hold losing investments too long. Tax-loss harvesting can serve as a counterweight to this bias by providing a concrete reason to sell losing positions: the tax loss has tangible value.
Loss aversion—the finding that losses are psychologically about twice as powerful as gains—can cause investors to avoid selling at a loss, even when it is prudent. Tax-loss harvesting reframes the loss as a tax benefit, potentially reducing the emotional barrier to making a rational portfolio decision.
However, tax-loss harvesting can also introduce its own biases. Investors might become so focused on generating losses that they lose sight of the portfolio’s overall health. Maintaining a disciplined, plan‑driven approach mitigates this risk.
Tax-Loss Harvesting Strategies
Annual review. Most individual investors review their taxable accounts near year‑end (or at regular intervals) to identify unrealized losses. Harvesting losses in the final quarter allows you to offset gains realized earlier in the year and gives you time to reinvest before year‑end while respecting the wash‑sale window.
Opportunistic harvesting during market declines. Broad market downturns create widespread losses. Opportunistic harvesting involves selling during these periods to capture larger losses and reinvesting at lower prices. This approach requires a pre‑established plan for replacement investments so you can act quickly without abandoning your asset allocation.
Automated tax‑loss harvesting. Robo‑advisors and some managed account platforms offer continuous, algorithm‑driven harvesting. These services monitor portfolios for losses, execute trades, and manage wash‑sale rules automatically. While convenient, they charge management fees and may not coordinate perfectly with holdings outside the robo‑advisor account, creating wash‑sale exposure. Investors should understand the service’s methodology and costs before enrolling.
Hypothetical Examples
These examples are hypothetical and simplified for educational purposes. They assume certain federal tax rates and exclude factors such as state taxes, fees, deductions, and individual circumstances. Actual tax outcomes will vary.
Example 1: Offsetting Short‑Term Gains
In 2025, an investor in the 32% federal bracket sells Stock A, held for six months, realizing a $5,000 short‑term gain. Later that year, the investor sells Stock B at a $3,000 short‑term loss. The loss offsets the gain, reducing the net short‑term gain to $2,000. Without harvesting, the estimated federal tax on the $5,000 gain would be approximately $1,600 (32% × $5,000). With harvesting, the estimated tax on $2,000 is approximately $640, a reduction of about $960. The proceeds from Stock B are reinvested in a diversified ETF that differs from Stock A and B, maintaining market exposure.
Example 2: Reducing Ordinary Income
An investor has no realized capital gains in the current year but sells several holdings for a net long‑term capital loss of $4,000. They deduct $3,000 from ordinary income, reducing taxable income from $80,000 to $77,000. At a 22% marginal rate, this saves approximately $660 in federal taxes. The remaining $1,000 loss carries forward to the next year. The investor reinvests in a broad market fund, preserving their strategic allocation.
Example 3: Wash‑Sale Trigger
On December 15, an investor sells 100 shares of ABC mutual fund at a $2,000 loss. On December 28, the investor repurchases the same ABC mutual fund in the same account. Because the repurchase occurred within 30 days of the sale, the loss is disallowed under the wash‑sale rule. The $2,000 disallowed loss is added to the basis of the new shares. When those shares are later sold in a non‑wash‑sale transaction, the loss will effectively be recognized.
Comparison Tables
Realized vs Unrealized Gains and Losses
Status | Definition | Tax Treatment |
|---|---|---|
Unrealized gain | Investment value exceeds cost basis but has not been sold | No tax due until sold |
Unrealized loss | Investment value is below cost basis but has not been sold | No tax deduction until realized |
Realized gain | Gain is locked in after a sale | Taxable in year of sale |
Realized loss | Loss is locked in after a sale | Can offset gains and up to $3,000 of ordinary income |
Taxable Brokerage Account vs Retirement Accounts
Feature | Taxable Brokerage Account | Traditional IRA / 401(k) | |
|---|---|---|---|
Tax on gains while invested | Capital gains taxed only when realized | Gains not taxed until withdrawal | Gains not taxed if qualified |
Tax-loss harvesting available? | Yes, by selling losing positions | No; transactions within the account are not taxable events | No |
Contribution limits | No limits, but no tax deduction for contributions | Annual limits apply; contributions may be deductible | Annual limits apply; contributions are after‑tax |
Tax on withdrawals | Only gains are taxed; preferential rates for long‑term gains | Withdrawals taxed as ordinary income | Withdrawals tax‑free if qualified |
Complexity | Higher; must track cost basis and wash sales | Lower; only contributions and withdrawals have tax implications | Lower; tracking contributions and conversions matters |
Benefits and Limitations of Tax-Loss Harvesting
Potential Benefit | Important Limitation |
|---|---|
Reduce current‑year capital gains tax | Defers tax to a future year; may not reduce total tax |
Offset up to $3,000 of ordinary income | Excess losses only benefit if you have future gains or income |
Opportunity to rebalance and diversify | Requires careful selection of replacement assets to avoid wash sales |
Behavioral framework for selling losers | May lead to over‑emphasis on tax over investment merit |
Common Mistakes and Better Alternatives
Mistake | Better Approach |
|---|---|
Letting tax benefits override investment goals | Maintain a long‑term investment plan; tax savings are secondary. |
Violating wash‑sale rules | Monitor all accounts for identical or substantially identical purchases within the 61‑day window. |
Ignoring transaction costs | Ensure the net tax benefit exceeds any bid‑ask spreads, commissions, or fees. |
Failing to track cost basis accurately | Use your brokerage’s cost basis records and keep your own documentation. |
Assuming losses always improve after‑tax returns | Evaluate whether the deferral benefit is meaningful given your tax situation and time horizon. |
Making emotional decisions | Use a predetermined, systematic approach rather than reacting to market movements. |
Forgetting about dividend reinvestment | Temporarily suspend automatic reinvestment or direct dividends to cash before harvesting. |
When Tax-Loss Harvesting May or May Not Apply
May Be Useful | May Provide Limited Benefit |
|---|---|
You have a taxable brokerage account | All your investments are in retirement accounts |
You have realized capital gains this year | You have negligible gains or are in the 0% capital gains bracket |
You have large unrealized losses | Transaction costs or complexity outweigh the tax benefit |
You are in a high tax bracket | The investment you would sell remains an important part of your strategy and no suitable replacement exists |
Frequently Asked Questions
What is tax-loss harvesting?
Tax-loss harvesting is a strategy of selling investments at a loss to offset realized capital gains and, if losses exceed gains, up to $3,000 of ordinary income per year. The proceeds are typically reinvested in a similar, but not substantially identical, asset to maintain market exposure. It defers, rather than eliminates, taxes.
How does tax-loss harvesting work?
You identify securities in a taxable account that are worth less than their cost basis, sell them to realize the loss, and use the loss to offset gains. If losses exceed gains, up to $3,000 can be deducted from ordinary income. Any unused loss carries forward.
Is tax-loss harvesting legal?
Yes. It is an established, IRS‑permitted tax‑management strategy. It must be conducted in compliance with the wash‑sale rule and other tax regulations. It is not a loophole; it is explicitly provided for under the tax code.
Does tax-loss harvesting eliminate taxes?
No. It defers tax liability. Because you reinvest at a lower cost basis, you may recognize a larger gain when the replacement security is eventually sold. The benefit lies in the time value of deferring the tax payment and possibly paying at a lower rate in the future.
What is the wash-sale rule?
The wash‑sale rule disallows a capital loss if you acquire the same or a substantially identical security within 30 days before or after the sale. The disallowed loss is added to the basis of the replacement shares. The rule applies across all accounts you control.
Can I use tax-loss harvesting in my IRA?
No. Transactions inside an IRA or 401(k) do not generate taxable gains or losses, so there is no opportunity to harvest losses. Additionally, buying a security in an IRA that you sold at a loss in a taxable account can trigger the wash‑sale rule.
When is tax-loss harvesting most useful?
It is most beneficial when you have realized capital gains to offset, are in a high tax bracket, or have substantial unrealized losses. It can also provide a deduction against ordinary income when losses exceed gains.
Can beginners do tax-loss harvesting?
Beginners can implement the strategy, but it requires understanding cost basis, holding periods, and the wash‑sale rule. Starting with a simple, end‑of‑year review of a single taxable account is often a prudent way to begin.
What investments are suitable for harvesting?
Stocks, bonds, ETFs, and mutual funds in taxable accounts can be harvested if they have declined below cost basis. Only taxable accounts qualify.
Does tax-loss harvesting increase investment returns?
Not directly. It can improve after‑tax returns by deferring taxes, but it does not change the underlying investment’s performance. The net benefit depends on your tax bracket, time horizon, and how tax savings are reinvested.
How often should I review for losses?
An annual review, particularly late in the calendar year, is sufficient for most investors. Significant market declines may present additional opportunities, but frequent trading solely to generate losses is generally not advisable.
What if my losses exceed my gains?
If total losses exceed total gains, you can deduct up to $3,000 ($1,500 if married filing separately) from ordinary income. Any remaining loss carries forward indefinitely to offset future gains or income.
Are there costs to tax-loss harvesting?
Potential costs include brokerage commissions (though many trades are now commission‑free), bid‑ask spreads, and the time and effort required to manage the strategy. Automated services charge management fees.
Should I sell an investment just for the tax loss?
Generally, no. The investment decision should be based on your long‑term goals and the security’s fundamentals. Tax-loss harvesting should be a secondary benefit, not the primary reason for selling an otherwise sound holding.
Do I need a tax professional?
While not required, a tax professional can help navigate complex situations involving multiple accounts, large portfolios, or wash‑sale uncertainties. They can also ensure proper reporting and integration with your overall financial plan.
Conclusion
Tax-loss harvesting is a practical tool for managing investment taxes, but it is one component of a broader financial strategy. It does not guarantee higher returns, and its value depends on individual circumstances, including your tax bracket, portfolio composition, and time horizon. Above all, investment objectives should take precedence over tax considerations. A disciplined, long‑term approach that uses tax‑loss harvesting where appropriate can contribute to improved after‑tax outcomes, provided it is executed with care and a clear understanding of the rules.
Sources and References
IRS Publication 550 — Investment Income and Expenses (irs.gov)
IRS Topic No. 409 — Capital Gains and Losses (irs.gov)
Internal Revenue Code Section 1091 — Wash Sales
Shefrin, H. and Statman, M. (1985). "The Disposition to Sell Winners Too Early and Ride Losers Too Long." Journal of Finance, Vol. 40, No. 3.
SEC Investor Education: sec.gov/investor
FINRA Investor Education: finra.org/investors
Disclaimer: This article is for educational and informational purposes only and does not constitute financial, investment, or tax advice. Tax laws and IRS regulations are subject to change and vary based on individual circumstances. Readers should consult a qualified tax professional before implementing any tax‑loss harvesting strategy.
Recommended Articles

Federal Income Tax Basics: How the Tax System Works and How to Make Smarter Money Decisions
Understand federal income taxes with this beginner’s guide to tax brackets, deductions, credits, and withholding. Learn how to lower your tax bill legally.

Dollar-Cost Averaging Explained: A Beginner's Guide to Investing Consistently
Learn what dollar-cost averaging is, how it works, and how it compares to lump‑sum investing. This beginner‑friendly guide covers benefits, risks, examples, and FAQs to help you invest consistently.
