Investing Investing Basics

7 Clever and Legal Ways To Avoid Capital Gains Tax (It’s Not Too Late for 2024 Taxes)

There might be ways to lower your overall capital gains tax obligation.

happy young investor
Updated Nov. 29, 2024
Fact checked

We receive compensation from the products and services mentioned in this story, but the opinions are the author's own. Compensation may impact where offers appear. We have not included all available products or offers. Learn more about how we make money and our editorial policies.

Capital gains are incurred when shares of a stock are sold for more than you paid for them. The taxes on these gains will depend on how long the shares were held.

Understanding how capital gains taxes work can help you manage the tax bill incurred from stock sales, which is a smart money move when trying to build wealth. When investing money, you should always understand how it could be taxed.

Here’s how capital gains tax works with taxes and how you might avoid a big capital gains tax bill.

Steal this billionaire wealth-building technique

The ultra-rich have also been investing in art from big names like Picasso and Bansky for centuries. And it's for a good reason: Contemporary art prices have outpaced the S&P 500 by 136% over the last 27 years.

A new company called Masterworks is now allowing everyday investors to get in on this type of previously-exclusive investment. You can buy a small slice of $1-$30 million paintings from iconic artists, all without needing any art expertise.

If you have at least $10k to invest and are ready to explore diversifying beyond stocks and bonds,see what Masterworks has on offer. (Hurry, they often sell out!)

What are capital gains taxes?

Elnur/Adobe How to Calculate Taxable Income in 5 Straightforward Steps

Capital gains as they pertain to stocks occur when an investor sells shares of an individual stock, a stock mutual fund, or a stock ETF for more than they originally paid for the investment.

ETFs and mutual funds can also incur capital gains realized from the sales of the stocks held within the mutual fund or ETF.

The Internal Revenue Service defines capital gains as either short-term or long-term:

  • Short-term capital gains: Capital gains on stocks that are held for less than one year are taxed at your ordinary income tax rate. There is no different treatment for tax purposes.
  • Long-term capital gains: If the shares are held for at least one year, the capital gain is considered to be long-term. This means the gain is taxed at the long-term capital gains tax rate, which is lower than the ordinary income tax rates for many investors.

Want to learn how to build wealth like the 1%? Sign up for Worthy to get ideas and advice delivered to your inbox.

How capital gains on stocks are taxed

wutzkoh/Adobe Reasons to Refinance Your Mortgage

The tax rates on long-term capital gains vary a bit based on your filing status and your adjusted gross income (AGI). 

Here are the capital gains tax rates for the 2024  tax years for the various tax filing statuses.

Tax year 2024

Capital Gains Tax Rate AGI – Single Filers AGI – Married Filing Jointly AGI – Head of Household AGI – Married Filing Separately
0% $0 - $47,025 $0 - $94,050 $0 - $63,000 $0 - $47,025
15% $47,026 - $518,900 $94,051 - $583,750 $63,001 - $551,350 $47,026 - $291,850
20% $518,901 or more $583,751 or more $551,351 or more $291,851 or more

How to avoid capital gains taxes on stocks

prostooleh/Adobe Do You Need a Waiver of Premium Rider on Your Life Insurance Policy?

Managing the tax impact when investing in stocks is always a good idea. 

However, tax considerations should simply be a part of the process and not the driver of your investing decisions. That said, there are many ways to minimize or avoid the capital gains taxes on stocks.

Get a free stock valued between $5 to $200

Secret: You don't need thousands of dollars to buy thousand-dollar stocks or create a diverse portfolio.

Robinhood offers a method of investing called “fractional shares.” On its own, one share of a single stock could cost a lot of money, making it difficult to diversify. Robinhood allows you to buy pieces of stock instead, so you have the option to build a diverse portfolio quickly.

Let’s say you want to invest $250, as an example.

With that amount, you could build a relatively diverse portfolio with an investment of $50 in a big tech stock, $50 in a retail stock, $50 in an energy stock, $50 in a manufacturing stock, and $50 in a bank.1

Even better news? Add a Robinhood Gold membership, and you’ll get access to 4.25% (as of 11/15/24) APY2on your uninvested cash3and the ability to buy and sell stocks 24 hours a day, 5 days a week.

Open and fund a Robinhood account and earn up to $200 in stock

Work your tax bracket

arekmalang/Adobe tax bracket paperwork

While long-term capital gains are taxed at a lower rate, realizing these capital gains can push you into a higher overall tax bracket, as the capital gains will count as a part of your AGI. 

If you are close to the upper end of your regular income tax bracket, it might behoove you to defer selling stocks until a later time or to consider bunching some deductions into the current year. 

This would keep those earnings from being taxed at a higher rate.

Use tax-loss harvesting

standret/Adobe Hedge fund investor looking at computer

Tax-loss harvesting is an effective tool whereby an investor intentionally sells stocks, mutual funds, ETFs, or other securities held in a taxable investment account at a loss. Tax losses can be used in several ways including to offset the impact of capital gains from the sale of other stocks.

Capital losses are used to offset capital gains as follows:

  • Long-term losses offset long-term gains
  • Short-term losses offset short-term gains

Any excess losses of either type are used to offset additional capital gains first. Then, to the extent that your losses exceed your gains for the year, up to $3,000 may be used to offset other taxable income. Additional losses can be carried over to use in subsequent tax years.

Donate stocks to charity

Krakenimages.com/Adobe Charity volunteer

You might be able to avoid capital gains tax by donating to charity. Donating shares of stock to a charity offers two potential tax benefits:

  1. You will not be liable for taxes on any capital gains due to the increased value of the shares.
  2. The market value of the shares on the day they are donated to the charity can be used as a tax deduction if you are eligible to itemize deductions on your tax return. 

Buy and hold qualified small business stocks

oatawa/Adobe Woman checking Bitcoin stock

Qualified small business stock refers to shares issued by a qualified small business as defined by the IRS. This tax break is meant to provide an incentive for investing in these smaller companies. 

If the stock qualifies under IRS section 1202, up to $10 million in capital gains may be excluded from your income. 

Depending on when the shares were acquired, between 50% and 100% of your capital gains may not be subject to taxes. It's best to consult with a tax professional knowledgeable in this area to be sure.

Reinvest in an Opportunity Fund

goodluz/Adobe Guide to REITs

An opportunity zone is an economically distressed area that offers preferential tax treatment to investors under the Opportunity Act. This was a part of the Tax Cuts and Jobs Act passed in late 2017. 

Investors who take their capital gains and reinvest them into real estate or businesses located in an opportunity zone can defer or reduce the taxes on these reinvested capital gains. 

The IRS allows the deferral of these gains through December 31, 2026, unless the investment in the opportunity zone is sold before that date.

Hold onto it until you die

Mediteraneo/Adobe Family laughing in park

This might sound morbid, but if you hold your stocks until your death, you will never have to pay any capital gains taxes during your lifetime. 

In some cases, your heirs may also be exempt from capital gains taxes due to the ability to claim a step-up in the cost basis of inherited stock.

The cost basis is the cost of the investment, including any commissions or transaction fees incurred. A step-up in basis means adjusting the cost basis to the current value of the investment as of the owner’s date of death. 

This can eliminate some or all of the capital gains taxes that would have been incurred based on appreciated investments' original cost basis. 

Earn up to a $300 bonus and grow your money with up to 4.00% APY

This powerful combination checking + savings account from SoFi® allows you to earn up to a $300 bonus with direct deposit and grow your money with up to 4.00% APY.4

This is one of the top accounts we’ve seen, and offers like this can be rare. You work hard, and now it’s time to make your money work for you — with SoFi, you can grow your money with hardly any effort!

SoFi has no account or overdraft fees5 and additional FDIC insurance up to $2 million on deposits is available through a seamless network of participating banks.67 Plus, you can receive your paycheck up to 2 days early.8

How to earn up to $300: Sign up and make a direct deposit within the first 25 calendar days of the promotional period, then collect a $300 cash bonus with a direct deposit of $5,000 or more.

SoFi is a Member, FDIC. 7

Open your SoFi account and set up direct deposit

Use tax-advantaged retirement accounts

Yakobchuk Olena/Adobe Retired woman with dog

If stocks are held in a tax-advantaged retirement account like an IRA, any capital gains from the sale of stocks in the account will not be subject to capital gains taxes in the year the capital gains are realized.

In the case of a traditional IRA account, the gains will simply be added to the overall account balance and will not be subject to taxes until withdrawal in retirement. 

In a Roth IRA, capital gains are part of the account balance and can be withdrawn tax-free as long as certain conditions are met. This tax-free growth is one reason many people opt for a Roth IRA.

Bottom line

JenkoAtaman/Adobe Couple throwing paperwork

Stocks could be a solid wealth-building tool for some investors. But it’s important to understand how stocks can be taxed and to consider those tax implications in your financial planning.

Incurring capital gains means that you have sold shares of a stock for more than you paid for it, but proper tax planning can help manage your tax liability and help you get ahead financially.

If you have questions about your tax situation, consider speaking with a tax advisor.

Masterworks Benefits

  • Invest in art like a millionaire for a relatively low cost
  • Art investments have outperformed the S&P 500 by over 131% for 26 years
  • Purchase shares of artwork by top artists
  • Hedge against inflation and diversify your portfolio