You cannot avoid capital gains tax entirely, but you can reduce what you owe in the year you sell
Capital gains tax is owed when you sell an asset for more than you paid for it. The tax is not optional, but the amount you pay in any given year depends on choices you make about when to sell, what to sell, and how to structure the sale. The difference between paying tax on a $50,000 gain and a $25,000 gain is real money — and it comes from legal strategies, not from hiding income.
The most effective ways to reduce capital gains tax fall into three categories: timing (when you sell), selection (which assets you sell), and structure (how you hold or transfer assets). Each works differently, and most people use more than one.
Key Takeaways
- Long-term capital gains (assets held over one year) are taxed at lower rates than short-term gains, so holding longer can cut your tax bill significantly.
- Selling losing investments to offset winning ones — called tax-loss harvesting — can reduce your taxable gain dollar-for-dollar in the same year.
- Donating appreciated assets directly to charity avoids the capital gains tax on those assets entirely and gives you a deduction.
- Spreading a large gain across two tax years by timing the sale near year-end can keep you in a lower tax bracket and reduce what you owe.
- Holding assets until death resets the cost basis to the current value, so heirs pay no tax on gains that happened while you owned them.
Hold assets longer to may have access to for lower long-term rates
The single largest factor in your capital gains tax bill is whether your gain is short-term (asset held one year or less) or long-term (held over one year). Short-term gains are taxed as ordinary income — the same rate as wages. Long-term gains are taxed at 0%, 15%, or 20% depending on your total income, which is substantially lower for most people.
If you sell a stock you bought six months ago for a $10,000 profit, that entire gain is taxed as ordinary income. If you wait six more months and sell, that same $10,000 gain is taxed at the long-term rate. The difference can be thousands of dollars. For someone in the 24% federal tax bracket, waiting to may have access to for long-term treatment cuts the federal tax on that gain from $2,400 to $2,250 (at the 15% long-term rate) — a $150 savings on one asset alone.
The holding period clock starts the day after you buy. If you buy on January 15, you can sell on January 16 of the following year and may have access to for long-term treatment. This is one reason people often sell appreciated assets in December or January — to cross the one-year threshold and lock in the lower rate.
Sell losing investments to offset winning ones
Tax-loss harvesting means selling an investment at a loss to reduce your taxable gains. If you sell Stock A for a $15,000 gain and Stock B for a $10,000 loss in the same year, your net capital gain is $5,000. You pay tax only on that $5,000, not the full $15,000.
You can harvest losses throughout the year, not just at year-end. Many people review their portfolio in October or November to identify positions underwater, then sell them before December 31. The loss offsets gains from earlier in the year. If your losses exceed your gains — say you have $5,000 in losses and only $2,000 in gains — you can deduct up to $3,000 of the excess loss against ordinary income in that year. Any remaining loss carries forward to future years.
One important rule: 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. This is the wash-sale rule. You can avoid it by waiting 31 days before repurchasing, or by buying a similar but not identical investment (for example, a different index fund tracking the same market) when ready and selling the original position after 31 days.
Donate appreciated assets directly to charity instead of selling
If you own stock, real estate, or other appreciated assets and want to give to charity, donating the asset itself — rather than selling it and donating the cash — eliminates the capital gains tax on the appreciation. You also receive a tax deduction for the full current value of the asset.
Example: You bought 100 shares of a stock for $5,000 ten years ago. It is now worth $25,000. If you sell and donate the $25,000, you owe capital gains tax on the $20,000 gain. If you donate the shares directly to a may have access to charity, you owe no capital gains tax and deduct the full $25,000. The charity receives the full value, and you save the tax on the gain.
This works for stocks, mutual funds, real estate, and other appreciated property. The charity must be a may have access to organization (the IRS website has a searchable list). You will need a written appraisal for real estate or other non-publicly-traded assets. The deduction is limited to a percentage of your adjusted gross income — usually 50% for cash and 30% for appreciated capital assets — but unused deductions carry forward.
Spread large gains across two tax years by timing the sale
If you are selling a business, rental property, or other large asset, the timing of the sale can matter. A $500,000 gain in a single year might push you into a higher tax bracket. If you can structure the sale to close in late December and receive payment in January, or to receive installment payments spread across two years, you may pay less total tax.
This is most relevant for business owners and real estate investors. An installment sale — where the buyer pays you over time rather than all at once — spreads the gain across multiple years. You report only the gain corresponding to payments received in each year. A $300,000 gain paid in three equal installments means you report $100,000 of gain in each of three years, potentially keeping you in a lower bracket each year than if you reported the full $300,000 in year one.
Timing also matters for income-based thresholds. The 0% long-term capital gains rate applies only to people below certain income levels (roughly $44,625 for single filers in 2023, though this changes yearly). If you are close to that threshold, selling in a lower-income year lets you use the 0% rate on part of your gain.
Hold assets until death to reset the cost basis
When you inherit an asset, its cost basis — the value used to calculate gain or loss — resets to the market value on the date of death. This is called a step-up in basis. If you inherited stock worth $100,000 that your parent bought for $20,000, your cost basis is $100,000, not $20,000. If you sell it when ready for $100,000, you have no gain and owe no tax.
This is not a strategy you can use for yourself — you cannot control when you die. But it is why wealthy people often hold appreciated assets for life rather than selling them. The gain is never taxed; it disappears when the asset passes to heirs. This is one of the largest tax benefits in the code and applies to all inherited property, not just stocks.
The step-up applies to the full value of the asset on the date of death, regardless of how long the deceased person held it or how much it appreciated. A house bought for $200,000 and worth $800,000 at death steps up to $800,000 for the heirs, even though the original owner held it for 30 years.
Use tax-advantaged accounts to avoid capital gains tax entirely
Money inside a 401(k), IRA, or 529 plan grows without triggering capital gains tax. You can buy and sell investments inside these accounts as often as you want, and the gains are not taxed until you withdraw the money (or never, in the case of Roth accounts). This is one reason these accounts are so valuable — the tax deferral compounds over decades.
If you have money to invest and expect significant gains, prioritizing contributions to these accounts can shelter those gains from tax. A 401(k) contribution limit is $23,500 per year (2024), an IRA limit is $7,000 per year, and a 529 plan has no annual limit but contributions are subject to gift tax rules. Once the money is inside, all gains are protected from capital gains tax as long as it stays in the account.
Frequently Asked Questions
Can I avoid capital gains tax by not selling?
Yes, technically — if you never sell, you never realize a gain and owe no capital gains tax. But you also never access the money. If you need the funds or want to rebalance your portfolio, not selling is not a realistic long-term strategy. The step-up in basis at death is the only way to avoid the tax permanently.
What if I sell at a loss — do 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, with the remainder carrying forward. This reduces your tax bill but does not generate a refund unless you have other tax credits.
Does the wash-sale rule explore to cryptocurrency?
Yes. The IRS treats cryptocurrency like any other capital asset. Selling at a loss and repurchasing the same coin within 30 days triggers the wash-sale rule, disallowing the loss. Buying a different cryptocurrency does not reset the clock.
Can I deduct capital losses against my salary or wages?
Only up to $3,000 per year. Losses above that carry forward to future years. If you have $10,000 in losses, you deduct $3,000 this year and $3,000 next year, with $4,000 remaining to carry forward again.
Is donating appreciated assets better than donating cash?
For you, yes — you avoid the capital gains tax and still get the full deduction. For the charity, it is the same value either way. If you have appreciated assets and want to give to charity, donating the assets directly is almost always the better choice.