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 when you sell an asset for more than you paid for it. You cannot eliminate this tax by hiding the sale or using a legal loophole — the IRS requires you to report it. What you can do is structure your sales to pay less tax, defer payment to a later year, or move gains into accounts where they grow tax-free. The strategy that works depends on what you own, how long you have held it, and your income level that year.

The single largest factor is holding period. If you sell an asset you have owned for more than one year, you pay the long-term capital gains rate, which ranges from 0% to 20% depending on your income. If you sell something you have owned for one year or less, you pay your ordinary income tax rate, which can be as high as 37%. straightforward waiting to sell can cut your tax bill in half or more.

Key Takeaways

  • Assets held longer than one year may have access to for long-term capital gains rates (0%, 15%, or 20%), which are lower than the ordinary income rates you pay on assets held one year or less.
  • Tax-advantaged accounts like 401(k)s, IRAs, and Roth IRAs let you buy and sell investments without triggering capital gains tax until you withdraw the money — or ever, in the case of Roth accounts.
  • Selling losses in the same year as gains can offset gains dollar-for-dollar, and unused losses carry forward to future years.
  • Bunching income into one year and leaving another year low can let you use the 0% long-term capital gains bracket, which applies to single filers with income below $47,025 in 2024.
  • Donating appreciated assets to charity avoids the capital gains tax on the gain and gives you a charitable deduction for the full current value.

Hold assets for more than one year to access lower tax rates

The difference between short-term and long-term capital gains rates is the largest tax savings available to most people. A short-term gain (asset held one year or less) is taxed as ordinary income. A long-term gain (asset held more than one year) is taxed at 0%, 15%, or 20%, depending on your total income that year.

For example, if you sell a stock you bought six months ago for a $10,000 gain and your ordinary tax rate is 24%, you owe $2,400. If you wait six more months and sell the same stock for the same gain, you owe $1,500 (at the 15% long-term rate) — a savings of $900. The holding period is measured from the date you bought the asset to the date you sold it. Fractional days do not count; you need to hold it through the same calendar date one year later.

Use tax-advantaged retirement and investment accounts

401(k) plans and traditional IRAs let you buy and sell investments inside the account without triggering capital gains tax. You only pay tax when you withdraw money in retirement, and you pay ordinary income tax on the entire withdrawal, not capital gains tax. This means you can trade frequently, rebalance your portfolio, and harvest gains without a tax bill until you take the money out.

Roth IRAs and Roth 401(k)s go further: you pay no tax on gains ever, as long as you follow withdrawal rules. You contribute after-tax dollars, but all growth inside the account is tax-free. If you are young or expect to be in a higher tax bracket later, a Roth account can save you far more than a traditional account.

529 college savings plans work the same way for education expenses: gains grow tax-free and withdrawals for may have access to education costs are not taxed. If you withdraw money for non-education purposes, you pay tax on the gains plus a 10% penalty, so this strategy only works if you are confident the money will be used for school.

Contribution limits explore to all these accounts. For 2024, you can contribute $7,000 to an IRA (or $8,000 if you are 50 or older), and 401(k) limits are $23,500 ($31,000 if 50 or older). If you have already maxed these out, you cannot use them to shelter additional gains.

Offset gains with losses in the same year

If you sell an investment at a loss in the same year you sell one at a gain, the loss reduces the gain dollar-for-dollar. If you have a $15,000 gain and a $6,000 loss, you report a net gain of $9,000 and pay tax only on that amount. This is called tax-loss harvesting.

If your losses exceed your gains in a year, you can deduct up to $3,000 of the net loss against your ordinary income. Any loss beyond $3,000 carries forward to future years and can be used to offset future gains or deducted against future income. This means a bad year in the market can reduce your tax bill for years to come.

One rule to watch: if you sell a stock at a loss and buy the same stock (or a substantially identical one) within 30 days before or after the sale, the IRS disallows the loss. This is the wash-sale rule. You can buy a similar but not identical stock — for example, a different tech company or a tech sector fund — and the loss still counts.

Use the 0% capital gains bracket in low-income years

Long-term capital gains are taxed at 0% for single filers with income below $47,025 in 2024 (the threshold varies by year and filing status). If you have a year where your income is unusually low — you took a sabbatical, retired early, or had a business loss — you can sell appreciated assets and pay no federal capital gains tax.

This works best if you can control when you realize income. For example, if you are between jobs, you might sell stock in the low-income year and buy it back later. Or if you own a business, you might time a large sale to a year when other income is low. You still owe state capital gains tax in most states, and you must report the gain on your tax return, but federal tax is zero.

This strategy requires planning: you need to know your income for the year before you sell, and you need assets you are willing to sell. It works best for people with control over their income timing, such as business owners or those with investment portfolios they can manage.

Donate appreciated assets to charity instead of selling them

If you own stock, real estate, or other assets that have increased in value and you want to give to charity, donate the asset itself rather than selling it and donating the cash. You avoid the capital gains tax on the gain and receive a charitable deduction for the full current value of the asset.

For example, if you bought stock for $5,000 and it is now worth $15,000, you would normally owe capital gains tax on the $10,000 gain if you sold it. If you donate the stock directly to a may have access to charity, you owe no capital gains tax and you can deduct the full $15,000 as a charitable contribution (subject to income limits on charitable deductions). The charity receives $15,000 of value, and you save the capital gains tax.

This only works with appreciated assets — assets worth more than you paid for them. You cannot deduct a loss by donating an asset worth less than you paid. The charity must be a may have access to organization (most nonprofits are; the IRS website has a searchable list). You need a written appraisal for real estate or other assets over $5,000.

Spread large gains across multiple years if possible

If you are selling a business, real estate, or other large asset, you may be able to structure the sale to spread the gain across multiple years. For example, an installment sale lets the buyer pay you over time, and you report the gain as you receive each payment. This can keep your income lower in any single year and potentially keep you in a lower tax bracket.

This requires negotiation with the buyer and careful tax planning. The rules are complex and depend on the type of asset and the payment terms. If you are facing a large capital gain, a tax professional can review whether spreading the income is possible and whether it saves you money after accounting for the time value of money.

Understand what you cannot do

You cannot avoid capital gains tax by not reporting the sale. The IRS receives reports from brokers whenever you sell securities, and real estate sales are recorded in public records. Failing to report a gain can result in penalties and interest that exceed the tax you would have owed.

You cannot avoid it by giving the asset to a family member and having them sell it. The person who sells the asset owes the tax based on their cost basis (what they paid for it). If you give someone an asset, their cost basis is usually the same as yours, so they owe the same tax when they sell.

You cannot avoid it by moving to another state or country. U.S. citizens owe federal capital gains tax on worldwide income regardless of where they live. Some states have capital gains taxes and some do not, so moving can reduce state tax, but not federal tax.

Frequently Asked Questions

What if I inherited an asset — do I owe capital gains tax when I sell it?

No, not on the gain that occurred before you inherited it. Inherited assets receive a "step-up in basis," meaning your cost basis is the asset's value on the date the person died, not what they paid for it. If you inherit stock worth $50,000 and it is worth $55,000 when you sell it a year later, you owe capital gains tax only on the $5,000 gain, not the $50,000 gain that occurred before you inherited it.

Can I deduct capital losses against my salary or wages?

No, not directly. Capital losses can offset capital gains dollar-for-dollar. If you have no gains, you can deduct up to $3,000 of net capital losses against your ordinary income (salary, wages, interest, etc.). Any loss beyond $3,000 carries forward to future years. This means a bad year in the stock market can reduce your overall tax bill, but only up to $3,000 per year.

Do I owe capital gains tax on cryptocurrency?

Yes. The IRS treats cryptocurrency like any other asset. When you sell it for more than you paid, you owe capital gains tax at long-term or short-term rates depending on how long you held it. You also owe tax when you use cryptocurrency to buy something else, because that counts as a sale. Exchanges report transactions to the IRS, so you must report all gains.

What is the difference between capital gains and dividends?

Capital gains are profits from selling an asset. Dividends are payments a company makes to shareholders from its profits. may have access to dividends (from U.S. companies held for at least 60 days) are taxed at the same long-term capital gains rates (0%, 15%, or 20%). Non-may have access to dividends are taxed as ordinary income. Both are reported separately on your tax return.

If I sell at a loss, do I have to report it?

You should report it, even though you do not owe tax on it. Reporting losses lets you use them to offset gains or deduct them against ordinary income. If you do not report the loss, you cannot use it in future years. Your broker sends you a statement of all sales, so the IRS knows about the loss even if you do not report it.