You cannot avoid capital gains tax entirely, but you can reduce what you owe through timing, account type, and donation strategies
Capital gains tax is owed when you sell an asset for more than you paid for it. The IRS requires you to report and pay tax on that profit. There is no legal way to eliminate the tax entirely if you have a gain and sell the asset. However, the tax code includes several legitimate methods to lower your bill: holding assets longer to may have access to for lower rates, using tax-advantaged accounts, offsetting gains with losses, donating appreciated assets to charity, or timing sales across tax years.
The strategy that works depends on your income, the type of asset, how long you have owned it, and your overall tax situation. This guide explains each option so you can understand what is available to you.
Key Takeaways
- Long-term capital gains (assets held over one year) are taxed at 0%, 15%, or 20% depending on income; short-term gains are taxed as ordinary income, which is higher.
- Tax-loss harvesting lets you sell losing investments to offset gains dollar-for-dollar, reducing your taxable profit.
- Donating appreciated assets directly to charity avoids the capital gains tax on the donation and gives you a charitable deduction.
- Holding assets until death resets the cost basis to the current value, so heirs owe no tax on gains that happened during your lifetime.
- Spreading sales across multiple years can keep you in a lower tax bracket and reduce the total tax you pay.
Hold assets for more than one year to access lower tax rates
The single largest tax difference is between short-term and long-term capital gains. If you sell an asset you have owned for one year or less, the profit is taxed as ordinary income at your regular tax rate — which can be 10%, 12%, 22%, 24%, 32%, 35%, or 37% depending on your income. If you hold the asset for more than one year before selling, the profit qualifies as a long-term capital gain and is taxed at 0%, 15%, or 20% instead.
For most people, the difference is substantial. A $10,000 gain taxed as short-term income at the 24% rate costs $2,400. The same gain as a long-term gain at the 15% rate costs $1,500. That is $900 in tax savings by waiting one year and one day.
The holding period starts the day after you purchase the asset and ends the day you sell it. If you bought stock on March 15, 2023, and sell it on March 16, 2024, it qualifies as long-term. If you sell on March 15, 2024, it is still short-term.
Use tax-loss harvesting to offset gains with losses
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. If you sold a stock for a $5,000 gain and sold a mutual fund for a $3,000 loss in the same year, your net capital gain is $2,000, and you owe tax only on that $2,000.
If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against your ordinary income. Any loss beyond that carries forward to future years, where you can use it to offset future gains or take another $3,000 deduction against income.
One restriction: 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 loss is disallowed and added to the cost basis of the new purchase. You can avoid this by buying a similar but different investment — for example, selling one S&P 500 index fund and buying a different one, or selling individual stocks and buying an index fund in the same sector.
Donate appreciated assets directly to charity instead of selling
If you own stock, real estate, or other assets that have increased in value, you can donate them directly to a may have access to charity and avoid the capital gains tax entirely. The charity receives the full current value, you get a charitable deduction for that value on your tax return, and you never pay tax on the gain.
This works only if you itemize deductions on your tax return (which requires deductions totaling more than the standard deduction for your filing status). If you take the standard deduction, the donation gives you no tax benefit. You also must donate to a may have access to charity — the IRS website has a searchable list of organizations that may have access to.
Example: You bought stock for $5,000 that is now worth $15,000. If you sell it, you owe tax on the $10,000 gain. If you donate it to a may have access to charity, the charity gets $15,000, you deduct $15,000 on your return (if you itemize), and you owe zero capital gains tax. You also avoid the ordinary income tax you would have paid if you had sold the stock and donated the cash instead.
Spread large sales across multiple tax years
Capital gains are added to your ordinary income to determine your tax bracket. A large gain in a single year can push you into a higher bracket and increase the tax rate on the gain itself. If you can spread the sale across two or more years, you may stay in a lower bracket and pay less total tax.
This works best if you have control over the timing — for example, if you are selling a business, real estate, or a concentrated stock position. You cannot use this strategy for assets you must sell immediately, such as inherited property you need to liquidate.
Example: You have a $100,000 gain and are in the 22% tax bracket. Selling all at once costs $15,000 in tax (because part of the gain is taxed at 24%). Selling $50,000 in year one and $50,000 in year two keeps you in the 22% bracket both years, costing $7,500 each year, or $15,000 total. In this case there is no savings. But if the gain is large enough to push you from 22% to 24% to 32%, spreading it can save thousands.
Plan for the step-up in basis at death
When you inherit an asset, its cost basis is "stepped up" to its value on the date of death. This means your heirs owe no capital gains tax on the appreciation that happened while you owned it — only on gains that occur after they inherit it.
This is not a strategy you can use yourself, but it is relevant if you are deciding whether to sell an asset now or hold it. If you hold appreciated assets until death, your heirs inherit them tax-free (in terms of capital gains). If you sell now, you pay the tax. This is one reason some people hold appreciated assets for life rather than selling them.
Note: This applies to federal capital gains tax. Some states do not recognize the step-up in basis and may tax the gain at the state level. Check your state's rules.
Use retirement accounts to avoid capital gains tax on investment growth
Money in a traditional IRA, 401(k), or similar retirement account grows without triggering capital gains tax each year. You can buy and sell investments inside the account without owing tax on the gains. Tax is owed only when you withdraw the money in retirement (and only on the amount withdrawn, not on the gains).
Roth IRAs and Roth 401(k)s are even better: growth is tax-free, and may have access to withdrawals in retirement owe no tax at all. The tradeoff is contribution limits — you can put in only a certain amount per year, and you cannot access the money before age 59½ without penalty (with some exceptions).
If you have earned income, you can open and contribute to a traditional or Roth IRA. If your employer offers a 401(k), you can contribute through payroll deductions. These accounts are the most tax-efficient way to invest for long-term growth.
Frequently Asked Questions
Can I avoid capital gains tax by not selling the asset?
Yes. If you do not sell, you do not owe capital gains tax, even if the asset has increased in value. The tax is owed only when you sell or transfer the asset. However, some assets generate taxable income (dividends, interest, rent) even if you do not sell, so holding is not always tax-free.
What if I sell at a loss — can I get a refund?
No refund, but you can use the loss to offset gains. If losses exceed gains, you can deduct up to $3,000 against ordinary income in that year. Excess losses carry forward to future years. This reduces future tax bills but does not generate a refund.
Do I have to report capital gains if they are small?
Yes. All capital gains, regardless of size, must be reported on your tax return. The IRS receives reports from brokers and investment firms, so unreported gains are likely to be caught during an audit.
Is there a difference between federal and state capital gains tax?
Yes. Federal capital gains tax is what this guide covers. Most states also tax capital gains as part of ordinary income tax, though a few states have no income tax. State rates and rules vary, so check your state's tax authority website for specifics.
Can I use multiple strategies together?
Yes. You can hold an asset long-term (lowering the rate), donate appreciated assets to charity (avoiding tax on part of the gain), and use tax-loss harvesting in the same year. The combination can significantly reduce your total tax bill. A tax professional can help you coordinate these strategies based on your specific situation.