How To Avoid or Reduce Capital Gains Tax

Strategies for cutting your capital gains tax bill

A person looks at a laptop.

Peter Cade / Getty Images

When you sell an asset such as a home or securities for a sales price that is greater than its original cost, you must pay a special kind of tax called a “capital gains tax" on the profits.

Learn about some common ways you can minimize the capital gains tax you pay on the sale of different asset types.

Key Takeaways

  • Capital gains taxes are based on both the amount of the gain and the taxable income bracket of the owner.
  • Holding an investment for more than a year before selling it can reduce your capital gains tax, and it may even result in no tax.
  • You may be able to time your withdrawals from tax-deferred retirement plans to reduce capital gains taxes in some years.
  • Losses on the sale of capital assets can be subtracted from capital gains in the same year, lowering your overall capital gains tax bill.
  • You may not have to pay capital gains tax on the sale of your home if you have met certain ownership eligibility requirements.

How Capital Gains Tax Works

Capital gains taxes work differently from taxes on what the IRS calls "ordinary income," or earnings from an employee or from business operations.

Capital gains taxes are imposed on the sale of capital assets, items you own and use for yourself or your business or for investments, including stocks and bonds, business equipment, houses, and business buildings.

To calculate the capital gains tax amount for an individual taxpayer, determine the amount of gain on the asset by subtracting the original cost from the sales price. The length of time you’ve held an asset also plays a key role in calculating capital gains taxes. Taxes on short-term gains (for assets held a year or less) are higher than for long-term assets (those held longer than a year).

Consider Your Cost Basis

Before you search for ways to avoid or reduce capital gains, consider the type of assets you want to sell and their cost basis. Your cost basis in an asset is the cost you paid for the asset, and it can be different for different types of assets. For a physical asset such as a car or home, cost basis might include sales tax, installation, and real estate taxes (for the seller). The basis of stocks and bonds is usually the purchase price, including any commissions or transfer fees.


Cost basis is a key to calculating your capital gains. Consider consulting a licensed tax professional to determine this amount for assets you are thinking of selling.

Invest Long Term

One common way to reduce your capital gains tax is to hold on to your investments longer before you sell them. Short-term capital gains are taxed as ordinary income (the typical tax rate).

But sales of long-term assets are taxed at a lower rate to give incentives for investors to invest for the long term. Sometimes there’s no capital gains tax at all, depending on the tax bracket of the owner.

For example, your sales of long-term investments in 2022 may be 0% if your taxable income  including capital gains is $41,675 or less as a single person, or $83,350 if you file as married and jointly. This process is sometimes known as harvesting capital gains, because you are gathering gains up to the amount of your taxable income for the year.

Offset Capital Gains With Capital Losses

At tax time, if you had losses on the sale of any capital assets, you can use those losses to offset other capital gains. Basically, you add up all your capital gains and subtract any losses. One version of this process is called year-end “tax-loss harvesting,” because you are gathering losses on some investments to lower your overall capital gains tax.

There are limits to the amount of losses you can take in one year, but you may be able to spread losses over several years to lower your tax bill in those years. The process you would use is called “loss carryover.”

Use Tax-Deferred Retirement Plans

Capital gains are deferred in tax-deferred retirement plans such as 401(k) employer plans or individual retirement plans (IRAs), meaning you aren’t taxed until you take them out. You can decide in which year to take out money from these accounts. For example, you can take them in years when you have lower income or capital gains, or when you have losses that can offset them.

There typically are restrictions and penalties involved with withdrawals from tax-advantaged retirement plans. You may pay an additional 10% in tax if you take a distribution from a traditional IRA when you are under age 59½, and you must take required minimum distributions (RMDs) starting at age 70½.


If you have an employer 401(k) plan, you can also plan your withdrawals to minimize capital gains taxes. But 401(k) plan investors may have to pay additional taxes for early distributions (after age 59½), and they also are subject to the RMD rules.

Carry Over Gains to Estate Taxes

Assets held until the death of the owner aren’t subject to capital gains when they are sold, but they may be subject to estate taxes. The estate tax rate is 35%, but it only applies to total assets over $11.7 million of value.

You might avoid capital gains taxes by holding on to some assets for your heirs after your death instead of selling them during your lifetime.

Exclude Capital Gains on Home Sales

Selling your home may cause you to pay capital gains tax on your net income from the sale. However, you may be able to exclude up to $250,000 of capital gain on the sale as an individual, or $500,000 if you are married and filing jointly.

You must pass several eligibility tests to get the exclusion:

  • You must have owned your home for at least 24 months (two years) out of the last five years before the date of the sale.
  • You must have lived in the home for a total of 24 months within the previous five years, not necessarily all at the same time.
  • You must not have taken an exclusion on the sale of another home you own during this time.

You may still be able to get a partial exclusion on your capital gains tax on a home sale if you meet other tests. See IRS Publication 523 for details and a worksheet.

Donate Appreciated Assets

Donating financial assets and other assets to charity may be a way to avoid paying capital gains taxes on those assets, but there are some caveats to this process. To get the tax break, you must itemize deductions, which means having total deductions that are more than the standard deduction. For 2022, the standard deduction was $12,950 for single taxpayers and $25,900 for married taxpayers filing jointly. There are limits on the amount you can deduct in one year, and you can only give to IRS-qualified charities.

Invest in Opportunity Funds

Opportunity funds are investments in economically distressed communities called “Opportunity Zones.” These are primarily for high-income investors, allowing them to defer capital gains if they hold their investments for a specific number of years.

Frequently Asked Questions (FAQs)

Can I reinvest to avoid capital gains?

If you had capital gains on the sale of financial assets such as stocks, mutual funds, or bonds, then the asset dropped in value, you can reinvest in that asset to take a loss to offset the gain. But be aware that if you hold an asset for less than a year, you may have to pay the short-term capital gain rate, which is higher than the long-term rate, when you sell.

Do I have to buy another house to avoid capital gains?

You don’t have to buy another house to avoid paying capital gains tax when you sell your home. You may be able to exclude up to $250,000 of gains from the sale ($500,000 if married filing jointly). You must have:

  • Owned the home at least 24 months out of the past 60 months
  • Live in the home as your primary residence for at least two years
  • Not excluded another home sale gain during that time

At what age do I no longer have to pay capital gains tax?

The capital gains tax rates apply to all taxpayers, even seniors filing their federal income taxes on Form 1040-SR.

How do I avoid capital gains tax when I sell my house?

If your income is low enough, you may be able to pay low or no capital gains tax from the sale of your home. The maximum gain you can exclude in a year is $250,000 for single taxpayers, or $500,000 for married filing jointly. You must have owned the home at least 24 months out of the past five years, and you must have lived in the home as your primary residence for at least two years. If you can’t meet both of these tests, you may be able to get a partial capital gains tax exclusion.

Was this page helpful?
The Balance uses only high-quality sources, including peer-reviewed studies, to support the facts within our articles. Read our editorial process to learn more about how we fact-check and keep our content accurate, reliable, and trustworthy.
  1.  IRS. “Publication 550, Investment Income and Expenses.”

  2. IRS. “Publication 551 (Rev. December 2018).”

  3. IRS. “Topic No. 409 Capital Gains and Losses.”

  4. IRS. “2022 Instructions for Schedule D.” Page D-16.

  5. IRS. “Retirement Plans FAQs Regarding IRAs.”

  6. IRS. “Retirement Topics Tax on Early Distributions.”

  7. IRS. “2021 Publication 523.”

  8. IRS. “IRS Provides Tax Inflation Adjustments for Tax Year 2022.”

  9. State of Connecticut. “Federal Opportunity Zone Tax Benefits.”

  10. IRS. “Sale of Residence - Real Estate Tax Tips.”

Related Articles