Many companies featured on Money advertise with us. Opinions are our own, but compensation and
in-depth research may determine where and how companies appear. Learn more about how we make money.

Imagine that your roof starts to leak. Or your car breaks down. Or, worst of all, a pink slip lands on your desk.

The credit cards in your wallet could likely keep you dry, on the road, and well fed, but running up significant debt can cause a major setback to your financial plan. That’s why you always need to have ready access to a chuck of cash—that is, an emergency fund—that allows your financial life to stay on track even if you encounter a significant, unexpected expense.

So how much do you need to stash? A broad guideline is three to six months’ worth of the money that you need for all non-discretionary expenses (such as health insurance, your mortgage and food). That way, you have enough that if you were to lose your job, you’d be able to continue paying your household bills while you looked for another one.

CALCULATOR: Are my current retirement savings sufficient?

That number can differ, though, depending on your individual circumstances. Are you a college professor with tenure? Three months’ worth of savings might be sufficient. The sole breadwinner and working in a business where income can fluctuate from year to year? Aim for nine to 12 months’ worth, minimum. Saving that much may seem daunting, but it’s okay to let the fund build gradually. Just keep putting some amount away every month.

Read next: 3 Strategies for Rebuilding Your Emergency Fund

Make sure your emergency cash is stashed in an account that’s separate from your regular checking and savings, so you’re not tempted to tap the money. You also want the funds to be completely safe and liquid—which means an FDIC-insured savings or money market account. If the rate of return on that account is paltry, that’s okay. After all, says Greg McBride senior financial analyst at Bankrate.com, “It’s not an investment—it’s a safety net.”