If you're wondering what your taxable capital gains are on a holding and you haven't sold it yet, hold off. You can calculate your gain (or loss) on a stock only after you sell the stock. (Well, technically, you could calculate it, but it's meaningless if the stock is still being held and still moving up and down in value.) Once you sell, here's what to do:

First you'll need to figure out your "cost basis." Let's say you bought 100 shares of Excelsior Hair Growth Enterprises (ticker: SPROUT) at $25 each, paying your broker a $20 commission. Your total cost was $2,520 ($2,500 plus $20). That means your cost basis per share was $25.20. If you sell 50 of the shares a little later at $30 each, the proceeds will be $1,500 less another $20 commission, for a total of $1,480, or $29.60 per share ($1,480 divided by 50 is $29.60). Therefore, your capital gain per share is $29.60 minus $25.20, or $4.40.

Notice how incorporating commissions has knocked 60 cents off your per-share gain. People who ignore commissions are leaving money on the tax table. It can be serious money, too, when added up. If you sell 1,000 shares in a year and are able to knock off 60 cents from each share's gain, you'll avoid being taxed on $600, which isn't chump change.

Once you've determined your gain, you need to figure out how long you held the asset, to see whether it will be taxed as a short-term or long-term gain. Long-term gains, from assets held for more than a year, tend to have lower tax rates, while short-term gains are taxed at your income tax rates.

Here's a great overview of current capital gains rates and how they work, courtesy of our tax expert, Roy Lewis.

Get the scoop on taxes from the horse's mouth -- the IRS website -- and also at the Fool's Tax Strategies area. And for more tax guidance in general, drop by our Tax Strategies discussion board, which features many questions and answers.