Yes, you generally pay capital gains tax if you reinvest the proceeds from a sale. The tax is triggered the moment you sell at a profit, not when you spend the money, so buying a new stock, fund, or other asset with the proceeds does not erase what you owe. A few specific vehicles let you defer or exclude the gain when you reinvest, but each one has strict conditions, and none of them apply to an ordinary taxable brokerage account.
The Sale Is What Triggers the Tax
A capital gain becomes “realized” the moment your sale settles. That is the taxable event. Whether the cash sits in your account for six months or funnels into a new position five minutes later makes no difference to the IRS. Your broker reports every sale on Form 1099-B, which goes to both you and the government at year end.1Internal Revenue Service. About Form 1099-B, Proceeds from Broker and Barter Exchange Transactions
When you reinvest, all you are doing is setting a new cost basis on the replacement asset. Your purchase price for the new investment becomes the starting line for calculating future gains or losses. The tax owed on the first sale is unchanged. This is where people confuse reinvesting (selling one asset and buying another) with holding (never selling at all). Only holding avoids the realization event.
What the Tax Actually Costs in 2026
How much you owe depends on how long you held the asset and how much total income you have. Assets held more than one year qualify for long-term capital gains rates, which top out at 20%. Assets held one year or less are taxed as ordinary income, which can reach 37% at the top federal bracket for 2026.2Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026
For long-term gains in 2026:
- 0% applies to taxable income up to $49,450 for single filers, $98,900 for married filing jointly, or $66,200 for head of household.
- 15% applies above those thresholds up to $545,500 single, $613,700 joint, or $579,600 head of household.
- 20% applies to taxable income above the 15% ceiling.3Internal Revenue Service. Topic No. 409, Capital Gains and Losses
Higher earners face an additional 3.8% net investment income tax. It applies to the lesser of your net investment income or the amount your modified adjusted gross income exceeds $200,000 single, $250,000 joint, or $125,000 married filing separately.4Internal Revenue Service. Topic No. 559, Net Investment Income Tax Capital gains fall squarely within net investment income, so a large realized gain can push you over the threshold even when your salary alone would not. The effective top federal rate on long-term gains can reach 23.8%.
The Reinvested Mutual Fund Distribution Trap
This is where the confusion causes the most damage. When a mutual fund sells securities at a profit inside the fund, it distributes those gains to shareholders, usually near year end. Most accounts are set to reinvest those distributions automatically. The money never lands in your checking account, so it feels like nothing happened. The IRS still treats the distributions as income to you in the year they are paid, even if every dollar went straight back into more fund shares.5Internal Revenue Service. Mutual Funds (Costs, Distributions, Etc.) 4
The one useful consequence is that reinvested distributions increase your cost basis in the fund. If a fund distributes $500 and you reinvest it, your basis rises by $500 because you now own more shares purchased at the distribution price. When you eventually sell the fund, that higher basis reduces the gain. Forgetting to track reinvested distributions is one of the most common tax-return mistakes, and it leads to paying tax twice on the same money.
Selling at a Loss and Buying It Back
Reinvesting can also block a loss you were counting on. If you sell a security at a loss and buy substantially identical shares within 30 days before or after the sale, the wash sale rule disallows the loss deduction for that year.6Internal Revenue Service. Case Study 1, Wash Sales This catches investors who sell a losing position to harvest the tax loss and then immediately buy it back because they still like the company.
The disallowed loss is not gone permanently. It gets added to the basis of the replacement shares, so a $250 disallowed loss on a replacement bought for $800 gives you a new basis of $1,050.6Internal Revenue Service. Case Study 1, Wash Sales You recover the loss when you eventually sell the replacement, but you lose it for the current year. To keep the loss now, wait more than 30 days or buy something that is not substantially identical, such as a different fund tracking a different index.
A Big Gain Can Trigger Estimated Payments
A large realized gain mid-year can create a payment problem that surprises people at filing time. If you expect to owe at least $1,000 after withholding and credits, and your withholding covers less than 90% of the current year’s tax or 100% of last year’s tax (110% if your prior-year AGI exceeded $150,000), you are required to make quarterly estimated payments.7Internal Revenue Service. Estimated Tax Missing them triggers underpayment penalties with interest.
For 2026, individual estimated tax payments are due April 15, June 15, September 15, and January 15 of the following year.8Internal Revenue Service. 2026 Publication 509 Selling in August and waiting until April to pay is not an option. Send an estimated payment by the September deadline at the latest.
Where Reinvesting Really Does Avoid the Tax
Retirement Accounts
Inside a traditional IRA or 401(k), you can sell investments and buy new ones as often as you want without generating a taxable event. The IRS does not track individual trades inside these accounts; it only cares when money leaves.9Internal Revenue Service. What If My 401(k) Drops in Value? Withdrawals from traditional accounts are taxed as ordinary income, but internal gains, losses, and reinvestments never touch your return.
Roth IRAs and Roth 401(k)s go further. Contributions are made with after-tax dollars, and qualified withdrawals in retirement come out entirely tax-free, growth included. You can rebalance, sell winners, and buy replacements without any tax drag.
Self-directed IRAs holding real estate or other alternative assets carry a risk most brokerage IRAs do not. If you or a disqualified person (close family members, certain business partners) engages in a prohibited transaction, the IRS treats the entire account as distributed on the first day of that year, so every dollar becomes taxable at once.10Internal Revenue Service. Retirement Topics, Prohibited Transactions Prohibited transactions include borrowing from the IRA, selling property to it, using it as loan collateral, and buying property for personal use with IRA funds.
Section 1031 Exchanges for Investment Real Estate
Real estate investors have a deferral tool stock investors do not. Under Section 1031, you can sell an investment property and roll the proceeds into a like-kind replacement without paying capital gains tax on the sale.11Office of the Law Revision Counsel. 26 USC 1031, Exchange of Real Property Held for Productive Use or Investment Both properties must be held for business or investment use. This provision does not apply to stocks, bonds, personal vehicles, or other non-real-estate assets.
The timelines are strict. You must identify potential replacement properties within 45 days of selling the original, and the full exchange must close within 180 days.11Office of the Law Revision Counsel. 26 USC 1031, Exchange of Real Property Held for Productive Use or Investment A qualified intermediary must hold the sale proceeds throughout. If the funds hit your bank account at any point, the IRS treats it as actual receipt and the entire gain becomes taxable immediately. Missing either deadline has the same effect. Most exchangers hire a qualified intermediary before the initial sale even closes.
Qualified Opportunity Funds
Qualified Opportunity Funds let investors reinvest capital gains from any asset into a certified fund that invests in designated low-income census tracts, deferring tax on the original gain under Section 1400Z-2.12Office of the Law Revision Counsel. 26 USC 1400Z-2, Special Rules for Capital Gains Invested in Opportunity Zones The deferral period ends no later than December 31, 2026, whether or not the investor has sold the fund interest.13Internal Revenue Service. Opportunity Zones Frequently Asked Questions
Investors who held a QOF for at least five years received a 10% basis increase on the deferred gain; those who held for seven years received an additional 5%, for 15% total.14eCFR. 26 CFR 1.1400Z2(b)-1, Inclusion of Gains That Have Been Deferred Because the step-ups had to be reached by the 2026 inclusion date, only early entrants benefit. The separate incentive for holding at least ten years, which makes appreciation on the QOF investment itself tax-free, remains available for investors who meet that holding period. Federal legislation has restructured the program with new rules taking effect in 2027.
Selling Your Primary Residence
Homes are the one place where an old “reinvest to avoid tax” rule used to live. Before 1997, homeowners had to buy a more expensive replacement to defer the gain. That rule is gone. Under Section 121, you can now exclude up to $250,000 of profit if single, or $500,000 if married filing jointly, regardless of whether you buy another home.15Office of the Law Revision Counsel. 26 USC 121, Exclusion of Gain from Sale of Principal Residence Gain above those thresholds is taxed at long-term capital gains rates. Losses on a personal residence are not deductible.
To qualify, you must have owned and used the home as your primary residence for at least two of the five years before the sale. The two years do not have to be consecutive.15Office of the Law Revision Counsel. 26 USC 121, Exclusion of Gain from Sale of Principal Residence A partial exclusion is available when the sale is driven by a qualifying job relocation, a health issue, or an unforeseeable event, prorated to the fraction of the two-year requirement you met.16Internal Revenue Service. Publication 523, Selling Your Home Active-duty service members and Foreign Service officers stationed away from home can elect to suspend the five-year window for up to ten years.17eCFR. 26 CFR 1.121-5, Suspension of 5-Year Period for Certain Members of the Uniformed Services and Foreign Service
State Taxes Add Another Layer
Federal tax is only part of the bill. Most states tax capital gains as ordinary income, with rates that vary widely. Several states impose no income tax at all; others charge rates exceeding 13% on high earners. A few treat capital gains differently from wages, offering lower rates or partial exclusions for long-term holdings. Reinvesting does not avoid state capital gains taxes any more than it avoids federal ones, so the combined burden on a short-term gain in a high-tax state can exceed 30%.