One of the reasons I love recommending a Roth IRA to someone who is somewhat hesitant to get started in investing is the ability to withdraw your Roth IRA contributions at any time. What’s the risk in dropping $5,500 into the account when, in an emergency, you could pull it back out and use it if needed.

I won’t argue that this is the best way to be investing, not by a long shot. But for someone just starting out, knowing they could access the money if they had to is a little bit of extra security. The question is, can you withdraw it if your account has lost money? The short answer is yes, and this is why.

Let’s start by defining the two types of money in your account and the implications of taking either type out.

Withdrawing Contributions vs. Earnings

Here’s how withdrawing your contributions works normally. Absolutely 100% of the funds you invest—or contribute—to a Roth IRA can be withdrawn at any time. You don’t have to wait until age 59½ to pull your contributions out of the account. You don’t pay any extra tax or fees to the Internal Revenue Service. You go in, make your withdrawal, and you’re done. But this only applies to your contributions, not your earnings.

Your earnings, on the other hand, are subject to the regular income tax and penalties you see from early withdrawals in other retirement accounts. The taxes and penalties don’t apply to your Roth contributions because you have already paid tax on them. You will never pay income tax on them again.

What Qualifies as an Earning?

So you might be wondering what exactly qualifies as an earning inside your Roth account. Do dividends count as earnings? The answer is yes. So does any interest or other income your investments have earned.

You want to be careful not to withdraw your earnings, so defining them is key. Luckily, this is simple: Your earnings inside a Roth are anything above what you’ve contributed. If you put $5,500 in last year and your account balance (across all Roth IRAs you own, not just this specific one) is $5,600, you have contributions of $5,500 and earnings of $100. You could withdraw the full $5,500 if you wanted to and leave the $100 to grow on its own.

Individual Investment Earnings and Losses in a Roth

As you’re figuring the growth in your account, you may find that some investments did very well and some lost money. How does this factor into the equation? Again, when you’re trying to determine how much you can contribute it is based on the value of all of your Roth IRA accounts.

If your balance has gone up, regardless of Investment A growing 100% and Investment B falling 75%, then you have earnings. Those earnings would be taxed and penalized if you withdrew them early; the contributions would not be.

Withdrawing When Your Balance is Lower Than Your Contributions

What happens when you have contributed more than what is currently available in the account? If you contributed $5,000 last year and your account balance currently sits at $4,000, you have taken an overall 20 percent loss. Even if some of your investments have made money, as long as you’ve lost money overall, your Roth IRA balance is not considered to have earnings.

In this scenario you could withdraw the full $4,000 from the account without paying tax or penalties. Your contributions stack up to $5,000 and you only have access to $4,000, so none of the money is considered “earnings.” Until you have withdrawn 100 percent of the dollar amount that you contributed, you don’t need to worry about being penalized for withdrawing any earnings.

One Final Point

Think carefully before withdrawing any money from your account, whether it’s contributions or earnings. Even if your investments didn’t do well in a particular year, they may earn it all back in the future. Or you can switch to different investment products. You are losing tax-free growth of your funds to support your retirement if you take them out. Withdrawing money from your Roth IRA should be a last resort in times of serious financial need.

Compare Popular IRA Providers