Student loans are a necessity and reality for many college graduates today. With the average price tag for tuition coming in between $10,230 and $26,290 for in-state colleges, and a whopping $35,830 for private universities, it's no wonder so many students rack up loads of debt in pursuit of their diplomas. Throw in room and board, and other incidental costs like textbooks and supplies, and you've got the makings for an even larger pile of loans to contend with after college.

Now a large number of people live paycheck to paycheck post-graduation and can barely manage to keep up with their minimum student loan payments. But if you're a college grad with debt and are fortunate enough to be in a position where you have extra money coming in, you may be wondering whether you should use that cash to pay down your student loan balance or build the emergency fund you've been told you're supposed to have.

So let's be clear: Both are noble goals, and either one is a responsible thing to do with your money. But when your financial resources are limited, your emergency savings should always take priority.

When to pay off your student loans

If you graduated college with a pile of debt, you're probably itching to pay off those loans. You may be tempted to prioritize your loans when these situations arise.

You're paying a lot of interest on your loans

The sooner you knock out your student debt, the less interest you'll wind up paying on those loans, and the more money you'll save. This especially holds true if your loans happen to have a hefty interest rate attached to them, which will likely be the case if you borrowed privately for college.

Imagine you owe $30,000 in student loans at 9% interest, and your repayment period for those loans is 10 years. If you don't pay any of that debt off early, you'll wind up spending $15,600 -- more than half of your original loan balance -- on interest alone. And that's kind of nuts. On the other hand, if you have extra money at your disposal and are able to tack on an additional $200 to your monthly payments, you'll end up spending just $8,105 on interest, all the while cutting that 10-year repayment period down to more like five and a half years.

You plan to take out a different loan

There are benefits to minimizing your student debt outside of saving on interest. The more debt you have in your name, the harder it can be to borrow money, especially when seeking out a mortgage, auto loan, or personal loan. Therefore, if you're planning to take out another loan, it helps to get rid of your existing debt before doing so to bring down your debt-to-income ratio (a measure lenders use when evaluating borrowers). Not only will it increase your likelihood of getting approved, but it could also help you snag a more competitive rate.

You just plain hate the thought of owing money for college

For many people, the idea of being in debt is enough to drive them crazy. If you can't stand the notion of owing money for college long after the fact, to the point where it's impacting you mentally and emotionally, then that alone might motivate you to pay off your student loans ahead of schedule.

That said, your emergency fund still needs to take priority over paying off your student loans. In fact, it should actually take priority over any other financial goal you might have.

When to build your emergency fund

Even if you're itching to pay off your student loans, your emergency fund should still come first. Here's why.

You don't have three months of savings in the bank

If you don't accumulate some cash reserves in the bank, you'll risk landing in even more debt the next time an unplanned expense sneaks up on you. That expense could be a car repair, a medical bill, or a problem with your home. Or, it could be the loss of your paycheck when you find yourself fired or laid off out of the blue. And without money in savings, you may be forced to charge a major expense (or your general living expenses) on a credit card and pay that balance off over time, thereby accruing costly interest.

In fact, for many people, the primary motivator in paying off student loans is saving money on interest. But if paying down that debt causes you to neglect your emergency savings, you could wind up with -- you guessed it -- more interest charges on your hands, and higher ones at that, since the interest charged by credit cards can well surpass the interest attached to student loans.

How much emergency savings should you have? Ideally, enough to cover three to six months' worth of essential living expenses. By “essential,” we're talking about things like your rent, car payment, utilities, food, and healthcare -- things you truly can't live without.

The logic is that that amount could probably tide you over during a period of unemployment, or otherwise suffice in covering a major expense, whether it's a damaged roof, a busted transmission, or an emergency room bill. If you're nowhere close to the lower end of that range, then you shouldn't even think about knocking out your student loans until your savings reach a healthier state.

You need peace of mind

While student loans might be a drag, some people have a hard time sleeping at night knowing they have no cash reserves to tap when an emergency strikes. This especially holds true for people with variable income, or whose jobs are less than steady. And that's why your emergency savings should trump all other financial goals you've set for yourself.

You have some savings, but want or need more

If you do have three months of living expenses in the bank but are aiming for six months' worth, then you might prioritize your emergency savings even if your student  loans are begging to be paid down. In this situation, however, you might apply some of your extra cash to your student loans rather than put all of it in the bank. Remember, a three-month cushion is pretty respectable, and it gives you a decent amount of protection against unplanned expenses. Furthermore, even if you open a high-yield savings account, the amount you earn in interest will almost certainly be less than the interest you could save by paying off your loans ahead of schedule.

This especially holds true if you borrowed money for college privately. While the interest rates attached to federal loans are regulated by the government, private lenders are free to charge whatever interest rates they want. Therefore, if you're stuck with an exorbitant interest rate on your student loans and you already have enough money in savings to cover three months of expenses, you might build emergency savings while also putting some money toward your debt.

Emergencies first, student loans second

Once you have a solid six months' worth of essential living costs in the bank, it definitely pays to start focusing on eliminating your student debt. The sooner you knock out those loans, the sooner you'll get to move forward with a clean financial slate.

That said, you shouldn't neglect your student loans in an effort to build emergency savings. Once your payments start coming due, you'll need to make them on time and in full to avoid negative consequences -- namely, a damaged credit score. Furthermore, if you fall delinquent on your student loan payments, your lenders could actually go so far as to garnish your wages until they're repaid. Therefore, don't take the money you owe in loan payment form and stick it into savings. Rather, make those minimum payments, but use your extra money to build your emergency fund.

If that extra money is hard to come by, try rethinking your lifestyle a bit. Cutting back on expenses will allow you to save more money consistently, which should enable you to build cash reserves and also chip away at your debt. You might consider downsizing your living space to save a few hundred dollars a month, or giving up a car you can technically live without. Smaller changes, like cutting back on restaurant meals or canceling cable, will help as well.

At the same time, you might consider a side hustle if you want to amass three to six months' worth of living expenses and then knock out your student debt ahead of schedule. That second gig doesn't have to be a boring desk job, nor do you have to spend your evenings and weekends waiting tables or answering calls at a call center. Rather, you can take a hobby you enjoy, like photography, graphic design, or writing, turn it into an income stream, and then use your earnings to build savings and get your student loans done with.

There's no question about it: Your emergency fund should certainly take priority over your student loans. But once you have three months of living expenses socked away, you've got a decent amount of protection, at which point you can start using your extra cash to pay down your educational debt. And if you're sitting on six months of living expenses, you should definitely focus on knocking out your student debt from that point forward.