The total you earn from your investments in 2018 will depend on their performance and the amount of tax you pay on them. Below are five steps you can take when doing your year-end tax planning to maximize your after-tax investment returns in 2019.

Five Steps to Maximize Your After-Tax Returns

1. Harvest a smart investment loss.

The tax code allows a net capital loss of up to $3,000 annually to be deducted against ordinary income such as salary. So by realizing before year-end what up to now has only been a “paper” investment loss, you can pay less to the IRS without reducing your investment holdings.

For example, if you own shares in a mutual fund that are now worth $60,000 after having declined in value by $10,000 since you bought them. Instead of simply holding the shares into 2019, you can sell enough by year-end to realize a $3,000 capital loss. You will still own the same $60,000 in investment assets (in shares plus cash proceeds from the sale) while also cutting your tax bill.

The IRS “wash sale” rule bars you from repurchasing the same securities within 30 days or the tax loss will be disallowed, but you can use the sale proceeds immediately to purchase similar securities, such as shares in a similar mutual fund.

2. Offset capital gains and losses.

If your portfolio is more complex, you may already have taken gains and losses on taxable investments sold during 2018 while still owning other investments that have fluctuated in value. Realizing a gain or loss on these in an opportune amount by year-end may slash your total tax bill on investments. If you have taken net gains to date, the tax due on them may be reduced or converted into a deduction worth up to $3,000 by harvesting losses before year-end.

Conversely, if you have already taken a net loss of more than $3,000, you can realize gains to reduce the net loss to $3,000, with the gains being sheltered from tax. For instance, if you have taken a net $10,000 capital loss to date, you can take a tax-sheltered gain of $7,000 now while keeping $3,000 in losses to deduct.

You can do this and probably keep your investment position intact. As noted above, when you sell securities to realize a loss you can buy back the same securities after 30 days or similar securities immediately. When you generate a gain by selling securities you can repurchase the same securities immediately.

Generally, it’s best to plan to offset short-term gains, which are taxable at top tax rates, with short-term losses. Similarly, offset long-term gains, which receive a favored tax rate, with long-term losses. To learn more about the technical rules that apply to capital gains, and the order in which realized gains are offset on your tax return, see the free IRS Publication 544, Sales and Other Dispositions of Assets. (Read more about tax-loss harvesting and the pros and cons of annual tax-loss harvesting.)

3. Rebalance your portfolio.

Remember the need to maintain proper diversification when reviewing your investment results for the year. Say that your desired diversification is 50% stocks and 50% bonds. Unless your stock and bond investments have produced the same return since the last time you allocated your holdings, your portfolio has moved away from your desired balance.

Reallocating your holdings back to the desired balance will require the sale of some investments, and by doing it just before year-end, you can identify for sale those investments that will produce the most tax benefit for the year.

Also, maintain the best diversification between taxable investments and tax-deferred retirement accounts such as traditional IRAs and 401(k)s. Taxable investments qualify for favorable long-term capital gains tax rates while distributions from tax-deferred accounts are taxed at higher regular rates. Therefore, as you reallocate, move interest-paying investments into tax-deferred accounts to obtain tax-free compounding and appreciating investments into taxable accounts to obtain capital gains tax treatment.

4. Consider a Roth IRA conversion.

Distributions from traditional IRAs are taxed at ordinary rates while those from Roth IRAs can qualify as tax-free. In addition, Roth IRAs are not subject to required minimum distributions after age 70½ so they can hold retirement funds longer and may be better used to provide funds for heirs. When a traditional IRA is converted into a Roth IRA, its value is taxed.

However, if you expect to be in a higher tax bracket in the future or the other Roth benefits are valuable to you, a conversion may be a good idea for these savings. Note that a Roth IRA conversion that was made in 2017 could be reversed if done by October 15, 2018. A Roth IRA conversion made on or after January 1, 2018, cannot be reversed.

5. Pay donations to charity and to support lower-income family members with appreciated securities.

When you donate appreciated securities to charity by year-end you can deduction their full market value on this year’s tax return while also escaping ever having to pay capital gains tax on them in the future. Similarly, if you support family members who are in a lower capital gains tax bracket than you, by giving them appreciated long-term gain securities instead of cash you will reduce the tax on the securities and lower the family’s tax bill. In each case, you come out ahead by avoiding a future capital gains tax bill.

The Bottom Line

You can boost your hard-earned investment returns by taking steps before year-end to protect them from the IRS. These five strategies can all be customized to provide the most benefit for your specific situation. Since they are subject to various technical rules, consider consulting with a professional tax advisor.