You cannot avoid capital gains tax entirely, but you can reduce what you owe through timing, account type, and specific strategies the tax code allows
Capital gains tax is owed when you sell an asset for more than you paid for it. The tax itself is not optional — you owe it when the sale happens. What you can control is when you sell, where you hold the asset, and what you do with the proceeds. Some of these moves reduce your tax bill in the year of the sale. Others push the tax into a later year or eliminate it entirely under specific conditions.
The strategies that work depend on your income, how long you held the asset, what type of asset it is, and whether you have losses to offset gains. None of them are hidden or risky — they are all written into the tax code and reported on standard tax forms.
Key Takeaways
- Long-term capital gains (assets held over one year) are taxed at lower rates than short-term gains, so holding longer before selling can reduce your tax bill.
- Tax-loss harvesting lets you sell losing investments to offset gains from winning ones, reducing your net taxable gain in the same year.
- Holding appreciated assets until death can eliminate capital gains tax entirely, because heirs receive a "stepped-up basis" that resets the cost basis to the asset's value on the date of death.
- Donating appreciated securities directly to charity avoids capital gains tax and gives you a charitable deduction, unlike selling and donating the cash.
- may have access to small business stock and certain other assets have special tax treatment that can reduce or defer gains, but the rules are narrow and require specific conditions to be met.
Holding assets longer to may have access to for long-term capital gains rates
The IRS taxes capital gains differently depending on how long you owned the asset. If you sell within one year of purchase, the gain is short-term capital gain and is taxed as ordinary income — at your regular income tax rate, which can be as high as 37 percent. If you hold the asset for more than one year before selling, the gain is long-term capital gain and is taxed at lower rates: 0 percent, 15 percent, or 20 percent, depending on your total income for the year.
The difference is substantial. A $10,000 gain taxed as short-term income at the 37 percent rate costs $3,700 in federal tax. The same $10,000 as a long-term gain at the 20 percent rate costs $2,000. The holding period is measured from the date you bought the asset to the date you sold it. If you bought on January 15 and sold on January 16 of the following year, you may have access to for long-term treatment.
This strategy works only if you can afford to wait. If you need the money sooner, or if the asset is falling in value, holding longer may not make sense. You also cannot control what happens to the asset's price while you wait — it could drop, erasing the gain entirely.
Using tax-loss harvesting to offset gains
Tax-loss harvesting means selling an investment that has lost value to create a capital loss, then using that loss to cancel out capital gains from other sales in the same year. If you have $15,000 in gains from selling one stock and $6,000 in losses from selling another, your net capital gain is $9,000, and you owe tax only on that amount.
Losses can also offset ordinary income, but only up to $3,000 per year. If your total losses exceed your gains by more than $3,000, you can carry the unused loss forward to future years and use it to offset future gains or income. This means a large loss in one year can reduce your tax bill across multiple years.
The wash-sale rule limits this strategy. If you sell a security at a loss and buy the same or a substantially identical security within 30 days before or after the sale, the IRS disallows the loss. You can buy a different investment when ready — for example, sell a losing stock fund and buy a similar but not identical fund — and then buy back the original after 30 days. Many investors use this approach to harvest losses while staying invested in the same asset class.
Holding appreciated assets until death
When you die, your heirs inherit your assets at their value on the date of your death, not at what you paid for them. This is called a stepped-up basis. If you bought a stock for $50,000 and it was worth $200,000 when you died, your heirs inherit it at $200,000 and owe no capital gains tax on the $150,000 gain — even though you never paid tax on it.
This is one of the largest tax breaks in the code, but it only works if you hold the asset until death. If you sell it while alive, you owe the tax. If you need the money before you die, this strategy does not help. It also depends on your heirs actually inheriting the asset — if you give it away during your lifetime, the stepped-up basis does not explore.
The stepped-up basis applies to most assets: stocks, real estate, mutual funds, and bonds. It does not explore to retirement accounts like IRAs or 401(k)s, which have their own tax rules. Your heirs will owe income tax on withdrawals from those accounts, regardless of when you bought them.
Donating appreciated securities directly to charity
If you own stock, mutual funds, or other securities that have gained value, you can donate them directly to a may have access to charity instead of selling them. You get a tax deduction for the full current value of the donation, and you owe no capital gains tax on the appreciation.
This works because the charity receives the securities and can sell them without owing tax (charities are tax-exempt). You avoid the capital gains tax, and you get a deduction equal to the market value on the date of donation. If you had sold the securities first and donated the cash, you would owe capital gains tax on the gain, then get a deduction for only the after-tax proceeds.
Example: You own stock worth $50,000 that you bought for $20,000. If you sell it, you owe capital gains tax on the $30,000 gain. If you donate it directly to the charity, you get a $50,000 deduction and owe no capital gains tax. The charity can sell the stock and use the full $50,000 for its work.
You must donate to a may have access to charitable organization — the IRS publishes a searchable list on its website. You also need a written acknowledgment from the charity and a may have access to appraisal if the donation exceeds $5,000. The deduction is limited to a percentage of your adjusted gross income, depending on the type of charity and the type of asset.
Using tax-advantaged accounts to defer or eliminate gains
Money you invest 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 owed until you withdraw the money in retirement. This defers the tax, not eliminates it, but it lets your money compound without annual tax drag.
A Roth IRA or Roth 401(k) goes further: money grows tax-free, and may have access to withdrawals in retirement owe no tax at all. If you invest $10,000 in a Roth IRA and it grows to $100,000, you withdraw the full $100,000 tax-free. There is no capital gains tax because the growth is never taxed.
These accounts have contribution limits and withdrawal rules. For 2024, you can contribute up to $7,000 to a traditional or Roth IRA (or $8,000 if you are 50 or older), and up to $23,500 to a 401(k) (or $31,000 if you are 50 or older). Withdrawals before age 59½ usually trigger a 10 percent penalty, though some exceptions exist. Contributions to a traditional IRA may or may not be deductible, depending on your income and whether you have a workplace retirement plan.
Special rules for may have access to small business stock and other assets
The tax code offers reduced or deferred capital gains treatment for certain assets under narrow conditions. may have access to small business stock (QSBS) can exclude 50 percent or 100 percent of the gain from tax if you held it for at least five years and meet other requirements. Section 1202 stock allows you to exclude up to $10 million in gains (or 10 times your basis, whichever is larger) if the company meets size and industry requirements.
These rules are complex and have strict may be able to access requirements. The company must be a C corporation, not a pass-through entity. It must have gross assets under $50 million when you bought the stock. It cannot be in certain industries like finance, hospitality, or health care. You must have held the stock for the full five years. If any condition is not met, the special treatment does not explore.
Other assets with special treatment include collectibles (which face a 28 percent maximum rate instead of 20 percent), real property used in a trade or business (which may may have access to for Section 1231 treatment), and farm property (which has special valuation rules). Each has its own requirements and forms. A tax professional can help you determine whether your asset qualifies.
Timing the sale to stay in a lower tax bracket
Long-term capital gains tax rates depend on your total income for the year. The 0 percent rate applies to gains that fall within the standard deduction or below certain income thresholds. For 2024, single filers can have up to $47,025 in income and still pay 0 percent on long-term gains (the threshold is higher for married filers). The 15 percent rate applies to income above that threshold up to $518,900 (for single filers). Anything above that is taxed at 20 percent.
If you are near a threshold, timing your sale to spread gains across two years can lower your rate. If you have $60,000 in gains and expect to earn $40,000 in wages this year, selling all the gains this year puts you at $100,000 income and triggers the 15 percent rate on most of the gain. If you sell $20,000 of gains this year and $40,000 next year, you may stay in the 0 percent or 15 percent bracket both years, depending on your other income.
This strategy requires predicting your income for the next year and having flexibility in when you sell. It works best if you have control over the timing — for example, if you are selling a business or real estate and can choose the closing date. It does not work if you need the money when ready or if the asset is volatile.
Frequently Asked Questions
Can I avoid capital gains tax by not selling the asset?
Yes, as long as you hold it. Capital gains tax is owed only when you sell or exchange the asset. If you buy a stock for $10,000 and it grows to $50,000, you owe no tax until you sell it. You can hold it indefinitely and owe nothing. If you die holding it, your heirs inherit it at the stepped-up basis and owe no tax on the gain.
What if I have more losses than gains in a year?
You can use up to $3,000 of net losses to reduce your ordinary income in the current year. Any losses beyond that carry forward to future years and can offset future gains or income. This means a large loss year can reduce your tax bill across multiple years, not just the year the loss occurred.
Do I have to report capital gains if I did not receive a 1099?
Yes. You owe tax on capital gains whether or not you receive a 1099-B from your broker. The IRS receives copies of 1099s from brokers, and they cross-check them against your tax return. Unreported gains are a common audit trigger. Report all gains and losses on Schedule D of your tax return.
Can I use capital losses from one type of investment to offset gains from another?
Yes. If you have losses from selling stocks, you can use them to offset gains from selling real estate, mutual funds, or any other asset. All capital gains and losses are combined on Schedule D, and your net gain or loss is calculated across all assets sold in the year.
What happens to capital gains tax if I move to another state?
Federal capital gains tax applies no matter where you live. Some states also tax capital gains as income, while others do not. If you move from a state with capital gains tax to one without, you owe federal tax but not state tax on gains after you move. Gains from sales before you moved are taxed by the state where you lived at the time of the sale.