It’s never fun to pay capital gains taxes on investments you hold. It’s significantly less fun to have to pay them in a year where your account balances have suffered heavy losses.

That however, is the scenario many may face this year. Today, I want to provide some insight into how this could happen to you, and what you can do to avoid getting hit by a surprise tax bill this April.

For those who don’t know, capital gains taxes are taxes owed on the profits from investments that have been sold within that year. You may be thinking that since the individual investments you have are showing losses in 2022 you are sheltered from owing any sort of capital gains taxes this year. That is not the case however.

For stocks and ETF’s held in non-qualified accounts, the gains or losses for the year are totally irrelevant. What matters is what you originally paid for the position, and what you sold it for. If the sell price was higher than the buy price you will owe capital gains on the difference.

This becomes even more confusing if you hold mutual funds. You don’t even have to sell a mutual fund to incur capital gains on it. Because of this, you may owe capital gains taxes on mutual funds you currently hold, despite their overall loss in value for 2022.

You may be wondering how that is possible? Let me explain. When you own a mutual fund, what you own is a fractional portion of larger pool of money that is invested in stocks, bonds and other investments by a professional money manager. These money managers often actively buy and sell securities inside of that fund as a way of growing that overall pool of money they have been entrusted to manage.

Some of those individual investments within the fund produce gains, and others produce losses. At the end of each year, if the net result of the realized gains and losses is positive, those gains are distributed to the shareholder in the form of taxable gains.

Because the past several years have been so strong for the market, many mutual funds may have entered into 2022 with high unrealized gains in the securities that fund held. If the fund manager, then decided to sell some of those underlying positions when the market started to fall in early 2022 those realized gains will be distributed to all shareholders near the end of the year regardless of whether you personally received the benefit of those gains or not. That’s why, especially at this time of year, investors need to be mindful of a fund’s PCGE-Potential Capital Gains Exposure before buying into it.

If you are facing large realized capital gains this year, it’s not too late to take action to reduce or even eliminate them. The best way to do this is through a strategy called tax harvesting. Put simply, tax harvesting is the selling of securities in your taxable portfolio that are currently at a loss to offset realized gains you may have generated in other positions. Beware however, if after selling a position for a loss, you buy back the same position, or a “substantially identical” position back in less than 30 days the wash sale rule will invalidate those realized losses.

Because your situation is unique and the cost of making a mistake can be substantial, I recommend you speak with an investing or tax professional before taking these types of actions on your investment accounts. However, just knowing that you are potential at risk for an unexpected bill from the IRS while you still have time to remedy your potential tax liabilities could keep you from the double shock of a smaller than expected account balance, and a larger than expected tax bill.