The most reliable way to save on capital gains tax is to hold an investment for more than one year before selling, which drops the federal rate from as high as 37% down to a maximum of 20%. From there, the tax code offers several legitimate ways to defer, reduce, or eliminate tax on investment profits, and the right one depends on what you’re selling, how much you earn, and how quickly you need the cash. Each strategy has its own rules and deadlines, and a missed detail can cost more than doing nothing.
Hold Long Enough to Get the Lower Rate
The IRS splits capital gains into two categories based on how long you owned the asset. Sell something you held for one year or less and the profit is a short-term gain taxed at your ordinary income rate, which for 2026 runs as high as 37% for single filers earning above $640,600 or married couples filing jointly above $768,700.1Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026 A quick flip can lose more than a third of the gain to federal tax alone.
Hold the same asset for more than one year and the gain qualifies for long-term capital gains rates of 0%, 15%, or 20%, depending on your total taxable income and filing status.2Office of the Law Revision Counsel. 26 USC 1222 – Other Terms Relating to Capital Gains and Losses The 0% bracket is worth planning around. For 2026, a married couple filing jointly with taxable income up to $98,900 pays nothing on long-term gains.1Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026 Retirees can sometimes time sales for a low-income year and land the entire gain inside that 0% window.
Watch for the 3.8% Investment Surtax
Higher earners face an extra layer. A 3.8% surtax applies to the lesser of your net investment income or the amount your modified adjusted gross income exceeds a threshold: $200,000 for single filers, $250,000 for joint filers, and $125,000 for married filing separately.3Office of the Law Revision Counsel. 26 US Code 1411 – Imposition of Tax Those thresholds are not adjusted for inflation, so more taxpayers cross them each year.
Capital gains, dividends, rental income, and royalties count as net investment income. Wages and Social Security don’t.4Internal Revenue Service. Net Investment Income Tax For a single filer well above the threshold, a long-term gain can hit a combined federal rate of 23.8%. Every strategy below that reduces the gain you recognize also reduces exposure to this surtax.
Use the Home Sale Exclusion
If you’re selling your main home, this is the biggest break available. You can exclude up to $250,000 of profit, or up to $500,000 filing jointly, as long as you owned and lived in the home as your primary residence for at least two of the five years before the sale.5Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence The two years don’t need to be consecutive.
Anything above the exclusion is taxed at long-term capital gains rates. One of the most overlooked ways to shrink that taxable amount is tracking your adjusted basis. Basis includes what you paid plus the cost of qualifying improvements: a new roof, a deck, central air. Ordinary repairs like fixing a leaky faucet don’t count. Energy tax credits you claimed for improvements reduce basis.6Internal Revenue Service. Publication 523 – Selling Your Home Keep receipts throughout your years of ownership. They translate directly into a smaller gain when you sell.
Partial Exclusion for Early Sales
Selling before you meet the two-year rule doesn’t automatically disqualify you. A prorated exclusion is available if the sale was driven by a work move (generally requiring the new job to be at least 50 miles farther from the home than the old one), a health issue, or an unforeseeable event like divorce, job loss, or the home being destroyed.6Internal Revenue Service. Publication 523 – Selling Your Home The amount you can exclude is prorated based on how much of the two-year requirement you actually met.
Harvest Losses to Offset Gains
Selling a losing investment to cancel out a winning one is the workhorse year-end tax move. Losses offset gains dollar for dollar. If your losses exceed your gains, you can use up to $3,000 of the leftover loss ($1,500 if married filing separately) against ordinary income like wages, and anything beyond that carries forward to future years with no expiration.7Internal Revenue Service. Topic No. 409 – Capital Gains and Losses
The trap is the wash-sale rule. Sell a security at a loss and buy a substantially identical one within 30 days before or after, and the IRS disallows the loss.8Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities The disallowed loss is added to the basis of the replacement shares, so it isn’t gone forever, but you lose the immediate benefit. The rule reaches across all of your accounts, including your spouse’s and your IRA. Brokerages only track wash sales within the same account and same security, so anything crossing accounts is on you.
A common workaround is selling the losing position and immediately buying a similar but not identical fund. Sell a total U.S. stock market fund and buy an S&P 500 fund, and your market exposure stays roughly the same without triggering a wash sale. Just switch off automatic reinvestment so the original fund doesn’t sneak back in during the 61-day window.
Defer Real Estate Gains With a 1031 Exchange
Section 1031 lets real estate investors defer capital gains tax by rolling the proceeds from a sold property into a replacement property of equal or greater value. The gain isn’t forgiven; it transfers to the new property through a reduced basis. Chain enough exchanges together and the deferral can last a lifetime.9Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment
Deadlines are unforgiving. From the day you close on the sale of the old property, you have 45 days to identify replacement properties in writing and 180 days to close on one (or by your tax-return due date, if that comes first).9Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment Miss either and the whole exchange fails. You also have to use a Qualified Intermediary to hold the proceeds. If the cash touches your hands or your bank account, the IRS treats you as having received it and the deferral is lost. Any cash or non-real-estate property received in the deal is taxable on that portion.
Only property held for business or investment purposes qualifies. Personal residences are out. Vacation homes fall into a gray area with a safe harbor: rent the property at fair market rates for at least 14 days in each of the two 12-month periods around the exchange, and keep your own personal use to no more than 14 days or 10% of the rental days, whichever is greater.10Internal Revenue Service. Revenue Procedure 2008-16 – Safe Harbor for Dwelling Units in Section 1031 Exchanges
What About Depreciation Recapture
Selling depreciable rental property outside an exchange has its own sting. The portion of the gain attributable to depreciation you claimed (or should have claimed) is taxed at a maximum rate of 25%, not the usual long-term rate.7Internal Revenue Service. Topic No. 409 – Capital Gains and Losses A 1031 exchange defers this recapture along with the rest of the gain, which is a big reason investors keep exchanging rather than cashing out.
Spread the Gain Across Years With an Installment Sale
Sell property and receive at least one payment after the end of the tax year, and the IRS automatically treats it as an installment sale. Instead of recognizing the whole gain in the year of the sale, you report it proportionally as payments come in.11Office of the Law Revision Counsel. 26 USC 453 – Installment Method Spreading the gain can keep you in a lower bracket each year and avoid pushing you into the 20% capital gains rate or over the NIIT threshold.
Installment reporting works for privately sold real estate and business assets. It isn’t available for publicly traded stocks or securities. Interest on deferred payments is taxed separately as ordinary income. You can elect out and report the full gain up front if that suits your situation better, but the flexibility only runs one way: once you elect out, you can’t undo it later.
Keep Trades Inside a Retirement Account
Buying and selling investments inside a retirement account generates no taxable event at the time of the trade. A Traditional 401(k) or Traditional IRA gives you a deduction now and taxes withdrawals as ordinary income in retirement.12Internal Revenue Service. Traditional IRAs A Roth IRA flips it: you contribute after-tax dollars, and qualified withdrawals in retirement come out completely tax-free, including all the growth.13Internal Revenue Service. Roth IRAs Rebalancing, taking gains, and reinvesting inside these accounts never triggers capital gains tax. Maxing out contributions each year shields a meaningful amount of investment growth from the tax entirely.14Internal Revenue Service. 401(k) Limit Increases to $24,500 for 2026, IRA Limit Increases to $7,500
Required Minimum Distributions Can Undo Some of It
The deferral in Traditional accounts isn’t permanent. Required minimum distributions eventually force money out, and those withdrawals count as ordinary income. A large RMD can push your other income into a higher bracket, potentially raising the rate on any capital gains you realize in the same year. It can also lift Medicare Part B premiums and cause more of your Social Security to be taxable. Roth IRAs have no RMDs during the owner’s lifetime, one reason Roth conversions before RMDs begin have become a common planning move.
Let Heirs Take the Stepped-Up Basis
When you inherit an asset, your cost basis is generally reset to the asset’s fair market value on the date of the prior owner’s death.15Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent If a parent bought stock for $20,000 decades ago and it was worth $200,000 at their death, your basis becomes $200,000. Sell it the next day at that price and you owe no capital gains tax. That $180,000 of appreciation is never taxed. The step-up applies to real estate, stocks, and most other capital assets passed through an estate, which is why holding highly appreciated assets rather than selling them near end of life can be worth far more to heirs than selling and passing on cash.
Donate Appreciated Assets Instead of Cash
Giving appreciated stock or other long-term holdings directly to a qualified charity produces two benefits at once. You pay no capital gains tax on the appreciation, and if you itemize you can deduct the full fair market value. Selling first and donating the after-tax cash gives less to the charity and produces a smaller deduction, so the direct route wins on both sides.
The deduction for appreciated capital gain property donated to a public charity is capped at 30% of your adjusted gross income for the year, with any excess carrying forward for up to five years.16Internal Revenue Service. Publication 526 – Charitable Contributions The asset must have been held more than a year to qualify for a full fair-market-value deduction; short-term holdings are limited to your cost basis. Donor-advised funds at major brokerages accept appreciated securities and handle the transfer, so this works even for smaller nonprofits that can’t process stock donations directly.
Don’t Forget State Tax
Federal tax is only part of the picture. Most states tax capital gains as ordinary income, and rates run from 0% in states with no income tax to above 13% at the top. The combined federal-and-state rate on a gain can differ by more than 10 percentage points depending on where you live. Before choosing a strategy for a large sale, check how your state treats it. A 1031 exchange defers federal and state tax together, but strategies built on federal exclusions don’t always produce identical benefits at the state level.