Q: I sold some of my stocks in 2017. Will I need to pay capital gains tax, and what tax forms do I need?

There are different tax implications for retirement and non-retirement brokerage accounts, and it also depends if all of your stocks were sold at a profit, or if you had some losses as well.

If you sold stocks in a retirement account, such as an IRA, you won't need to pay capital gains taxes on the sale. Traditional IRA funds are taxable as ordinary income, but only when you withdraw money. Roth IRA funds are not taxed at all, provided you make a qualified withdrawal that doesn't trigger a penalty. Either way, if you withdrew money from a retirement account in 2017, you should receive a Form 1099-R from your brokerage.

On the other hand, if you sold a stock at a profit in a regular (taxable) brokerage account, you may have to pay capital gains tax. Short-term gains (if you held the stock for a year or less) are taxed as ordinary income. Long-term gains qualify for lower rates.

If you had any losses on stock sales, you can use them to reduce your capital gains. Long-term losses must be used to offset long-term gains before they can be applied to higher-tax short-term gains. And if your losses exceed your gains for the year, you can use up to $3,000 in losses to offset your other taxable income.

As far as tax forms go, you should receive a Form 1099-B from your broker that gives you a summary of your stock sales for the year. Your 1099-B may be issued as part of a consolidated 1099, especially if you received interest and/or dividend income in your brokerage account as well.