Capital gains tax on stocks is a fee investors pay when selling shares for more than the purchase price. Capital gains tax applies not only to individual stocks but also to investment funds such as mutual funds and exchange-traded funds (ETFs). Investors are likely to incur some amount of capital gains tax. However, several strategies will allow you to avoid capital gains tax on stocks.

Most of these strategies have been around for quite some time. But the Tax Cuts and Jobs Act of 2017 added one provision that can help you lessen your taxes. By employing some (or all) of these strategies, it will be possible to significantly lessen the total amount of tax you pay on stocks.

Ways to avoid capital gains tax on stocks.

How Much Will Capital Gains Cost Me?

The federal tax code is complex, and it isn’t always obvious exactly how much capital gains will cost you. However, it helps to have a basic understanding of how capital gains tax works.

There are two types of capital gains tax on stocks, and they come with different rates. Short-term capital gains and long-term capital gains. Understanding the differences is the first step in lessening your capital gains tax.

Short-Term Capital Gains

Short-term capital gains are for stocks owed for less than one year. This rate is equal to the ordinary income tax rate. This is also higher than the long-term rate. Thus, it helps to know exactly when you purchased shares of a given stock or fund. If you have to sell them anytime soon, you’ll save on taxes if you can wait until after the one-year mark.

Long-Term Capital Gains

Unlike short-term capital gains, long-term capital gains have their own tax rates. That said, long-term capital gains have income-based brackets. Long-term capital gains have a 0% tax bracket. This means you can avoid capital gains tax on stocks completely if your income is below these levels.

Also note that although long-term capital gains are not taxed as income, realizing those gains increases your AGI. This can push you into a higher income bracket.

How To Avoid Capital Gains Tax On Stocks

One way to avoid capital gains on stocks is to be below a certain income level. And you will also want to hold your shares for more than one year. But there are several other ways to lessen or avoid capital gains tax. We’ll go over those here.

No. 1 Contribute To A Tax-Advantaged Retirement Account

Certain types of retirement accounts come with significant tax advantages. In fact, with a Roth IRA, you won’t pay any taxes on capital gains. The same also applies to the less common Roth 401(k). In both cases, you pay all of the tax up-front with your contributions. However, you pay no tax when the money is withdrawn. Hence, you pay no capital gains tax on withdrawal.

No. 2 Donate Stock To Charity

Usually when we think about donating to charity, we often think about donating cash. But donating shares of stock instead can have significant tax advantages. And this includes reducing or eliminating capital gains.

You won’t pay capital gains tax at all on shares of stock you donate to a charity. Plus, the value of the shares on the day of the donation can be used as a tax deduction if you are eligible to itemize. If so, donating shares can reduce your taxable income. This leads to a lower tax bill.

Your total itemized deduction must exceed the amount of the standard deduction for the current tax year and your filing status to be eligible.

No. 3 Hold Shares Of A Qualified Business Stock

If you hold shares in a company with less than $50 million in assets and have held them for at least five years, they may be eligible for a capital gains exclusion of up to $10 million. Or, 10 times their cost basis. This part of the tax code is meant to encourage investments in startups and small businesses.

How To Avoid Capital Gains Tax On Stocks: No. 4 Invest In The Opportunity Zone

Opportunity Zones are a new tax provision created by the Tax Cuts and Jobs Act, passed in 2017. Like qualified business stock, this provision is intended to encourage investment. In this case, however, the goal is to foster investment in underserved communities.

For example, you can choose to invest in real estate or a small business in one of the federally recognized Opportunity Zones. If you invest unrealized capital gains within 180 days of a stock sale into an Opportunity Fund and hold it for a least 10 years, you pay no tax on any profit from the investment.

How To Avoid Capital Gains Tax On Stocks: No. 5 Don’t Sell Your Stock

If you intend to rely on income from capital gains as a major source of income in retirement, this strategy may not be the best option. But for some, such as wealthier individuals, holding onto some amount of stock until you die can be a way to pass wealth onto your heirs while avoiding capital gains.

The key to this strategy is what’s known as the stepped-up cost basis. The cost basis is the cost of an investment, including any commissions and fees paid. When you pass shares of stock to your heirs, they’ll receive a step-up in cost basis.

That means the value of the investment will be adjusted to the value of the investment as of the owner’s death, as opposed to their value at purchase. In other words, if the investments are sold before too long, your heirs will be able to avoid some or all of the capital gains that would have otherwise come with that stock.