6 Ways to Rebalance Your Portfolio and Avoid Capital Gains

Quick answer: Do the buying and selling inside tax-advantaged accounts like a 401(k) or IRA, where trades are not taxed. In taxable accounts, send new money and dividends to underweight assets, and offset any gains with harvested losses before selling winners.↗ Share on X
The simplest way to rebalance a retirement portfolio without triggering capital gains taxes is to do the buying and selling inside your tax-advantaged accounts, like a 401(k), a traditional IRA, or a Roth IRA. Trades inside those accounts are not taxed when they happen. If part of your money sits in a regular taxable brokerage account, you can still rebalance with little or no tax by sending new money to the assets that are underweight, redirecting dividends, and pairing any gains with losses. Selling winners in a taxable account is the last resort, not the first move.
Taxes are personal, and the rules change. Before you make a large move, especially near retirement, talk to a CPA or a fee-only fiduciary financial planner who can look at your full tax picture.
What does rebalancing actually mean?
Your First Index Fund: 6 Checks Before You Click Buy →
13 Retirement Savings Tips That Work on a Normal Paycheck →
Retirement Savings by Age: How to Calculate Your Own Target →Rebalancing means bringing your mix of investments back to the plan you chose. Say your target is 70% stocks and 30% bonds. After a strong year for stocks, you might drift to 80% stocks and 20% bonds. That sounds good, but it means you now carry more risk than you signed up for. Rebalancing moves you back to 70/30.
There are two common ways to decide when to rebalance:
| Method | How it works | Good for |
|---|---|---|
| Calendar | Check once or twice a year on a fixed date | People who want a simple routine |
| Bands (thresholds) | Act only when an asset drifts past a set limit, for example 5 percentage points | People who want fewer, more meaningful trades |
| Combined | Check on a fixed date, act only if past the band | Most retirement savers |
Whichever method you use, the tax question is the same: where you make the trades matters more than how often.
Clear money tips in your inbox. No hype.
Way 1: Why rebalance inside your 401(k) or IRA first?
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.
Inside a 401(k), 403(b), traditional IRA, or Roth IRA, you can sell one fund and buy another without paying capital gains tax on the trade. Traditional accounts are taxed later, when you withdraw. Qualified Roth withdrawals are generally tax-free.
That makes these accounts the best place to do the heavy lifting. Here is a step-by-step approach:
1. List every account you own: workplace plan, IRAs, Roth IRAs, taxable brokerage, and your spouse's accounts if you plan together.
2. Add up your total stocks and total bonds across all of them. Your target mix applies to the whole household, not to each account.
3. Find the gap. If you are 10 percentage points heavy in stocks across everything, figure out the dollar amount.
4. Make that trade inside a tax-advantaged account. Sell part of a stock fund and buy a bond fund in your 401(k) or IRA.
5. Leave the taxable account alone if the tax-free accounts are big enough to absorb the change.
For many people, this alone solves the problem. A 401(k) often has the largest balance, and most plans let you change funds online in a few minutes.
Way 2: How can new contributions rebalance for you?
DRIP or Manual Investing: Which Grows Your Money Faster? →
Taxable vs Tax-Advantaged Accounts: Which to Fill First →
401(k) Tax Breaks: The Order That Gets You the Most Money →If you are still working and saving, every new dollar is a chance to rebalance without selling anything.
Instead of splitting new money by your target percentages, send all of it to whatever is underweight until you are back on target. Most 401(k) plans let you change where future contributions go without moving your existing balance.
Example: your target is 70/30, and you drifted to 75/25. For the next few months, direct 100% of new 401(k) contributions to the bond fund. Once you are back near 70/30, switch your contribution split back to normal.
This is slower than selling, but it costs nothing in taxes and nothing in trading fees.
Way 3: Should you stop reinvesting dividends automatically?
In a taxable account, dividends and fund distributions are usually reinvested into the same fund by default. That keeps pushing more money into whatever already pays out.
A simple fix:
1. Turn off automatic reinvestment in your taxable account.
2. Let dividends and interest collect as cash.
3. Every few months, use that cash to buy the underweight asset.
Note that dividends are still taxable in the year you receive them, whether or not you reinvest. This method does not avoid that tax. It simply avoids creating extra capital gains from selling.
Way 4: How does tax-loss harvesting help you rebalance?
Sometimes an investment in your taxable account is worth less than you paid. Selling it "harvests" the loss. That loss can cancel out gains you take elsewhere in the same year. If losses are bigger than gains, you can generally use up to $3,000 of the extra loss per year against regular income ($1,500 if married filing separately) and carry the rest forward to future years.
How to use it while rebalancing:
1. Find positions in your taxable account that are below their purchase price.
2. Sell them to realize the loss.
3. Use the loss to offset gains from selling an overweight position.
4. Reinvest the money in a similar, but not "substantially identical," fund to keep your target mix.
Watch the wash sale rule. If you buy the same or a substantially identical investment within 30 days before or after the sale, including in your IRA or your spouse's account, the loss can be disallowed. Many people switch to a fund that tracks a different index for at least 31 days.
Way 5: Which shares should you sell if you must sell?
If you have no choice but to sell in a taxable account, how you sell still makes a big difference.
- Choose specific lots. Most brokers let you pick which shares to sell, called "specific identification." Selling the shares you bought at the highest price creates the smallest gain, sometimes even a loss. The default method at your broker may not do this, so check the setting before you sell.
- Wait for long-term status. Shares held more than one year qualify for long-term capital gains rates, which are lower than the rates on short-term gains for most people. If a lot is a few weeks away from the one-year mark, waiting may save real money.
- Use a low-income year. Long-term gains can be taxed at a 0% federal rate if your taxable income is under a certain limit. The limit changes every year, so check the current IRS figure. A year between leaving work and starting Social Security can be a good window.
- Spread it out. Selling over two tax years, for example in December and January, can keep you in a lower bracket.
Way 6: How can withdrawals and giving do the rebalancing?
Once you are retired and taking money out, withdrawals become a powerful rebalancing tool.
- Take withdrawals from what is overweight. If stocks are too high, pull your monthly income from the stock side. Inside an IRA, that sale has no capital gains tax; the withdrawal itself is taxed as ordinary income, as it would be anyway.
- Use required minimum distributions (RMDs) on purpose. When RMDs begin, you must withdraw a minimum amount from traditional IRAs and most 401(k)s each year. You can choose which funds to sell to cover it, so pick the overweight ones.
- Give appreciated shares instead of cash. If you donate to charity, giving shares you have held more than a year can let you avoid the capital gains on them, and you may be able to deduct their value if you itemize. Then use the cash you would have donated to buy the underweight asset.
- Consider a qualified charitable distribution (QCD). From age 70½, you can send money directly from an IRA to a qualified charity. It can count toward your RMD without being added to your taxable income. Confirm the details with your tax preparer, because the steps must be done correctly.
What mistakes cost people the most?
1. Rebalancing each account separately. Making every account 70/30 often forces sales in the taxable account. Look at the household total instead.
2. Ignoring the wash sale rule across accounts. A purchase in your IRA can cancel a loss you took in your brokerage account.
3. Selling short-term winners. A few weeks of patience can move a gain into the lower long-term rate.
4. Letting the broker pick the lots. The default method may sell your cheapest shares first and create the biggest gain.
5. Forgetting state taxes. Most states tax capital gains too. The federal picture is only part of the bill.
6. Rebalancing too often. Small drifts of 1 or 2 points are usually not worth a trade, especially in a taxable account.
Is a target-date fund a simpler answer?
If you hold a target-date fund inside a 401(k) or IRA, the fund rebalances itself, and because it sits in a tax-advantaged account, those internal trades do not create a tax bill for you. For people who do not want to manage the mix, this can be the easiest path.
In a taxable account it is a different story. The fund can still pay out capital gains distributions, and you would owe tax on them. Target-date funds generally fit better inside retirement accounts.
What should you do this week?
Pull up every account you own and write down three numbers for each: total value, dollars in stocks, and dollars in bonds. Add them up and compare the result with your target mix. If you are more than 5 percentage points off, plan the fix inside your 401(k) or IRA first, then redirect new contributions. Only if that is not enough, look at your taxable account for losses to harvest and long-term lots to sell. If your numbers are large, or you are within a few years of retirement, book an hour with a CPA or a fee-only fiduciary planner and bring this list with you.
FAQ
Do I pay taxes when I rebalance inside my 401(k) or IRA?
Trades inside a 401(k), traditional IRA, or Roth IRA do not trigger capital gains tax. Traditional accounts are taxed when you withdraw, and qualified Roth withdrawals are generally tax-free.
How often should I rebalance my retirement portfolio?
Many investors check once or twice a year and act only if an asset has drifted past a set limit, such as 5 percentage points. Small drifts are usually not worth a trade.
What is the wash sale rule?
If you sell at a loss and buy the same or a substantially identical investment within 30 days before or after, the loss can be disallowed. This includes purchases in your IRA or your spouse's account.
Should I talk to a professional before rebalancing?
Yes, if the amounts are large, you are near retirement, or you plan to sell in a taxable account. A CPA or fee-only fiduciary planner can check your full tax situation.
Clear money tips in your inbox. No hype.
Educational content, not personalized financial advice. Sources cited where applicable.
