When an investment you purchase increases in value, you have an unrealized gain until you decide to sell it, at which point you have a realized gain. Conversely, if an investment you own declines in value, you have an unrealized loss until you sell, or until the value of the investment increases. Here's how to calculate your unrealized gains and losses, and why it may be important.

How to calculate
Simply put, an unrealized gain or loss is the difference between an investment's value now, and its value at a certain point in the past. The calculation can be done for any time period, such as the unrealized gain over the past month, but the most useful unrealized gain/loss is calculated from the time at which the investment was originally made. And, the calculation is rather simple.

First, figure out the investment's current market value. For example, if you own 100 shares of a certain stock, and its current value is $70 per share; your investment is worth $7,000.

Next, calculate how much you originally paid. If you paid $65 per share for those 100 shares, your original investment was $6,500. If you want to be thorough, you can include trading commissions in your original cost, since they are part of your cost basis for tax purposes.So, if your brokerage charges a $9.99 commission, this amount can be added to your original cost if you want a precise unrealized gain/loss calculation to estimate taxes.

Finally, subtract the original amount you paid from the current value. So, in our example, the unrealized gain would be $500.

Why is it important?
Unrealized gains and losses can be useful to know because they let you know how your portfolio is performing. They are also known as "paper" gains and losses because they only exist on paper -- the money isn't yours until you sell.

Unrealized gains and losses can be important for tax-planning purposes. You only have to pay capital gains taxes on realized gains, so by calculating your unrealized gains, it can give you an idea of how much you could have to pay in taxes should you choose to sell. Similarly, many people use losses on investments to offset capital gains or other taxable income through a strategy known as tax-loss harvesting. Calculating your unrealized losses can let you know if you could potentially use your losing investments for a tax break.

The $15,978 Social Security bonus most retirees completely overlook
If you're like most Americans, you're a few years (or more) behind on your retirement savings. But a handful of little-known "Social Security secrets" could help ensure a boost in your retirement income. In fact, one MarketWatch reporter argues that if more Americans knew about this, the government would have to shell out an extra $10 billion annually. For example: one easy, 17-minute trick could pay you as much as $15,978 more... each year! Once you learn how to take advantage of all these loopholes, we think you could retire confidently with the peace of mind we're all after. Simply click here to discover how you can take advantage of these strategies.

This article is part of The Motley Fool's Knowledge Center, which was created based on the collected wisdom of a fantastic community of investors based in the Foolsaurus. Pop on over there to learn more about our Wiki and how you can be involved in helping the world invest, better! If you see any issues with this page, please email us at knowledgecenter@fool.com. Thanks -- and Fool on!

Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.

Compare Brokers