When stock markets become volatile, investors get nervous. In many cases, this prompts them to take money out of the market and keep it in cash. Cash can be seen, felt and spent at will, and having money on hand makes many people feel more secure.

But how safe is it really? Read on to find out whether your money is safer in the market or under your mattress.

The Benefits of Holding Cash

There are definitely some benefits to holding cash. When the stock market is in free fall, holding cash helps you avoid further losses. Even if the stock market doesn't fall on a particular day, there is always the potential that it could have fallen. This possibility is known as systematic risk, and it can be completely avoided by holding cash.

Cash is also psychologically soothing. During troubled times, you can see and touch cash. Unlike the rapidly dwindling balance in your brokerage account, cash will still be in your pocket or in your bank account in the morning.

However, while moving to cash might feel good mentally and help you avoid short-term stock market volatility, it is unlikely to be a wise move over the long term.

When a Loss Is Not Really a Loss

In a down market with your money invested in stocks, you may feel like you've lost money, but you really haven't. At this point, it's only a paper loss. A turnaround in the market can put you right back to break-even and maybe even put a profit in your pocket.

If you sell your holdings and move to cash, you lock in your losses. They go from being paper losses to being real losses with no hope of recovery. While paper losses don't feel good, long-term investors accept that the stock market rises and falls. Maintaining your positions when the market is down is the only way that your portfolio will have a chance to benefit when the market rebounds.

Inflation Is a Cash Killer

While having cash in your hand seems like a great way to stem your losses, cash is no defense against inflation. Inflation is the rate at which the level of prices for goods and services rises. 

You may think your money is safe when it's in cash, but over time, its value erodes. Inflation is less dramatic than a crash, but in some cases it can be more devastating to your portfolio in the long term.

The Opportunity Cost of Holding Cash

Opportunity cost is the cost of an alternative that must be given up in order to pursue a certain action. Put another way, opportunity cost refers to the benefits you could have received by taking an alternative action.

In the case of cash, taking your money out of the stock market requires that you compare the growth of your cash portfolio, which will be negative over the long term as inflation erodes your purchasing power, against the potential gains in the stock market. Historically, the stock market has been the better bet.

Time Is Money

When you sell your stocks and put your money in cash, odds are that you will eventually reinvest in the stock market. The question then becomes, "when should you make this move?" Trying to choose the right time to get in or out of the stock market is referred to as market timing. If you were unable to successfully predict the market's peak and sell, it is highly unlikely that you'll be any better at predicting its bottom and buying in just before it rises.

Be Careful About Buying High and Selling Low

Common sense may be the best argument against moving to cash, and selling your stocks after the market tanks means that you bought high and are selling low. That would be the exact opposite of a good investing strategy. While your instincts may be telling you to save what you have left, your instincts are in direct opposition with the most basic tenet of investing. The time to sell was back when your investments were in the black — not when you are deep in the red.

You were happy to buy when the price was high because you expected it to go higher. Now that it is low, you expect it to fall forever. Look at the markets over time. They have historically gone up. Companies are in business to make money. They have a vested interest in profitability. Investing in equities should be a long-term endeavor, and the long-term favors those who stay invested.

The Bottom Line

Once you've faced the facts, you need to have a plan. Figure out how much money you need to amass over time to meet your future needs, and develop a plan to help your portfolio get there. Find an asset allocation strategy that meets your needs. Monitor your investments. Rebalance your portfolio to correspond with market conditions, making sure to maintain your desired mix of investments.

After you reach your goal, move your assets out of equities and into less volatile investments. While the process can be nerve-wracking, approaching it strategically can help you keep your savings plan on track, despite market volatility.