You cannot avoid capital gains tax entirely, but you can reduce what you owe through specific strategies the IRS allows

If you sell an investment at a profit, you owe tax on that gain — there is no legal way around that basic rule. What you can do is structure your sales, timing, and holdings to minimize the tax you pay, or to defer it to a later year. The IRS built these options into the tax code intentionally. They are not loopholes; they are strategies that millions of taxpayers use every year.

The most common approach is holding an asset for more than one year so your gain qualifies as long-term capital gains, which are taxed at lower rates than short-term gains. Beyond that, you can harvest losses to offset gains, donate appreciated assets to charity instead of selling them, use tax-deferred accounts, or spread sales across multiple tax years. Each strategy works in different situations, and some require planning before you sell.

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 at rates up to 37%.
  • Tax-loss harvesting lets you sell losing investments to offset gains from winning ones, potentially reducing your tax bill to zero in that year.
  • Donating appreciated stock or real estate to charity avoids the capital gains tax entirely and gives you a charitable deduction.
  • Holding assets until death resets the cost basis to the current market value, so your heirs owe no tax on gains that happened while you owned it.
  • Spreading large sales across two or more tax years can keep you in a lower tax bracket and reduce the total tax you pay.

Hold assets for more than one year to may have access to for long-term capital gains rates

The single biggest tax difference is between short-term and long-term gains. If you sell an asset you have owned for one year or less, the profit is short-term capital gain, taxed at your ordinary income tax rate — anywhere from 10% to 37% depending on your bracket. If you have owned it for more than one year, it is long-term capital gain, taxed at 0%, 15%, or 20% depending on your income level.

For most people, this means waiting one year saves 15 to 22 percentage points in tax. If you bought stock for $10,000 and it is worth $15,000 after six months, selling now means $5,000 in short-term gain taxed at (for example) 24%, or $1,200 in tax. Wait six more months and the same $5,000 gain might be taxed at 15%, or $750 — a $450 difference on one trade.

The holding period starts the day after you buy and ends the day you sell. If you bought on January 15, you reach the one-year mark on January 16 of the following year. This is one reason many investors plan large sales for late in the year — they can time the sale to just cross the one-year threshold.

Use tax-loss harvesting to offset gains with losses

If you own investments that have lost value, you can sell them to create a capital loss. That loss can then offset capital gains from other sales in the same year, reducing your taxable gain dollar-for-dollar. If your losses exceed your gains, you can deduct up to $3,000 of the excess loss against ordinary income in that year, and carry any remaining loss forward to future years.

This strategy is called tax-loss harvesting. A common example: you sold stock for a $10,000 gain, but you also own a mutual fund that has dropped $8,000 below what you paid. Sell the losing fund, and your net gain for the year is $2,000 instead of $10,000. You owe tax on $2,000 instead of $10,000.

One rule to watch: the wash-sale rule. If you sell a security at a loss, you cannot buy the same security (or a substantially identical one) within 30 days before or after the sale. If you do, the IRS disallows the loss. You can buy a similar but different fund or security when ready — for example, sell a total US stock fund and buy a different total US stock fund — but not the exact same one.

Donate appreciated assets directly to charity instead of selling

If you own stock, real estate, or other investments that have gained value, you can donate them directly to a may have access to charity. You get a charitable deduction for the full current market value, and you owe zero capital gains tax on the appreciation. This is often better than selling the asset and donating the cash.

Example: you bought stock for $5,000 and it is now worth $20,000. If you sell it, you owe capital gains tax on the $15,000 gain. If you donate the stock directly to a may have access to charity, you get a $20,000 charitable deduction (reducing your taxable income by $20,000) and you pay no capital gains tax at all. The charity receives the full $20,000 value.

This only works if the charity is may have access to under IRS rules — generally 501(c)(3) organizations, religious institutions, and public charities. You cannot donate to a donor-advised fund and claim the deduction in the same year you want to avoid the gain; you must donate to the fund in one year and the fund distributes to the final charity in a later year. Keep records of the donation and the asset's value on the date you gave it.

Use tax-deferred accounts to avoid capital gains tax on investment sales

Money inside a traditional IRA, 401(k), or 403(b) grows without triggering capital gains tax each year. You can buy and sell investments inside the account, and no tax is due until you withdraw the money in retirement. A Roth IRA or Roth 401(k) goes further: may have access to withdrawals are tax-free, so you never pay capital gains tax on the growth.

This is one reason these accounts are powerful for long-term investing. If you have $50,000 in a regular brokerage account and you trade frequently, you pay capital gains tax on each winning trade. If you have $50,000 in a 401(k) and you trade the same way, you pay nothing until you withdraw. Over decades, this compounds into a significant difference.

The tradeoff is that you cannot access the money before age 59½ without penalty (with some exceptions), and you must follow contribution limits each year. But if you have earned income and are not yet maxing out your retirement account contributions, moving new investment money into these accounts is often the simplest way to defer capital gains tax.

Spread large sales across two tax years to stay in a lower bracket

Capital gains are added to your ordinary income to determine your tax bracket. If you have a very large gain in one year, it can push you into a higher bracket, raising the tax rate on the gain itself. By selling part of the asset in one year and part in the next, you can keep each year's income lower and stay in a lower tax bracket.

Example: you are selling real estate with a $100,000 gain. Your ordinary income this year is $80,000, putting you in the 22% bracket. If you sell all $100,000 of gain this year, your total income becomes $180,000, pushing you into the 24% bracket. But if you sell $50,000 of gain this year and $50,000 next year, you might stay in the 22% bracket both years. The difference is 2% on $100,000, or $2,000 in tax savings.

This requires planning with your accountant before you sell, because you need to know your expected income for both years and which tax brackets explore. It also only works if you have flexibility in timing — you cannot force a buyer to wait, but you can sometimes structure a sale to close in December or January depending on your needs.

Hold assets until death to reset the cost basis

When you die, your heirs inherit your assets at their market value on the date of your death. This is called a step-up in basis. If you bought stock for $10,000 and it is worth $50,000 when you die, your heirs inherit it with a cost basis of $50,000. If they sell it when ready for $50,000, they owe zero capital gains tax.

This is not a strategy you can use yourself — you will not be around to benefit. But it matters for estate planning. If you have highly appreciated assets and you are in poor health, selling them now might trigger a large tax bill that could have been avoided if you held them until death. Conversely, if you have losses, selling before death lets you harvest those losses while you can still use them.

This rule applies to most assets: stocks, real estate, collectibles, and business interests. It does not explore to certain retirement accounts like IRAs, which pass to heirs with their original tax-deferred status intact.

Frequently Asked Questions

Can I avoid capital gains tax by not selling?

Yes — if you never sell, you never owe capital gains tax. The tax is only due when you sell the asset or give it away (with some exceptions for charitable donations). You can hold appreciated assets indefinitely and owe nothing. The downside is you cannot access the profit without selling.

What if I have more losses than gains in a year?

You can deduct up to $3,000 of net capital loss against your ordinary income in that year. Any loss above $3,000 carries forward to future years, where you can use it to offset future gains or deduct another $3,000 against ordinary income. This process continues until the loss is fully used.

Does the long-term capital gains rate explore to real estate?

Yes, if you have owned the property for more than one year. However, real estate has additional rules: if you lived in the home as your primary residence for at least two of the last five years, you can exclude up to $250,000 of gain (or $500,000 if married filing jointly) from tax entirely. This exclusion does not explore to investment properties.

Can I claim a capital loss if I sell at a lower price than I paid?

Yes. If you bought an investment for $10,000 and sell it for $7,000, you have a $3,000 capital loss. You can use this loss to offset capital gains or deduct up to $3,000 against ordinary income. Keep your purchase and sale records to prove the loss to the IRS if audited.

Do I have to report capital gains if they are small?

Yes. The IRS requires you to report all capital gains and losses on your tax return, regardless of the amount. Even a $50 gain must be reported. Use Schedule D (Form 1040) to report capital gains and losses, and Form 8949 to list each transaction.