Contrary to popular belief, there’s nothing inherently wrong or financially unsavvy about taking out a mortgage while you’re still paying back student loans. Student loans can make the process (and the amount of mortgage you qualify for) more difficult, but lenders don’t tend to discriminate against applicants just because they’re carrying a student loan balance.

If you’re trying to pay back your student debt while purchasing a home, read on to learn some best practices and things to consider.

What You Need to Know

Buying a home is all about the numbers. One of the biggest numbers your lender will look for is your debt-to-income ratio, which should be 28% or less. In other words, the amount your income that you spend on debt payments every month should be no more than 28% of your monthly budget.

The more you spend on debt, the more susceptible you are to default on those loans if you lose your job or have an emergency. If you have a lot of student loans, your ratio may be too high to qualify.

The second number is a down payment. Most lenders require some down payment when you buy a home – the traditional number being 20%. A 20% down payment allows you to forego private mortgage insurance (PMI), which is what lenders charge if you have less than 20% equity in your home.

If you’re buying a $200,000 home, saving a $40,000 down payment can seem impossible when you have student loans. Fortunately, there are other options. The Federal Housing Authority has a 3.5% down payment program that’s much easier for borrowers. If you’re a veteran or buying a house in a rural area, you may be able to find 0% down payment loans, but be aware of funding fees and ending up upside down on your home before you even close (i.e. owing more than the home is worth). Plus, keep in mind that the less you put down on a home, the higher your monthly mortgage payment will be and the less you’ll have in cash flow to fund other goals like retirement, travel and entertainment and college funding.

Your credit score is an important factor in your ability to qualify for a mortgage and a great interest rate. The higher your credit score, the lower interest rate you’ll qualify for and the more attractive you’ll be to lenders. Making timely payments on your student loans can raise your credit score and help you to qualify you for a mortgage. Minimizing other consumer debt such as car loans and credit cards can also help in this area.

You can check your credit score through the three major credit bureaus at annualcreditreport.com. Some banks and credit card companies also give you access to your credit report for free on your monthly statement.

How to Save for a Down Payment

One of the biggest issues that plagues first-time buyers is saving for a down payment while paying off student loans. Even a 3.5% down payment on a $200,000 home requires you to save $7,000 – not including any closing costs and fees.

Go through your budget and see where you can cut to save for a down payment. Can you lose the gym membership you’re barely using or the subscription boxes that pile up each month? Can you cut back on eating out until you’ve bought your home? Cutting large expenses can be effective, but sometimes it’s better to make small changes in several areas at once.

Some people also pick up side gigs to pay for their down payment faster. One way to ensure success is to decide how much you need to save every month and then set up automatic transfers into an account established specifically for your down payment at your bank. You can continue doing this after you save your down payment to create a special emergency fund for your new home.

The bottom line is that you can simultaneously pay down loans and purchase a home. However, it’s important to consider factors like your income, the cost of homes in your area, your current life stage, if there are any transitions on the horizon, and where owning a home fits into your over all financial picture. You don’t want to have so much home that you’re not able to save for other important financial goals in your life.