How to Diversify RSU and ESPP Shares Without Triggering Capital Gains
The Tax Trade-Offs of Concentrated Equity Compensation — and the Strategies Worth Knowing
Tech workers accumulate employer stock in two fundamentally different ways: RSUs that vest as ordinary income, and ESPP shares purchased at a discount. The tax situation at each stage is different, and so is the problem of diversification. RSUs create a concentration risk almost by design — each vest adds to a single-stock position without any capital gains problem on the vested amount, but holding beyond vest creates one. ESPP shares arrive at a discount, creating an immediate gain the moment they are purchased, and a larger one if held.
Understanding what type of gain exists — and when it was created — determines which diversification paths are available and what they cost. This guide maps out the options, the trade-offs, and the conditions under which each approach makes sense.
The Starting Point: How RSU and ESPP Gains Are Different
RSUs vest as ordinary income. On the day shares are released, the full market value is reported on your W-2 and taxed at your marginal income tax rate — the same as salary. This happens regardless of whether you sell. At that moment, your cost basis in the shares equals the market value at vest. If you sell immediately, there is no capital gain at all — you owe nothing beyond the ordinary income already recognized at vest.
The capital gains problem with RSUs arises only when shares are held beyond the vest date and the price rises. Every dollar of appreciation above the vest-date price becomes a capital gain — short-term if sold within a year of vest, long-term if held more than a year. For a senior tech worker who has been holding vested shares for years, the embedded gain can be substantial: shares that vested at $120 and are now worth $380 carry a $260-per-share long-term capital gain.
ESPP shares work differently. In a qualified Section 423 plan, the purchase price is typically 85% of the lower of the stock price at the start or end of the offering period (the look-back provision). On the purchase date, no taxable event occurs — income is deferred until you sell. When you sell, the tax treatment depends on how long you held:
In a disqualifying disposition (selling before holding two years from the offering date and one year from the purchase date), the discount you received at purchase is taxed as ordinary income, and any additional gain above that is a short-term or long-term capital gain depending on your holding period from the purchase date.
In a qualifying disposition (meeting both holding periods), only a capped portion of the gain is ordinary income — the lesser of your actual gain or the discount at the offering date price. The rest is a long-term capital gain.
The practical implication: ESPP shares sold immediately after purchase always generate ordinary income on the discount, but no capital gains problem. ESPP shares held for qualifying disposition treatment convert part of the gain to long-term capital gains rates, but create concentration risk during the holding period.
For a detailed breakdown of ESPP taxation rules, see Employee Stock Purchase Plan (ESPP).
Why Concentration Risk Compounds Over Time
A single RSU grant creates modest concentration. But RSUs vest quarterly over four years — and many tech workers receive refresher grants before prior grants have fully vested. The result is a continuous inflow of employer stock. An engineer at a company whose stock has appreciated significantly may find that after five to seven years, employer stock represents 30–60% of their total investable net worth, even after selling some shares at each vest.
ESPP compounds this further. An employee contributing the maximum $25,000 per year (the IRS annual limit under Section 423, unchanged since the 1960s) and holding for qualifying disposition treatment adds another concentrated position in the same company, on top of RSU accumulation.
The risk is not theoretical. Concentrated single-stock positions have destroyed wealth across multiple tech cycles — employees who held large positions in companies that subsequently declined significantly experienced permanent capital loss far exceeding any tax savings from deferring a diversification. The tax cost of selling is real, but so is the risk of not selling.
Strategy 1: Immediate Sale at Vest or Purchase
The simplest approach is selling shares promptly — RSUs immediately at vest, ESPP shares immediately after purchase (a disqualifying disposition). Both result in ordinary income on the vest-date value or the discount, respectively, with no capital gains tax owed at the point of sale.
The tax math is clear: if RSUs vest at $200 per share and you sell the same day, you owe ordinary income tax on $200 per share. There is no capital gain. If the stock later rises to $300, the gain occurs in someone else's account. If it falls to $150, you avoided that loss.
The argument for immediate sale is strongest when employer stock already represents a large share of net worth, when the company's outlook carries meaningful uncertainty, or when the combined federal and state tax rates on future long-term capital gains are high enough that the tax savings from holding a year are offset by the concentration risk taken on during that year.
The argument against is that immediate sale forfeits the potential for long-term capital gains treatment on future appreciation. For ESPP specifically, immediate sale misses the qualifying disposition benefit — though as the blog post on ESPP vs. Mega Backdoor Roth demonstrates, the tax-free compounding available through the Mega Backdoor Roth can outweigh the qualifying disposition benefit for families with long time horizons.
Strategy 2: Systematic Selling With Tax-Loss Harvesting
For workers who have already accumulated a concentrated position with significant embedded gains, immediate sale triggers a large taxable event. A more measured approach involves selling shares gradually over multiple years while using losses from other parts of the portfolio to offset the gains realized.
Tax-loss harvesting involves selling positions in the taxable account that have declined in value, realizing the loss, and using it to offset capital gains from the RSU or ESPP sale. Because losses carry forward indefinitely, building a loss carryforward in down years and deploying it against concentrated stock gains in subsequent years is a recognized strategy for managing the tax cost of diversification over time.
The mechanics and limitations of tax-loss harvesting — including the wash-sale rule, the difference between short-term and long-term losses, and the $3,000 annual ordinary income offset — are covered in detail in Tax-Loss Harvesting.
The key constraint relevant to RSU and ESPP diversification: capital losses cannot offset the ordinary income recognized when RSUs vest or when an ESPP disqualifying disposition occurs. They can only offset capital gains from shares sold after the vest date has established a cost basis. This is a commonly misunderstood limitation — harvested losses are a tool for managing capital gains from post-vest appreciation, not a tool for reducing the ordinary income tax owed at vest.
Strategy 3: Direct Indexing to Generate Losses While Maintaining Market Exposure
Direct indexing — owning the individual stocks of a broad market index rather than an ETF — allows for systematic harvesting of individual stock losses even in years when the overall market is flat or rising. A direct indexing account holding 500 individual S&P 500 stocks will typically have dozens of positions below their purchase price at any given time, even in a rising market, because individual stocks are far more volatile than the aggregate index.
For a tech worker selling down a concentrated RSU position over five to ten years, a well-managed direct indexing account can generate meaningful annual loss carryforwards. Those losses offset the capital gains realized on the RSU sale, reducing or eliminating the net capital gains tax owed in each year of the diversification plan.
The trade-off: direct indexing carries higher fees than a simple index ETF (typically 0.15%–0.40% annually versus 0.03%–0.10% for a comparable ETF), requires a larger minimum investment to diversify adequately across individual stocks (typically $250,000–$500,000 or more), and produces more complex tax reporting. The strategy is most compelling for investors in high combined tax brackets — the 32%–37% federal bracket plus high state taxes like California's 13.3% — where the value of each harvested loss is highest.
One wash-sale risk specific to RSU holders: direct indexing platforms monitor positions within their own account but cannot see your payroll vest calendar. If the platform sells your employer's stock to harvest a loss, and an RSU vest delivers new shares of the same stock within 30 days before or after that sale, the wash-sale rule is triggered and the harvested loss is disallowed. For tech workers with quarterly or monthly RSU vesting, this window is almost always open. The standard practice is to exclude your employer's stock from the direct indexing portfolio entirely — which is sound concentration management regardless of the wash-sale consideration.
A full explanation of how direct indexing interacts with concentrated stock diversification is available in Direct Indexing for Tech Workers.
Strategy 4: Exchange Funds for Large Positions
An exchange fund is a private limited partnership into which multiple investors contribute concentrated stock positions. Each investor receives a pro-rata interest in a diversified pool of all contributed stocks without triggering a taxable sale — the contribution is structured as a tax-free exchange under Section 721 of the Internal Revenue Code.
The key tax mechanics: no sale occurs at contribution, so no capital gain is recognized and no capital gains tax or Net Investment Income Tax is owed at the time of contribution. The embedded gain is deferred — it carries into the investor's cost basis in the fund interest — and becomes taxable when the investor exits the fund. The fund must hold contributed assets for at least seven years (the statutory minimum), and most funds are structured for a 10-year horizon. At least 20% of the fund's assets must be held in qualifying illiquid assets, typically real estate.
Exchange funds are typically available only to accredited investors, with minimum contributions usually ranging from $1,000,000 to $5,000,000. For tech workers with positions below those thresholds, exchange funds are generally not accessible.
The break-even analysis — comparing the exchange fund's deferral benefit against its annual fees and the larger future tax bill at exit — depends heavily on the embedded gain size, the combined tax rate, and the fund's fee structure. A California resident with a $3,000,000 position and a 10% cost basis faces a combined tax rate of approximately 37.1% on a direct sale; the exchange fund allows the full $3,000,000 to compound rather than $1,924,100 after tax. A Washington State resident with the same position faces a blended rate of approximately 32.6% under the current two-tier structure (7% on gains up to $1,000,000, 9.9% on gains above $1,000,000).
For a detailed quantitative comparison, see Exchange Fund vs. Selling Stock: Break-Even Analysis. For a full explanation of how exchange funds work, see What Is an Exchange Fund?
Strategy 5: Donor-Advised Funds for Charitable Intent
Contributing appreciated stock directly to a Donor-Advised Fund (DAF) rather than selling the stock and donating cash permanently eliminates both the capital gains tax and the Net Investment Income Tax on the contributed shares. The contributor receives a charitable deduction for the full fair market value of the shares on the contribution date, and the DAF sells the shares inside the account with no tax owed.
For an RSU holder with shares that have appreciated significantly since vest, a DAF contribution achieves two goals simultaneously: it reduces the concentrated position and generates a charitable deduction without recognizing the embedded capital gain. The deduction is available in the year of contribution even if the charitable grants are made over multiple future years.
The limitation is categorical: DAF contributions are irrevocable and permanently committed to charitable purposes. This strategy is relevant only when charitable giving is already part of the plan. It is not a mechanism for converting a concentrated position into personal liquidity.
The contribution limits for charitable deductions in 2026: cash contributions to a DAF are deductible up to 60% of AGI; contributions of appreciated stock are deductible up to 30% of AGI, with any excess carrying forward up to five years.
Strategy 6: Charitable Remainder Unitrust for Income and Diversification
A Charitable Remainder Unitrust (CRUT) is an irrevocable trust into which a donor contributes appreciated stock. The trust sells the stock — with no immediate capital gains tax or NIIT owed at the trust level, because charitable remainder trusts are tax-exempt entities — and reinvests in a diversified portfolio. The donor and potentially a spouse receive an annual income stream from the trust (typically 5%–8% of the trust's fair market value), and the remaining assets pass to charity at the end of the trust term.
The initial contribution generates a partial charitable deduction based on the actuarial present value of the charity's remainder interest. The gain on the contributed stock is not recognized immediately — instead, it is spread across distributions paid to the beneficiaries over the trust's term, taxed according to IRS income character ordering rules.
The CRUT is most useful when three conditions are present: the contributor has genuine charitable intent for the remainder, needs or wants an income stream in retirement, and holds a highly appreciated position with a low cost basis. It is structurally unsuitable for investors who need full control over the capital or who have no charitable intent.
The blog post on CRUT: Turning Concentrated Stock into Lifetime Income covers the CRUT structure and its applications in more detail.
How Position Size and Tax Rate Shape the Decision
Not every strategy is available or cost-effective at every position size. The landscape roughly divides as follows:
Positions below approximately $500,000: Immediate sale and reinvestment is often the most straightforward path. The tax cost is real but manageable, and the complexity, illiquidity, and minimums of strategies like exchange funds, direct indexing, and CRUTs are either inaccessible or disproportionate to the benefit. Tax-loss harvesting from existing portfolio positions remains useful if other losses are available.
Positions between approximately $500,000 and $2,000,000: Direct indexing becomes meaningful if a taxable account of sufficient size exists alongside the concentrated position. Systematic selling over multiple years, coordinated with direct indexing losses, can meaningfully reduce the average tax rate on the diversification. DAF contributions are relevant if charitable giving is planned. Exchange funds are generally inaccessible at this range.
Positions above approximately $2,000,000: Exchange funds become available and the break-even math is more favorable, particularly for positions with very low cost basis. All of the above strategies remain relevant. CRUTs become more structurally useful for large positions with charitable intent. The interaction between strategies — for example, contributing part of a position to a DAF, entering an exchange fund with another portion, and selling the remainder over several years with direct indexing offsets — can be modeled to minimize the aggregate tax cost.
The tax rates in effect in 2026 for high earners are relevant context. Federal long-term capital gains tax rate: 20% for incomes above $613,700 (MFJ). Net Investment Income Tax: 3.8% on investment income above $250,000 (MFJ), with thresholds not indexed for inflation. California state tax: up to 13.3% on capital gains (treated as ordinary income). Washington State: 7% on long-term capital gains above $278,000 (2025 standard deduction, inflation-adjusted), with 9.9% on gains above $1,000,000 effective January 1, 2025.
The NIIT Interaction
For investors whose income already significantly exceeds the NIIT threshold, the 3.8% surtax applies to 100% of net investment income, including capital gains from RSU and ESPP shares held after vest. This adds to the total cost of a direct sale and correspondingly increases the value of strategies that defer or avoid the gain recognition.
The NIIT does not apply to the ordinary income recognized at RSU vest or on an ESPP disqualifying disposition — those amounts are W-2 wages, exempt from NIIT. It applies only to the capital gains component: appreciation above the vest-date cost basis on RSUs, and gain above the ordinary income already recognized on ESPP shares.
A full discussion of how NIIT applies to concentrated stock strategies is available in Net Investment Income Tax (NIIT).
What Matters Before Choosing a Path
Several factors determine which combination of strategies is relevant for a given situation, and they interact in ways that make individual assessment important:
Total position size relative to net worth. A $500,000 concentrated position in a $5,000,000 portfolio creates a different risk profile than the same position in a $600,000 portfolio. The urgency of diversification and the tolerance for the illiquidity of strategies like exchange funds depends partly on this ratio.
Cost basis as a percentage of current value. A position with a 90% embedded gain creates a very different tax burden than one with a 30% embedded gain. The lower the cost basis, the greater the benefit of deferral strategies.
Time horizon and liquidity needs. Exchange funds require a 7–10 year commitment. CRUTs are irrevocable. Systematic selling is flexible. Liquidity needs within the planning horizon constrain which strategies are viable.
Charitable intent. DAFs and CRUTs are only relevant when charitable giving is genuinely planned. Using either as a tax avoidance mechanism without genuine charitable purpose does not comply with the intent of the tax rules.
State of residence. California and Washington residents face meaningfully different combined tax rates, which affects the relative attractiveness of deferral strategies. The 13.3% California rate makes every dollar of deferred gain more valuable; the graduated Washington structure (7% / 9.9%) makes large positions increasingly expensive to sell directly.
Employer stock outlook and personal risk tolerance. No tax strategy eliminates the fundamental risk that a concentrated single-stock position can decline sharply. Tax optimization and risk management are related but distinct objectives — the optimal tax strategy is not always the optimal risk management strategy.
Model Your Equity Compensation in Context
Nauma's financial planning tools let you see how RSU vesting, ESPP purchases, and concentrated stock positions interact with your full tax picture — across multiple years and scenarios.
Get Started for Free