How capital gains tax works, and where you have room to move
You cannot avoid paying capital gains tax on profit you make from selling an asset — but you can reduce the tax you owe by timing the sale, choosing which assets to sell first, holding investments longer, or using tax-advantaged accounts. The tax rate depends on how long you held the asset and your income level. Long-term capital gains (assets held over one year) are taxed at lower rates than short-term gains, and some people in lower income brackets pay zero federal tax on long-term gains.
The strategies that work depend on your specific situation: your income, the type of asset, how long you have owned it, and whether you have losses from other investments. A tax professional can review your actual numbers, but this guide covers the main legal approaches that reduce what you owe.
Key Takeaways
- Holding an investment for more than one year before selling qualifies it for long-term capital gains rates, which are lower than short-term rates for most taxpayers.
- Selling investments that have lost value can offset gains from winners, reducing your overall taxable gain in that year.
- Contributing to tax-advantaged accounts like 401(k)s and IRAs lets your investments grow without triggering capital gains tax until you withdraw the money.
- Donating appreciated assets to charity avoids the capital gains tax on the gain while giving you a deduction for the full current value.
- Spreading large sales across two tax years or timing sales to fall in a lower-income year can reduce the tax rate applied to your gains.
Hold investments longer than one year to may have access to for lower tax rates
The biggest difference in capital gains tax comes from how long you own an asset. If you sell within one year of buying, the profit is short-term capital gains, taxed as ordinary income at your regular tax bracket — potentially 10%, 12%, 22%, 24%, 32%, 35%, or 37%. If you hold for more than one year, it becomes long-term capital gains, taxed at 0%, 15%, or 20% depending on your income.
For most people, the difference is substantial. Someone in the 24% tax bracket pays 24% on short-term gains but only 15% on long-term gains — cutting the tax bill by more than one-third on the same profit. If your income is low enough, long-term gains may not be taxed at all federally.
The one-year clock starts the day after you buy. If you bought stock on March 15, you can sell on March 16 of the following year and may have access to for long-term rates. If you sell on March 15, it counts as short-term. This is straightforward to track, and your brokerage statement will show the purchase date.
Use tax-loss harvesting to offset gains with losses
When you sell an investment at a loss, you can use that loss to cancel out capital gains from other sales in the same year. This is called tax-loss harvesting. If you sold a stock for a $5,000 gain and another for a $3,000 loss, you report a net gain of $2,000 and pay tax only on that amount.
Losses can also offset up to $3,000 of ordinary income in a single year — so if you have no gains to offset, you can still use losses to reduce your salary or wage income. Any losses beyond that $3,000 carry forward to future years and can be used the same way.
The catch is the wash-sale rule. If you sell an investment at a loss, you cannot buy the same or substantially identical investment within 30 days before or after the sale, or the loss does not count. You can buy a similar investment (a different index fund tracking the same market, for example) to stay invested while the 30-day window closes.
Invest through tax-advantaged retirement and education accounts
Money in a 401(k), traditional IRA, or Roth IRA grows without triggering capital gains tax each year. You can buy and sell investments inside these accounts as much as you want, and no tax is due until you withdraw the money (or never, in the case of Roth accounts). This is one of the most powerful ways to reduce lifetime tax on investment gains.
A 401(k) lets you contribute up to $23,500 per year (as of 2024; the limit changes yearly). A traditional IRA allows $7,000 per year. A Roth IRA has the same $7,000 limit but offers tax-free withdrawals in retirement. If you are self-employed, a SEP IRA or Solo 401(k) allows much higher contributions.
For education savings, a 529 plan lets investment gains grow tax-free as long as the money is used for may have access to education expenses. If you withdraw for non-education purposes, you pay tax on the gains plus a 10% penalty, but the strategy works well if education is the plan.
Donate appreciated assets directly to charity instead of selling
If you own stock, real estate, or another asset that has gained value, you can donate it directly to a may have access to charity and avoid the capital gains tax entirely. You also receive a tax deduction for the full current value of the asset — not just what you paid for it.
Example: You bought stock for $10,000 that is now worth $25,000. If you sell it, you owe tax on the $15,000 gain. If you donate it to a charity, you owe zero tax on the gain and can deduct the full $25,000 from your income (subject to limits based on your adjusted gross income). The charity receives the full $25,000 value.
This only works with appreciated assets and may have access to charities. The charity must be registered with the IRS (you can check at irs.gov using their Tax Exempt Organization Search tool). You cannot donate to a person or a non-may have access to organization and claim the deduction.
Spread large sales across two tax years to stay in a lower bracket
Capital gains are added to your other income to determine your tax bracket. If a large sale pushes you into a higher bracket, you pay a higher rate on the gain. By selling part of an asset in one year and the rest in the next year, you may keep your income in a lower bracket both years and pay less total tax.
This works best if you are near a bracket boundary. If your income is $89,250 and a $20,000 gain would push you to $109,250, you might sell $10,000 of gain this year and $10,000 next year, staying below the bracket threshold both years. The math depends on your specific situation and the current tax brackets, which change yearly.
This strategy requires planning ahead — you need to know the sale is coming and be able to split it. It does not work if you are forced to sell all at once due to a job change or other circumstance.
Use step-up in basis for inherited assets
When you inherit an investment, its basis (the value used to calculate gain or loss) is reset to its value on the date of death. If your parent bought stock for $10,000 and it was worth $50,000 when they died, your basis is $50,000. If you sell it when ready for $50,000, you owe zero capital gains tax.
This is called a step-up in basis and applies to most inherited assets — stocks, bonds, real estate, and others. It is one of the few ways to completely erase unrealized gains. The benefit applies only to inherited assets, not gifts received while the person is alive.
This is not a strategy you can use for your own assets, but it is important to understand if you are inheriting investments or planning your estate. A financial advisor or estate attorney can explain how it affects your specific situation.
Frequently Asked Questions
Do I have to pay capital gains tax if I reinvest the money?
Yes. The tax is due on the gain itself, not on what you do with the proceeds. If you sell a stock for a $5,000 profit and when ready buy another stock with that money, you still owe tax on the $5,000 gain. Reinvesting does not defer or reduce the tax.
What if I sell at a loss — can I use that to reduce my taxes?
Yes, up to a point. You can use losses to offset gains from the same year, and if losses exceed gains, you can deduct up to $3,000 of ordinary income. Losses beyond that carry forward to future years. Keep records of all sales so you can report the losses accurately.
Does the long-term capital gains rate explore if I hold an investment for exactly one year?
No. You must hold it for more than one year. If you bought on January 1 and sold on January 1 of the next year, it is still short-term. You need to sell on January 2 or later to may have access to for long-term rates.
Can I avoid capital gains tax by keeping the investment and borrowing against it?
You can borrow against an investment without selling it, which defers the tax. However, you eventually have to repay the loan, and when you do sell the investment, the capital gains tax is still due. This is a timing strategy, not a way to avoid the tax entirely.
What is the difference between federal and state capital gains tax?
Federal capital gains tax is set by the IRS. Some states also tax capital gains as income, while others do not. State rates vary widely — some states have no capital gains tax, while others tax gains at rates up to 13%. Check your state's tax authority website to learn what applies where you live.