Bitcoin US$ 82,823Ethereum US$ 2,648EUR/USD 1.140GBP/USD 1.325USD/BRL 5.18Bitcoin US$ 82,823Ethereum US$ 2,648EUR/USD 1.140GBP/USD 1.325USD/BRL 5.18
Investing BasicsUpdated 2026-09-289 min read

Rebalancing Index Funds: How to Cut the Capital Gains Tax

Michael Chen
Michael Chen writes about personal finance fundamentals. Bay Area-based · finance enthusiast for 15 years.
Visual representation of the voice · not a photographic portrait
Share𝕏✆f
Quick answer: Rebalancing inside a 401(k) or IRA creates no tax. In a taxable account, selling at a profit creates a capital gain taxed at long-term rates if held over one year, or ordinary rates if not. Use new money, dividends, specific-lot selling and retirement accounts to sell less.↗ Share on X

If you rebalance index funds inside a 401(k), IRA or Roth IRA, you owe no tax at all on the trade. If you rebalance in a regular taxable brokerage account, selling a fund at a profit creates a capital gain: you pay the lower long-term rate if you held the shares more than one year, and your normal income tax rate if you held them one year or less. The easiest ways to shrink that bill are to rebalance with new money instead of selling, to sell the shares with the highest cost first, and to do the selling inside tax-advantaged accounts whenever you can.

Tax rules change and every household is different. Use this article to understand your options, then confirm the numbers with a tax professional or your brokerage's tax tools before you sell anything large.

Why does rebalancing create a tax bill at all?

READ ALSOHow to Adjust Your Portfolio When Risk Tolerance Changes →Automate Retirement Savings Once, Then Stop Checking Daily →Investing for Beginners: 9 Things to Know Before Day One →

Rebalancing means bringing your mix of investments back to the target you chose. Say you want 70% stocks and 30% bonds. After a good year for stocks, you might be at 80/20. To get back to 70/30, you sell some of the stock fund and buy more of the bond fund.

The problem is the sale. When you sell shares for more than you paid, the difference is a capital gain (your profit). The IRS taxes that profit in the year you sell, if the account is taxable.

Buying never creates a tax bill. Only selling does. Keep that in mind, because most of the strategies below are simply ways to rebalance while selling less.

Clear money tips in your inbox. No hype.

Which account you rebalance in matters most

RECOMMENDEDUltimate Dynamic Personal Budget in Google Sheets (FinSavvyDesigns) → — A fully dynamic budget planner in Google Sheets to track income, expenses, and savings with an interactive dashboard.

Affiliate link. We may earn a commission on purchases, at no extra cost to you.

This content is informational and is not investment advice or financial consulting.

Account typeTax when you sell to rebalance?Notes
401(k), 403(b), traditional IRANoYou pay income tax later, when you withdraw
Roth IRA, Roth 401(k)NoQualified withdrawals are tax-free
HSA (invested)NoTax-free if used for qualified medical costs
Regular taxable brokerage accountYes, on any gainShort-term or long-term rules apply

If you have money in more than one type of account, think of all of them as one big portfolio. You can often hit your target mix by doing all the selling inside the 401(k) or IRA, and leaving the taxable account alone.

Example: You hold a stock index fund in both your IRA and your taxable account. You are overweight in stocks. Instead of selling stock in the taxable account, you sell stock in the IRA and buy the bond fund there. Your total mix is back on target, and you owe nothing this year.

Short-term vs. long-term gains: how much will you pay?

READ ALSOBefore You Invest: 4 Steps Beginners Skip (and Regret) →Investing for Beginners With No Time: A Simple Setup →Pick Your First Index Fund by How Much Risk You Can Handle →

The holding period decides the rate.

Some higher earners also owe the 3.8% Net Investment Income Tax on top of that. The income limits for each bracket change every year, so check the current IRS figures for the year you plan to sell.

What this means in practice: if some of your shares are just a few weeks short of the one-year mark, waiting can move them from your regular rate down to the long-term rate. For many people, that is a real difference.

How do you find out how big your gain actually is?

Your gain is the sale price minus your cost basis. Cost basis is basically what you paid for the shares, including reinvested dividends.

Here is how to find it:

1. Log in to your brokerage and open the fund's position.

2. Look for a tab called "Unrealized gain/loss," "Cost basis" or "Tax lots."

3. You will see each purchase as a separate lot, with its date and price.

4. Note which lots are short-term and which are long-term.

5. Note which lots have the highest cost (smallest gain) and which have losses.

Every time you bought shares, including every automatic dividend reinvestment, a new lot was created. Some of those lots may have a much smaller gain than others, and some may even be at a loss.

Seven ways to lower the tax when you rebalance

1. Rebalance with new money first

If you add money to your account every month, send all new deposits to the fund that is underweight. No selling, no tax. For many people, doing this for a few months fixes the drift completely.

2. Point dividends at the underweight fund

Most brokerages reinvest dividends into the same fund by default. Turn that off and have dividends paid as cash. Then use the cash to buy whatever is below target. Note: you still owe tax on the dividends themselves in a taxable account, but you avoid creating extra gains by selling.

3. Do the selling inside retirement accounts

As shown in the table, trades inside a 401(k), IRA or HSA create no tax. Look at your whole portfolio and ask: "Can I fix this mix without touching the taxable account?"

4. Choose specific lots instead of "first in, first out"

Many brokerages default to selling your oldest shares first (called FIFO). Your oldest shares usually have the biggest gain. Most platforms let you change the method to "specific lot" or "highest cost." That way you sell the shares with the smallest gain, or even a loss, first. Change this setting before you place the trade; it usually cannot be changed after the sale settles.

5. Wait for the one-year mark when it is close

If a lot turns long-term in a few weeks, and your portfolio is not badly off target, waiting may make sense. Just do not let a small tax saving keep your portfolio far off target for months.

6. Harvest losses to cancel out gains

If another fund in your taxable account is below what you paid, you can sell it to realize a loss. Losses first offset gains. If losses exceed gains, you can use up to $3,000 of the extra against ordinary income per year, and carry the rest forward to future years.

Watch out for the wash sale rule: if you buy the same or a "substantially identical" investment within 30 days before or after selling at a loss, the loss is disallowed for now. Many investors move into a similar but not identical fund for at least 31 days. Ask a tax professional where the line is for the funds you own.

7. Use wider bands instead of a fixed calendar

Instead of rebalancing every January no matter what, many investors only act when a fund drifts more than a set amount from target, for example 5 percentage points. That means fewer sales and fewer taxable events. Pick your band once and stick to it so you are not reacting to the news.

A worked example with simple numbers

Imagine a taxable account with a $100,000 total, aiming for 70% stocks and 30% bonds.

TargetCurrentDifference
Stock index fund$70,000$80,000$10,000 too much
Bond index fund$30,000$20,000$10,000 too little

Option A: sell $10,000 of stock the default way. Suppose the oldest lots are worth double what you paid. Selling $10,000 of them means about $5,000 of gain. That $5,000 gets taxed at your long-term rate.

Option B: sell the highest-cost lots. Suppose your most recent lots, bought over a year ago, are only up 10%. Selling $10,000 of those means a gain of about $900. Much smaller bill.

Option C: use new money. You add $1,000 a month. Sending it all to bonds for several months, plus redirecting dividends, closes most of the gap with zero sales.

Option D: rebalance in the IRA. If you also have an IRA holding the stock fund, sell $10,000 of stock there and buy the bond fund there. No tax this year.

The numbers here are made up to show the idea. Your own lots and your own tax rate decide the real result.

What should you avoid?

When should you talk to a professional?

Get help from a CPA or enrolled agent before rebalancing if:

This article gives general information, not personal tax advice.

Your next step: check your lots before you sell anything

Today, open your taxable brokerage account and do two things. First, change your default cost-basis method to "specific lot" or "highest cost," if your broker allows it. Second, write down your current mix across every account, including your 401(k) and IRA. Then see whether you can get back on target using new deposits, dividends and trades inside your retirement accounts before you sell a single share in the taxable account.

FAQ

Do I pay taxes when I rebalance my 401(k) or IRA?

No. Trades inside a 401(k), traditional IRA or Roth IRA do not create capital gains tax. Taxes on traditional accounts come later, when you withdraw.

What is the wash sale rule?

If you sell an investment at a loss and buy the same or a substantially identical one within 30 days before or after the sale, the IRS disallows that loss for now. It is added to the basis of the new shares instead.

How can I rebalance without selling?

Send all new contributions and cash dividends to the fund that is below target. For many investors this closes the gap over a few months with no sales at all.

Should I talk to a tax professional before rebalancing?

Yes if the gain is large, you are near an income limit that affects other benefits, you are retired, or the shares were inherited or gifted. A CPA or enrolled agent can model the real tax.

Clear money tips in your inbox. No hype.

Share𝕏✆f

Educational content, not personalized financial advice. Sources cited where applicable.

Clear money tips in your inbox. No hype.