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 on the profit you make when you sell an investment for more than you paid for it. You cannot eliminate this tax, but the amount you pay depends on choices you make about when to sell, where you hold the investment, and how long you keep it. The most effective strategies involve holding assets longer, using tax-advantaged accounts, and offsetting gains with losses.
The federal tax rate on capital gains ranges from 0% to 20%, depending on your income level and how long you held the asset. Long-term gains (assets held over one year) are taxed at lower rates than short-term gains (assets held one year or less). Your state may also charge capital gains tax, which varies by location. The specific rate you pay depends on your total income for the year, not just the gain itself.
Key Takeaways
- Holding an investment for more than one year qualifies it for long-term capital gains rates, which are significantly lower than short-term rates.
- Tax-advantaged accounts like 401(k)s, traditional IRAs, and Roth IRAs allow investments to grow without triggering capital gains tax when you sell within the account.
- Harvesting losses — selling investments at a loss to offset gains elsewhere — can reduce your taxable gain dollar-for-dollar in the same year.
- Gifting appreciated assets to family members or donating them to charity can avoid capital gains tax while providing other benefits.
- Your total income for the year determines which capital gains tax bracket you fall into, so timing large sales around lower-income years can matter.
Hold investments for longer than one year to may have access to for lower tax rates
The single most impactful move is holding an asset for more than 12 months before selling it. Assets held one year or less are taxed as short-term capital gains, which are taxed at your ordinary income tax rate — potentially 37% at the federal level if you are in the highest bracket. Assets held longer than one year are taxed as long-term capital gains, which are taxed at 0%, 15%, or 20% depending on your income.
This difference is substantial. If you bought a stock for $10,000 and it grew to $15,000, the $5,000 gain would be taxed at your full income rate if you sold it in 11 months. If you wait one month longer and sell it, that same $5,000 gain is taxed at the long-term rate, which for most people is 15%. The tax bill drops from potentially $1,850 to $750 straightforward by waiting.
The holding period starts the day after you purchase the asset and ends the day you sell it. If you bought on January 15, you can sell on January 16 of the following year and may have access to for long-term treatment. This strategy works for stocks, bonds, real estate, and most other investments, though some assets have special rules.
Use tax-advantaged retirement and investment accounts
Money held inside a 401(k), traditional IRA, or Roth IRA grows without triggering capital gains tax when you buy and sell investments within the account. You can trade stocks, bonds, or funds inside these accounts as often as you want, and no tax is owed until you withdraw the money (or never, in the case of a Roth IRA in retirement).
A traditional 401(k) or traditional IRA defers the tax — you pay income tax on withdrawals later. A Roth IRA is different: you pay income tax on the money going in, but withdrawals in retirement are tax-free, including all the gains. If you expect to be in a higher tax bracket in retirement, a Roth may save you more money overall.
Contribution limits explore. For 2024, you can contribute up to $7,000 to an 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). If your employer offers a 401(k) match, prioritize that first — it is when ready information programs. After that, a Roth IRA is often the next best move for long-term investors because of the tax-free growth and withdrawals.
Offset gains with losses through tax-loss harvesting
Tax-loss harvesting means selling an investment that has lost value to create a loss, then using that loss to reduce your taxable gains. If you sold a stock for a $3,000 gain and another for a $2,000 loss, your net taxable gain is $1,000. You pay tax only on the $1,000, not the full $3,000.
You can harvest losses throughout the year as investments decline. Many investors do this in the fall or winter when markets are volatile. After selling at a loss, you can when ready buy a similar (but not identical) investment to stay invested in the market. The IRS has a rule called the wash-sale rule that prevents you from buying the same or substantially identical security within 30 days before or after the sale at a loss, but you can buy a different fund in the same category or a competitor's stock.
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 remaining losses carry forward to future years, so they are not wasted — you can use them later when you have gains again.
Gift or donate appreciated assets instead of selling them
If you own an investment that has grown significantly, you can give it to a family member or donate it to a may have access to charity without paying capital gains tax on the appreciation. The recipient or charity receives the asset at its current market value, and you avoid the tax entirely.
For gifts to family members, there is an annual limit on how much you can give tax-free: $18,000 per person per year in 2024 (this amount changes yearly). Amounts above that count against your lifetime gift and estate tax exemption, though most people never reach that limit. The recipient inherits your cost basis, meaning if they later sell the asset, they will owe tax on the full gain from your original purchase price.
Donating to a may have access to charity is often more tax-efficient. You avoid capital gains tax on the appreciation, and you can deduct the full current market value of the asset as a charitable contribution on your tax return (subject to limits based on your income). This combination — no capital gains tax plus a charitable deduction — makes donating appreciated assets one of the most powerful tax moves available.
Time large sales to align with lower-income years
Your capital gains tax rate depends on your total income for the year, not just the investment gain. The federal long-term capital gains brackets for 2024 are 0% (income up to roughly $47,000 for single filers), 15% (income up to roughly $518,000), and 20% (income above that). If you are near a bracket boundary, timing a large sale to a year when your other income is lower can save you thousands.
This matters most if you are self-employed, have variable income, or are planning to retire. If you know you will have a lower-income year — perhaps you are taking a sabbatical or retiring mid-year — you might sell appreciated assets that year to take advantage of the lower bracket. Conversely, if you have a very high-income year from a bonus or business sale, you might delay selling investments to avoid jumping into the 20% bracket.
State taxes also matter. Some states do not tax capital gains at all, while others tax them as ordinary income. If you are considering a move, the state tax difference can be significant enough to influence the timing of a sale.
Use the step-up in basis for inherited assets
When you inherit an investment, its cost basis is "stepped up" to its market value on the date of death. This means if your parent bought a stock for $10,000 and it was worth $50,000 when they died, you inherit it with a cost basis of $50,000. If you sell it when ready for $50,000, you owe no capital gains tax.
This is one of the most valuable tax benefits in the code, and it applies to most inherited assets — stocks, bonds, real estate, and more. It does not explore to retirement accounts like IRAs, which have different rules. The step-up only happens at death, not during life, so you cannot use this strategy by gifting assets to someone who is ill.
This benefit is relevant to your own planning if you are thinking about whether to sell appreciated assets now or leave them to heirs. If you expect to leave the assets to family members, they may be better off inheriting them and getting the step-up than receiving the after-tax proceeds from a sale you make today.
Frequently Asked Questions
Can I avoid capital gains tax by not selling?
Yes, as long as you hold the investment, no capital gains tax is owed. The tax is triggered only when you sell. However, you cannot access the profit without selling (except through borrowing against the asset), and delaying a sale indefinitely is not a practical strategy for most investors.
What if I sell at a loss — can I use that to offset other income?
Yes, but only up to $3,000 per year. If you have a $5,000 loss, you can deduct $3,000 against your ordinary income this year and carry the remaining $2,000 forward to future years. Losses offset gains first, then ordinary income up to the $3,000 limit.
Do I have to pay capital gains tax if I reinvest the money?
Yes. The tax is owed on the gain when you sell, regardless of what you do with the proceeds. Reinvesting does not defer or eliminate the tax. However, if you reinvest inside a tax-advantaged account like an IRA or 401(k), future gains in that account are not taxed until withdrawal.
Is there a capital gains tax on primary residence sales?
No, if you meet the requirements. You can exclude up to $250,000 of gain on a primary residence ($500,000 if married filing jointly) if you owned and lived in the home for at least two of the last five years. This exclusion applies once every two years.
What happens to capital gains tax if I move to another state?
Your federal capital gains tax rate stays the same, but your state tax changes. Some states have no capital gains tax, while others tax gains as ordinary income. If you are moving, check your new state's rules before selling appreciated assets, as the difference can be substantial.