Disclosure

Disclosure

This content is provided for general informational purposes only, and is not intended to constitute investment advice or any other kind of professional advice. Before taking action based on such information, we encourage you to consult with appropriate professionals. We do not endorse any third parties referenced within the aforementioned article. Do not infer or assume that any securities, sectors or markets described in this article were or will be profitable. In addition, past performance is no guarantee of future results. There is a possibility of loss. Historical or hypothetical performance results are presented for illustrative purposes only.

How to avoid capital gains tax on stocks: 7 key strategies

With the right investment strategies and financial planning, you can legally reduce and even avoid paying capital gains taxes on stocks.

By:

Reviewer:

April 19, 2024

8 min read

What's Playbook? We're your friendly step-by-step app for growing your money and minimizing taxes so you can live the life you want, sooner. Learn more

Key takeaways

  • Profits from selling stocks and other capital assets are subject to capital gains tax.
  • The tax rate you pay on capital gains will depend on your taxable income, your filing status, and how long you hold your assets.
  • Investment strategies such as donating shares and tax-loss harvesting can help reduce your taxable income to minimize or avoid paying tax on capital gains.
  • Financial advisors can create a customized financial plan so that you incorporate the right investment strategies in your portfolio.

In this article

      Buying and selling stocks is one of the best ways to build wealth. Although you’ll have to pay taxes on those profits, certain strategies may get you off the hook.

      Keep in mind that having to pay capital gains tax is a good sign - it means your investments are earning positive returns. Still, there are legal ways to both enjoy your capital gains and avoid paying taxes on them. 

      In this guide, we’ll show you a few practical investment strategies to help you minimize capital gains tax on stocks.

      1. Hold stocks long-term

      By simply holding your stocks for more than one year after buying them, you can reduce the tax rate you’ll pay after selling. Here’s how: 

      Capital gains are the profits you earn from selling your stocks at a higher price than you bought them for, and the capital gains tax is how much you owe on the profit. The key is that the tax rate depends on how long you hold your asset, as well as your filing status and your taxable income.

      There are two types of capital gains: short-term and long-term.

      • Short-term capital gains: Profits earned from assets you’ve held for less than one year. 
      • Long-term capital gains: Profits earned from assets you’ve held for one year or longer. 

      Short-term capital gains are profits you earn from assets you sold less than a year after you bought them. These are taxed at ordinary federal income tax rates 10%, 12%, 22%, 24%, 32%, 35%, or 37% — depending on your filing status and income.

      2024 Federal income tax rates
      Tax rate Single Married, separate Married, jointly Head of household
      10% $0-$11,600 $0-$11,600 $0-$23,200 $0-$16,550
      12% $11,600-$47,150 $11,600-$47,150 $23,200-$94,300 $16,550-$63,100
      22% $44,150-$100,525 $44,150-$100,525 $94,300-$201,050 $63,100-$100,500
      24% $100,525-$191,950 $100,525-$191,950 $201,050-$383,900 $100,500-$191,950
      32% $191,950-$243,725 $191,950-$243,725 $383,900-$487,450 $191,950-$243,700
      35% $243,725-$609,350 $243,725-$609,350 $487,450-$731,200 $243,7001-$609,350
      37% Over $609,350 Over $609,350 Over $731,200 Over $609,350
      Source: IRS

      Long-term capital gains are profits from assets you sold after holding them for a year or longer. These are subject to capital gains tax rates. As of 2024, long-term capital gains tax rates are 0%, 15%, and 20%, depending on your total taxable income.

      2024 long-term capital gains rates
      Tax rate Single Married, separate Married, jointly Head of household
      0% $0-$47,025 $0-$47,025 $0-$94,050 $0-$94,050
      15% $47,026-$518,900 $47,026-$291,850 $94,051-$583,750 $63,001-$551,350
      20% $518,901+ $291,851+ $583,751+ $551,351+
      Source: IRS

      At every income level, it’s clear that holding your stocks long-term can save you considerably on your tax bill. After deductions, individuals with higher taxable income may be able to minimize (and even avoid) paying tax on capital gains. 

      Our capital gains tax calculator will help you estimate how much tax you’ll owe after selling an asset.

      2. Invest in tax-advantaged accounts

      Imagine if you could invest your money in a way that not only helps it grow over time but also limits what you owe in taxes. Good news: You can, thanks to tax-advantaged retirement accounts. 

      These types of tax-advantaged accounts can shelter investors from the capital gains tax, possibly for decades: 

      • Traditional 401(k)s, which take pre-tax contributions and defer taxes until retirement. You can avoid capital gains tax for as long as you leave your money in the account. You will pay income tax on withdrawals, which could be higher than your capital gain rate, but it’s still a net positive since you’ll avoid paying tax each time you sell. 
      • Roth accounts (IRA and 401(k) options available), that take after-tax income so your investments grow tax-free. You completely avoid taxes—both capital gains and income taxes—if you follow the age-based rules.

      The only catch with these accounts is that you have to wait until age 59½ to withdraw without penalty and truly enjoy the benefits of compounding interest.. Before contributing to tax-advantaged accounts, consider how much you can comfortably afford to set aside and won’t need for the foreseeable future.

      list of tax-advantage accounts to avoid paying capital gains taxes

      So many options also means you have to calculate and plan which mix of accounts is right for you, and in what order you should invest to maximize your tax reductions. This gets tricky, but Playbook can help you determine which accounts provide the best boost for your returns with the lowest taxes. 

      3. Harvest your tax losses

      In the world of investing, a loss can still be a win. Since the IRS allows you to write off certain trading losses, selling underperforming assets can help offset some capital gains. Identifying opportunities for “intentional” losses that reduce your tax liability is a popular strategy known as tax-loss harvesting. 

      Before we dig in, this isn’t a DIY project for beginner investors. There are a lot of rules and regulations you have to know to do this effectively and avoid costly penalties. If you want to try tax-loss harvesting, work with a qualified professional to actively manage your accounts

      Now, here’s a simplified example of how you can harvest your losses. Let’s say you have two long-term investments in your portfolio:

      • Stock A has 100 shares you bought at $100 per share, totaling $10,000
      • Stock B has 100 shares you bought at $300 per share, totaling $30,000

      Stock A’s price drops to $50 due to market volatility (now worth $5,000). Meanwhile, Stock B has increased in value and is now at $415 per share (now worth $41,500). 

      If you sell all of your stock shares, you have a $5,000 loss and a $11,500 gain. But since you sold them in the same tax year, you can net the two, leaving you with a $6,500 gain. This reduces your overall tax liability, so you owe less taxes and might even drop into a lower tax rate. 

      Seems simple enough in theory, but actually harvesting your losses is complicated. You also have to consider:

      • Tax rates: You’re not just calculating actualized gains, but also the taxes you owe on them.

        Using the example above, we’d consider that Stock B’s $11,500 gain on top of the median American income of $40,480 would result in a 15% long-term capital gains tax rate (assuming single filer status).

        However, since selling Stock A reduces total gains to $6,500, for a total income of $46,980, you fall into the 0% capital gains tax bracket and wouldn’t owe anything on long-term gains.
      • Stock value: Purposefully selling a stock that is underwater to save on capital gains is likely not a good strategy. The only exception is if you plan on reinvesting that money into something else.

      • Wash-sale rule: The IRS will look into your investment history to ensure you’re not buying and selling identical stocks and securities to game tax losses. If you sell an asset and purchase the same asset within 30 days, you can’t harvest any losses. Abusing wash-sale rules can also result in heavy fines or penalties. 
      • Tax deduction limits: If you have more capital losses than capital gains, you can claim the excess loss each tax year up to $3,000 a year (or $1,500 for separate married filers), or your net loss – whichever is less. If your net loss is more than that limit, you can carry the loss over to future tax years. The losses will become a deduction from your ordinary income. 

      4. Donate assets to charity

      Did you know that donating investments can offset capital gains, too? Donor-advised funds allow you to make a large contribution to later send out as grants to charities. Just as with other qualified charitable contributions, your initial contribution earns you a tax deduction for the year and reduces your taxable income.

      Like other capital assets, your tax bill and advantages depend on whether you held the asset long-term or short-term. Long-term assets are still more advantageous for donations since you can avoid paying capital gains taxes while still claiming a tax deduction for the asset’s fair market value. 

      Your tax deduction is based on the long-term asset’s fair market value at the time of donation. So if you donate 100 shares you purchased at $100/share, which are now valued at $200/share, your deduction is based on the $200/share price, or $2,000 total donation. 

      You can still take deductions on short-term gains, but it’s applied with the current market value or the asset’s original value – whichever is less.

      Know that tax deductions are only available on asset values up to 50% of your adjusted gross income, with 20% and 30% limitations in certain cases. This also means that the more you make, the more valuable charitable deductions are since you can make larger donations and more significantly reduce your taxable income.

      So, if you have a high-value, long-term asset you’re looking to donate, consider if a career switch or promotion is in your future and if holding the asset a little longer will pay off. Keep in mind that you’ll have to itemize your deductions to take advantage of this option. 

      Charitable remainder trusts

      Similarly, you can receive a charitable deduction for donations to a Charitable Remainder Trust (CRT). This type of trust lets you donate appreciated assets and earn income from them for a period of time before the charity of your choice finally claims the remaining donation. 

      This is an excellent option for estate planning, in particular. 

      Once the trust is created, you name at least one beneficiary. That individual receives payments for a predetermined term, up to 20 years, or for the beneficiary’s remaining life. And since everything is in a trust, it’s removed from the estate and potentially protected from expensive estate taxes. 

      Once the payment term ends, the chosen charity receives the remaining trust balance as a donation. The ending balance has to be equal to or greater than 10% of the initial fair market value invested in the trust. 

      There are two types of CRTs:

      • Charitable remainder annuity trusts (CRAT) pay a specific dollar amount annually, somewhere between 5-50% of the trust’s initial value.
      • Charitable remainder unitrusts (CRUT) pay a percentage annually, with values ranging between 5-50% of the assets’ fair market value, determined annually. 

      While you can earn tax deductions for the CRT, you and your beneficiary can’t avoid taxes altogether. Payments come from specific sources in a specific order, and you’ll owe taxes according to the payment source:

      • Payments from ordinary income are paid out first and taxed at your federal marginal tax rate.
      • Once all ordinary income has been distributed, you’ll owe capital gains taxes on payments earned from the sale of trust assets. 
      • Next, payments are made from other income, including tax-exempt income. 
      • Finally, any remaining payments are part of the principal or corpus and aren’t subject to taxation. 

      5. Pass on stocks through estate planning

      As an investor, there’s no more rewarding feeling than seeing your stocks go up. However, when your assets appreciate in value, so does your potential tax liability. Fortunately, an estate planning strategy can help your family avoid capital gains taxes on stocks.

      Under estate tax exemptions, you can add stocks and other assets to your estate, and your heirs will not have to pay taxes on all the gains accumulated since you bought them. Instead, your heirs will only owe capital gains tax on the increase in value from the time they inherited your assets. This value adjustment is called a step-up in basis.

      For example, if you purchased stock at $10,000 and sold it for $100,000, you may owe capital gains tax on the $90,000 profit.  

      However, if you hold onto the stock and your son or daughter inherits it when you die their basis gets “stepped up” to the fair market value, or  $100,000. If they later sell the stock for $120,000, they will only owe capital gains tax on the $20,000 increase in value, which falls under the 0% tax bracket for long-term assets. 

      With a good estate planning strategy, you can include stocks in your estate you expect to appreciate significantly, creating a tax-efficient way to transfer wealth and avoid capital gains taxes.

      6. Take advantage of your cost basis

      Leveraging your cost basis can be a powerful strategy to minimize capital gains taxes if you’ve bought shares of the same stock at different times and prices, or “tax lots.” For tax purposes, your cost basis is the original value of your stock adjusted for stock splits, dividends, and return of capital distributions.

      If you use a brokerage to buy stocks, most will track and report your cost basis for you on statements and tax forms.

      There are a few strategies for utilizing your cost basis:

      1. Specific Identification Method: Involves choosing specific shares to sell based on their purchase date and price. This requires careful recordkeeping but offers more flexibility to manage your capital gains liability strategically. By selecting shares with a higher cost basis and longer holding period for sale, you reduce the taxable gain compared to selling shares with a lower cost basis.
      2. High Cost Method: Here, you sell shares that were purchased at the highest cost first. This strategy can minimize your capital gains tax by selling shares with the lowest capital gains.

      To illustrate the high cost method, let’s say you have three tax lots of the same stock: 

      1. Lot 1 bought at $10 per stock in 2020.
      2. Lot 2 bought at $20 per stock in 2021.
      3. Lot 3 bought at $25 per stock in 2022.

      As of today, each stock is worth $30 per share. Selling from the first lot gives you a capital gain of $20, from the second lot, a capital gain of $10, and from the third lot, a capital gain of $5. 

      By selling shares from Lot 3 when the purchase price was the highest, your capital gains tax liability will be significantly lower than Lot 1 or Lot 2.

      While this may sound simple enough, in practice, it requires careful planning and is not advised for amateurs to try without a professional’s help. Here are a few other important considerations:

      • Holding Period: Long-term capital gains are taxed at a lower rate than short-term capital gains. Consider the holding period of each lot before selling to optimize for tax rates.
      • Market Conditions: Tax considerations are important but shouldn’t be the sole factor in your portfolio decision-making process. For example, if you expect market conditions to get worse, you may want to sell additional shares or lots to secure gains and protect against losses.
      • Wash Sale Rule: The wash sale rule still applies here. If you buy the same stock within 30 days before or after the sale, you cannot take advantage of the tax benefits from leveraging your cost basis.

      7. Hire a professional advisor

      The right tax-efficient investment strategies will always depend on your financial circumstances. Since taxes can significantly impact your portfolio performance, consulting with a professional financial advisor could be worth it

      With expertise in tax and financial planning, an advisor can tailor recommendations to your specific goals, helping ensure you have a well-diversified portfolio that is taxed at the lower end of capital gains rates. They can also stay informed about changes in tax laws and IRS regulations, empowering you to make the best financial decisions.

      list of 7 strategies to minimize capital gains tax on stocks

      The Playbook take: Don’t let the tax game outsmart you

      When done right, investing long-term and leveraging tax-efficient accounts can help you minimize and even avoid the capital gains tax you’ll pay on your winning stocks. Creating a strategic approach, however, isn’t easy for every investor. 

      Need help in optimizing your investment portfolios for tax efficiency? Sign up today to see how you can outsmart your taxes and invest like a pro.

      FAQs

      Can I sell stock and reinvest without paying capital gains taxes?

      Yes, it is possible to sell certain investments and reinvest the proceeds without paying capital gains taxes. This can be done through your retirement accounts, since your returns aren’t taxable until you make withdrawals. However, this method doesn’t work for stock owned in regular taxable accounts. In these cases, you will pay capital gains taxes based on how long you held the investment.

      There are also wash-sale rules that prevent you from repurchasing those assets or similar stock within 30 days of selling them. A tax professional can help you implement a systematic approach to selling stock that minimizes capital gains.

      How long do you need to hold a stock to avoid capital gains tax?

      In general, you need to hold a stock for one year or longer to benefit from the lower tax rate. Of course, there are exceptions to this rule to keep in mind. Avoiding capital gains tax altogether will depend on your income level and investment strategy.

      About the author

      Theo Katsoulis, CFA

      Head of Investments

      Theo brings an extensive background in Institutional Asset Management. With a B.A. from Villanova University's School of Business, and having passed the rigorous Series 65 and CFA examinations, he brings significant expertise from portfolio management to understanding intricate financial infrastructures. As Head of Investments at Playbook, he ensures consumers receive exceptional diligence and care for their investment portfolios.

      Tanza Loudenback, CFP®

      Editor

      Tanza is a CFP® certificant, writer, and editor. From 2015 to 2021, she was a top-read author and editor at Insider. Her work focuses on helping people make smart decisions with their money and is published by a variety of online publications.

      Get an airtight financial plan
      in minutes.
      Playbook is a step-by-step app for growing your money and minimizing taxes so you can live the life you want, sooner.

      Save your cents from Uncle Sam

      Grow your wealth with a personalized financial plan and tax-advantaged investments.

      Start saving today

      Save your cents from Uncle Sam

      Grow your wealth with a personalized financial plan and tax-advantaged investments.

      Start saving today

      Save your cents from Uncle Sam

      Grow your wealth with a personalized financial plan and tax-advantaged investments.

      Start saving today

      In this article