5 Legal Ways to Avoid Paying Capital Gains on Stock + FAQs

Picture of Lana Dolyna, EA, CTC
Lana Dolyna, EA, CTC

Senior Tax Advisor

Investing in the stock market can lead to higher returns than letting your funds sit in a bank account. But with those higher returns, you may be subject to higher taxes.

There are several ways that you can avoid or minimize paying capital gains tax on your stock sales. You can minimize your capital gains tax by holding your stocks for longer periods, using tax-deferred accounts to hold your investments, donating your stocks to charity, and using losses to offset your gains.

What is the Capital Gains Tax?

To calculate the capital gains on your stock, you calculate the difference between the sales price and what you paid for the stock minus any selling expenses. Selling expenses for stocks are generally composed of commissions paid on the sale.

Short-Term Capital Gains

If a stock is held for less than one year, the gain (or loss) on the sale is considered a short-term capital gain. Short-term capital gains are taxed at your normal income tax rate.

Long-Term Capital Gains

Long-term capital gains are profits from the sale of an asset that has been held for more than a year. The tax rate on long-term capital gains is typically lower than the rate on ordinary income, making it an attractive option for investors.

The tax rate on your long-term capital gains will depend on your total income and filing status.

5 Legal Ways to (Partially) Avoid Capital Gains Taxes on Stocks

There are several ways to minimize the taxes you pay when selling profitable stocks.

Harvesting Stock Losses

Harvesting stock losses is a strategy that investors can use to avoid paying capital gains taxes. When an investor sells a stock, they may owe taxes on the profits if the stock has increased in value since they purchased it. But if the stock has lost value, the investor can claim a loss and use it to offset any taxes owed on other gains.

This strategy can be advantageous at the end of the year, when investors can use losses to offset any capital gains taxes owed. While harvesting losses can be a helpful way to reduce taxes, it’s important to remember that it should only be used as part of a well-rounded investment strategy.

Selling stocks just to avoid taxes is not always a good idea, and investors should make sure that they are still diversified after taking losses into account.

Watch Your Holding Period

Investors will benefit from being taxed at the long-term capital gains rate instead of short-term rates which are the same as your general income.

The first step is to calculate your holding period. To do this, simply count the number of days between when you bought the asset and when you sold it. If you held the asset for more than one year, then your capital gain is considered long-term.

Long-term capital gains are taxed at a lower rate than short-term capital gains. So, if you’re looking to minimize your taxes, it’s generally best to wait at least one year before selling an asset.

There are other factors to consider as well, but the holding period is an important one. By watching your holding period, you can help to reduce your tax bill.

Consider Your Cost Basis

Whether you’re selling investments, a business or property, it’s important to know your costs basis to avoid paying capital gains taxes.

Your cost basis is the original purchase price of an asset. When you sell an asset for more than its costs basis, you’ll owe taxes on the difference. There are several ways to calculate your costs basis, so it’s important to do your research and consult with a tax professional if necessary.

When selling stocks, there are also several options for determining which shares of a stock are sold. One of the most common methods is first in, first out (FIFO) which means that the stocks you have held for the longest are sold first. But there are also alternative methods such as highest in, first out (HIFO) which means that you sell the stocks with highest purchase price first.

By understanding your costs basis and methods for choosing which shares of a stock are sold, you can make informed decisions about when to sell assets and how to minimize your tax liability.

Qualified Small Business Stock (QSBS)

To encourage investments in startup companies, certain investments in small businesses qualify for a 0% federal tax rate when sold.

To qualify for this exemption, the company must be a C corporation, it must not be part of an excluded industry, and you must have purchased the stock directly from the company (and not through a secondary market like a stock exchange). The company must have gross assets of less than $50 million before the issuance of the stock, and the issuance must not put the company over $50 million.

To qualify for the favorable tax treatment, you must hold the stock for a minimum of five years. When calculating your taxable gain on the sale of the stock, you can exclude up to 10 times the original purchase price of the stock or $10 million, whichever is greater.

Note that the stock sale may still be subject to state taxes.

Step-Up Basis on Death

Under current tax rules, when stock is transferred on the death of an owner, the stock’s basis is the date of death value.

For example, say you purchased stock for $20,000 ten years ago but the stock is currently worth $100,000. If you pass away today and the stock is transferred to your heirs, their cost basis will be $100,000.  If your heirs immediately sell the stock for the current $100,000 value, they would have $0 of capital gains.

This revaluation of the stock basis also happens automatically in community property states for stocks jointly held by a married couple.

How Capital Gains on Stocks are Taxed

In most cases, the tax rate on long-term capital gains is 15%, but there are some exceptions. For example, if you’re in the 10% or 15% tax bracket, your long-term capital gains tax rate will be 0%. And if you’re in the 25%, 28%, 33%, or 35% tax bracket, your long-term capital gains tax rate will be 20%.

It’s worth noting that some states also taxes long-term capital gains. The rules vary from state to state, so it’s important to check with your state tax authority to see what applies in your case.

Best Practices to Reduce Capital Gains Taxes on Stocks

There are several strategies that can help you minimize the taxes you pay on your capital gains.

Keep High Return Investment in Tax-Exempt Accounts

Many investors are faced with the decision of whether to keep their high return investments in a taxable or tax-deferred account. While there are some benefits to keeping investments in a taxable account, such as having more control over when taxes are paid, there are also some significant advantages to keeping high-return investments in a tax-deferred account.

Taxes on investment gains in a tax-deferred account are not due until the investor reaches retirement age and starts to withdraw from the retirement account when taxes are often lower. For these reasons, it often makes sense to keep high-return investments in a tax-deferred account.

Investment with Short-Term Capital Gains Are Best in Tax-Deferred Accounts

Investing in assets that generate short-term capital gains isn’t usually a smart move for taxpayers who want to minimize their capital gains taxes. But when these gains are realized in a tax-deferred account, such as an IRA or 401(k), they are not subject to taxes until they are withdrawn from the account. This allows the investment to grow tax-free (even for short-term gains) until it is eventually sold, at which point the taxes will be due on the gain.

However, if the investment generating the short-term gains were held in a taxable account, the taxes would have been due on the gain when it is realized. This can significantly reduce the return on the investment, making it less desirable for taxpayers who are looking to minimize their taxes.

Stable, Tax-Efficient Investments Work Well in Taxable Accounts

That’s why it makes sense to be thoughtful about the taxes you’ll pay on your investments. One way to do that is to consider investing in stable, tax-efficient investments that will work well in taxable accounts.

For example, one type of investment that can be particularly tax-efficient is a mutual fund that invests in stocks that pay dividends. Dividends are taxed at a lower rate than other types of investment income, so this type of fund can help you keep more of your investment returns. Because the fund pays dividends regularly, it can provide a stable source of income that can help offset the effects of taxes on your overall return.

Another type of tax-efficient investment is a bond fund. Bond funds are generally less volatile than stock funds, so they can provide a measure of stability in your portfolio. And because bonds are taxed at a lower rate than other types of investment income, they can also help you keep more of your investment returns.

There are other types of tax-efficient investments as well, so talk to your financial advisor about what might work best for you. With a bit of planning, you can hold down the taxes you’ll pay on your investments and keep more of your hard-earned money working for you.


Here are the answers to some common questions about legally minimizing capital gains tax.

There is no specific holding period that will allow you to avoid capital gains tax. You can reduce the tax rate on your capital gains by holding the stocks for at least a year.

You should sell your stocks in years that your other (non-capital gains) income is low to reduce the tax rate you will pay on the sale.

If you sell a stock and repurchase it within 61 days, the loss on the sale (if any) is subject to the wash sale rules and is not deductible. If you sell a stock at a profit and repurchase the stock, the gain on the sale is considered taxable.

For 2022, if your filing status is single, you will not pay any long-term capital gains tax if your total income is less than $40,400. For taxpayers that are married filing jointly, the threshold for paying taxes on long-term capital gains is $80,800.

Stocks sales are reported to the IRS. If you do not include capital gains on your tax return, you will receive a notice from the IRS demanding payment on your gains. In situations like these, our tax resolution services can help.