You cannot avoid capital gains tax entirely, but you can reduce what you owe through timing, account type, and holding period

Capital gains tax is owed when you sell an asset for more than you paid for it. The IRS requires this tax; you cannot legally eliminate it. What you can do is lower the amount you owe by choosing when to sell, where to hold investments, and which assets to sell first. Some strategies defer the tax to a later year. Others move gains into lower tax brackets or into accounts where gains are never taxed.

The most common mistake is selling everything at once in a single year, which can push you into a higher tax bracket. Spreading sales across two years, using tax-advantaged accounts, and choosing which shares to sell can each reduce your bill by hundreds or thousands of dollars.

Key Takeaways

  • Long-term capital gains (assets held over one year) are taxed at 0%, 15%, or 20% depending on your income, while short-term gains are taxed as ordinary income, which is higher.
  • Selling assets in a year when your income is lower — such as after retirement or a job loss — can move gains into a lower tax bracket and reduce your rate.
  • Tax-advantaged accounts like 401(k)s, IRAs, and Roth IRAs allow you to buy and sell investments without triggering capital gains tax inside the account.
  • Holding an asset for more than one year before selling qualifies it for long-term capital gains rates, which are significantly lower than short-term rates.
  • Donating appreciated assets to charity avoids capital gains tax on the donation and gives you a tax deduction for the full fair market value.

Hold assets for more than one year to may have access to for lower tax rates

The IRS taxes capital gains differently depending on how long you owned the asset. Short-term capital gains — from assets held one year or less — are taxed as ordinary income. For 2024, that means rates from 10% to 37% depending on your tax bracket. Long-term capital gains — from assets held more than one year — are taxed at 0%, 15%, or 20% depending on your total income for the year.

The difference is substantial. If you sell a stock after holding it 11 months and your ordinary income tax bracket is 24%, you pay 24% on the gain. If you wait one more month and sell it, you might pay 15% instead. On a $10,000 gain, that is $900 in tax savings by waiting 30 days.

This strategy only works if you can afford to wait. If you need the money now, the tax savings do not matter. But if you are selling for discretionary reasons — rebalancing a portfolio, taking profits, or moving money between investments — timing the sale to cross the one-year mark can reduce your tax bill significantly.

Sell in a year when your income is lower to stay in a lower tax bracket

Long-term capital gains tax rates depend on your total taxable income for the year, not just the gains themselves. The 0% rate applies to single filers with income under $47,025 in 2024; the 15% rate applies up to $518,900; and the 20% rate applies above that. If you can time a large sale to a year when your other income is lower, you may pay a lower rate on the entire gain.

Common situations where this works: you retire mid-year and have no income for the rest of the year; you take a sabbatical or unpaid leave; you lose a job and do not find another until the following year; or you have a year with unusually low business income. Selling appreciated assets in that low-income year can keep the gains within the 0% or 15% bracket instead of pushing into the 20% bracket.

Example: You have $100,000 in long-term gains to realize. In 2024, if your other income is $30,000, the first $17,025 of gains is taxed at 0%, and the remaining $82,975 is taxed at 15%, for a total of $12,446 in tax. If you sold in a year when your other income was $100,000, all $100,000 in gains would be taxed at 15%, for a total of $15,000 in tax. Timing the sale to the lower-income year saves you $2,554.

Use tax-advantaged accounts to avoid capital gains tax on investment growth

Money held in a 401(k), traditional IRA, or Roth IRA grows without triggering capital gains tax each time you buy or sell within the account. You can trade stocks, bonds, or funds as often as you want inside these accounts, and no tax is owed until you withdraw the money (or in the case of a Roth, never, if you follow the rules).

This is the single most powerful tax tool available to most people. If you have $50,000 in a taxable brokerage account and you trade frequently, you owe capital gains tax every time you sell at a profit. If you move that $50,000 into a 401(k) or IRA and trade the same way, you owe zero capital gains tax. The growth compounds tax-free.

The catch is contribution limits. For 2024, you can contribute $7,000 to a traditional or Roth IRA (or $8,000 if you are 50 or older), and $23,500 to a 401(k) (or $31,000 if 50 or older). If you have already maxed these out, you cannot use them to shelter additional gains. But if you have not, prioritizing contributions to these accounts is the most direct way to avoid capital gains tax on new money.

Donate appreciated assets to charity instead of selling them

If you own stock, real estate, or other assets that have increased in value and you want to give to charity, donate the asset itself rather than selling it and donating the cash. You avoid capital gains tax on the appreciation, and you receive a tax deduction for the full fair market value of the asset on the day you donate it.

Example: You bought stock for $5,000 that is now worth $15,000. If you sell it, you owe capital gains tax on the $10,000 gain. If instead you donate the stock directly to a may have access to charity, you owe zero capital gains tax and you can deduct $15,000 on your tax return (subject to limits based on your income). You get the full benefit of the appreciation without paying tax on it.

This only works with may have access to charities — typically 501(c)(3) organizations. You cannot donate to a donor-advised fund and then direct the fund to donate; the donation must go directly from you to the charity. Work with the charity's development office to arrange the transfer. They will provide documentation for your tax return.

Harvest losses to offset gains in the same year

Tax-loss harvesting means selling an investment at a loss to offset capital gains you realized elsewhere. If you sold Stock A for a $10,000 gain and Stock B for a $3,000 loss in the same year, you owe tax only on the net $7,000 gain. The loss cancels out part of the gain.

If your losses exceed your gains in a year, you can deduct up to $3,000 of the net loss against your ordinary income. Any loss beyond that carries forward to future years and can offset gains then. This is why many investors review their portfolios in November and December — they look for positions that have lost value and sell them to harvest the loss before year-end.

The IRS has a rule called the wash-sale rule that prevents you from immediately buying back the same or substantially identical investment. If you sell a stock at a loss and buy it back within 30 days before or after the sale, the loss is disallowed. To avoid this, wait 31 days or buy a similar but not identical investment in the meantime.

Spread large sales across multiple years to stay in lower brackets

If you have a very large gain — such as from selling a business, inherited real estate, or a concentrated stock position — selling it all in one year can push you into the highest tax bracket. Spreading the sale across two or three years keeps each year's income lower and may keep you in the 15% long-term capital gains bracket instead of the 20% bracket.

This requires planning with a tax professional and coordination with the buyer. Some sales cannot be split — you cannot sell a house twice. But if you own multiple properties, a business with multiple assets, or a large stock position that you can sell in tranches, spacing out the sales can reduce your total tax bill.

The trade-off is that you delay receiving the full proceeds and you assume the risk that the asset's value changes between sales. If the market drops, later tranches may sell for less. If it rises, you benefit. This strategy makes sense only if the tax savings outweigh the risk and inconvenience of a multi-year sale.

Frequently Asked Questions

Can I avoid capital gains tax by not selling?

Yes. If you never sell an asset, you never owe capital gains tax on it, even if it doubles in value. The tax is owed only when you sell or transfer the asset. However, if you inherit an asset, your heirs receive a "step-up in basis," meaning the tax basis resets to the fair market value on the date of death, so inherited gains are not taxed.

What is the difference between short-term and long-term capital gains tax rates?

Short-term gains (assets held one year or less) are taxed as ordinary income at rates from 10% to 37%. Long-term gains (assets held more than one year) are taxed at 0%, 15%, or 20% depending on your income. Long-term rates are significantly lower, which is why holding assets longer reduces your tax bill.

Can I deduct capital losses from my taxes?

Yes. Capital losses offset capital gains dollar-for-dollar. If losses exceed gains, you can deduct up to $3,000 of the net loss against ordinary income in that year. Losses beyond $3,000 carry forward to future years. This is why tax-loss harvesting in December can reduce your annual tax bill.

Do I have to pay capital gains tax on inherited assets?

No, not on the inherited amount itself. Inherited assets receive a "step-up in basis" to their fair market value on the date of death. If you inherit stock worth $100,000 that your relative paid $20,000 for, your basis is $100,000, and you owe no tax on the $80,000 gain. You owe tax only on gains that occur after you inherit it.

What if I sell my primary residence — do I owe capital gains tax?

No, if you meet the requirements. You can exclude up to $250,000 of gain if you are single, or $500,000 if married filing jointly, as long as you owned and lived in the home for at least two of the last five years before the sale. Gains above those amounts are taxable, but most primary residence sales are fully excluded.