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.

Graduation cap with a door opening in the middle.
Martín Elfman for Money

Purchasing a home when you have student debt is the modern age's ultimate financial balancing act — one that millennials know all too well. You must keep paying your loans like clockwork while saving enough money for a down payment.

But just because it’s more challenging doesn’t mean you have to miss out on the housing market. In fact, over 20% of Americans who purchased their homes last year had student loans under their belt, according to the National Association of Realtors.

Of course, high student loan payments will make it harder to qualify for a mortgage. But if you're caught between your dreams of becoming a homeowner and dealing with your student loans, there are steps that can help. Here’s what to do:

1. Make sure the time is right

Mortgage lenders typically prefer borrowers who have been employed for at least two years. Why? Because the longer you've been working, the more stable your income will be.

If you've been in the workforce for less than that, or you're just returning after an extended break, you may want to consider waiting a bit longer to improve your chances of approval.

Now, that doesn’t mean you have to stay in the same company for the whole two years. Laurie Goodman, founder of the Housing Finance Policy Center at the Urban Institute, says that what matters is that you stay in the same field and industry.

“If you're a computer analyst, for example, and you switch to a better paying job with another company that does computer analysis, it won’t affect you,” Goodman says. On the other hand, if you’re a nurse working at a nursing home and decide to ditch your job to become a school nurse, Goodman says that could “conceivably affect you," as you would be moving to a lower-paying field.

Goodman also points out that if you have other debt in addition to your student loans, you should try to pay it down as much as possible before applying for a mortgage. This not only will increase your chances of getting approved for the loan but will also help you secure a better term and interest rate, saving you money down the line.

2. Check if your credit needs a boost

Even if you’ve been paying your bills without missing a beat, that doesn’t mean your credit report is sparkling — the blemishes could even be mistakes. Rod Griffin, senior director of public education and advocacy at Experian, says that although “errors on credit reports are extremely rare,” it’s still worth taking a look.

Lenders typically require a credit score of at least 620 to approve you for the loan and a 740 to give you the best rates, so if your score is lower than that, you may want to work on it first, before applying.

You can get a free copy of your credit report from all three major credit bureaus (Equifax, Experian, and TransUnion) on AnnualCreditReport.com. Although these copies won’t include your score, you’ll be able to see information pertaining to your credit accounts, including credit limit, balance and payment history.

If anything seems amiss, you can contact each of the credit bureaus to have these errors corrected. You can do this by mail or by visiting their website.

However, if you have a complex situation with multiple mistakes and aren’t sure how to tackle them, you can hire a professional to fix your credit or a credit repair company. If you choose the latter, Griffin advises proceeding with caution, as this industry has been riddled with scammers in the past. Make sure you know your rights beforehand by reviewing the Credit Repair Organizations Act and by checking the company’s reputation on consumer review websites, such as the Better Business Bureau. One major red flag to be on the lookout for is if the company “guarantees” to give you a clean slate without checking your file or if they charge you for their services upfront.

Finally, if your credit is on the lower side not due to mistakes or a ton of debt, but rather because you don’t have a long credit history, you can always enroll in a free service like Experian Boost or UltraFICO. Both of these services report alternative credit data, like financial account activity and payments made to utilities or subscriptions, to bump up your score.

3. Lower your debt-to-income ratio

The debt-to-income ratio or “DTI” is a percentage that represents how much of your monthly income is eaten up by your debts. To calculate your DTI, simply add up your monthly minimum debt payments and divide that amount by your monthly gross pre-tax income.

Lenders usually calculate two types of DTI when you apply for a mortgage: front-end and back-end. The front-end DTI only considers your housing-related expenses (monthly mortgage payments, mortgage insurance, etc.), while the back-end DTI takes into account all of your monthly debt obligations, including your future mortgage payments.

Ideally, you should have a front-end DTI of no more than 28% and a back-end DTI of no more than 36% — although some types of mortgages, especially government-backed ones, allow higher DTIs.

If your DTI is on the higher side, you can obviously lower it by paying down debt. But if you have student loans, you may also be able to lower it by applying for an income-driven repayment plan or by refinancing or consolidating your student loans.

Income-driven repayment plans can lower your federal student loan monthly payments by tying the amount due to a percentage of your income. The catch? Not all mortgage programs consider the adjusted monthly payments made through the income-driven repayment plan as a lower debt obligation (more on that later).

Likewise, if your goal is to reduce your DTI by consolidating or refinancing your loans, you’ll have to choose a longer repayment term with a lower monthly payment — which means you’ll likely pay more on your loans in the long run. If you just refinance your loans to get a better interest rate, that may require actually shortening your repayment term with larger monthly payments, so it won't make a dent in your DTI.

4. See if your state offers a student loan repayment assistance program

A growing number of states offer student loan repayment assistance programs for those willing to relocate or buy a home there. They do this in the form of grants, scholarships, tax waivers or credits. The deals are often limited to those with federal student loans.

For example, Kansas offers to pay up to $15,000 over five years for those willing to relocate and work in one of its 95 “rural opportunity zones.” St. Clair County in Michigan, on the other hand, offers a reverse scholarship of $15,000 toward student debt repayment to former residents who move back home and have a science, technology, engineering, arts or mathematics degree.

You can also check with associations or organizations related to your profession. If you’re a lawyer, for instance, the American Bar Association has a list of states that offer student loan repayment assistance for graduates working in the public sector.

Although applying for one of these programs won't instantly improve your DTI or your chances to get approved for a loan, it could certainly help you get there faster.

5. Know the different types of mortgages

Mortgages are divided into two major categories: conventional and government-backed.

Conventional loans are made by private lenders. To qualify, they typically require a minimum credit score of 620 and a DTI below 45%. It is possible to get a conventional loan with as little as 3% down, but if your down payment is less than 20%, your lender may require you to get private mortgage insurance (PMI), which will make your monthly payments more expensive.

Most conventional loans are also conforming loans, which means they meet the standards to be purchased by Fannie Mae and Freddie Mac. These government-sponsored enterprises buy loans from private lenders, but do not offer the same guarantees to lenders as government-backed loans.

Government-backed loans, which include USDA, VA and FHA loans, have more lenient credit score requirements than conventional loans because the particular government agency that backs them up assumes some of the risks if the borrower defaults. This is why they also tend to have lower interest rates than conventional loans, don’t always require mortgage insurance and, in some cases — such as that of VA loans — you don’t have to put any money down upfront.

Yet if your biggest issue is student debt, Goodman, from the Urban Institute, suggests trying the conventional route first — specifically one that’s backed by Fannie Mae or Freddie Mac.

If you have federal student loans with an income-based repayment plan and apply for a mortgage backed by Freddie Mac or Fannie Mae, the lender will take your adjusted monthly payments into account when calculating your DTI.

“If you have a government-backed mortgage, they tend to ignore the income-driven repayment amount entirely,” Goodman says. She also points out that both Freddie and Fannie mortgages have programs for lower-income individuals that are more flexible, so this is always an option you can explore.

6. Apply for down payment assistance

The larger your down payment, the less you’ll have to borrow and the more likely you will be approved for a mortgage with a favorable interest rate — but building up a considerable nest egg for a down payment is easier said than done when you have student loans.

Luckily, Goodman says that there are currently over 2,500 down payment assistance programs across more than 1,300 agencies in the country at the local, state and national levels.

Down payment assistance programs typically help low-to-moderate income borrowers purchase their first home. Each state’s program is different, but you can get help in the form of grants, deferred payment loans or low-interest loans.

If you’re interested in exploring the options available to you, you can do so by checking out the Federal Housing Finance Agency’s website or by contacting your state’s Housing Finance Agency.

7. Shop for lenders

A house is probably the most expensive purchase you’ll ever make, so to ensure you’re getting the best terms and interest rates possible, it’s important to shop around.

To do this, you can use a rate comparison website like Credible, or talk to a mortgage broker. While mortgage brokers charge fees for their services, they do have access to hundreds of companies, including regional banks and credit unions that may be able to offer you a better deal. Freddie Mac has found that borrowers save an average of $1,500 over the life of a mortgage by getting one additional rate quote. At five quotes, the savings go up to $3,000, so it pays off to compare.

Shopping for rates is also a critical part of the house-hunting process, as it will give you an idea of what you can afford, and if now may be a good time to take the plunge.

In the end, Griffin, from Experian, says that “having student loans should not keep you from qualifying for a mortgage from a credit perspective.” You just need to maintain a positive credit history by paying all your loans on time and weigh your options carefully before you apply.

More from Money:

Black Homeowners Are Being Left out of the Mortgage Refinance Boom

5 Affordable Ways to Boost Your Home's Curb Appeal Before You Sell

Rushing to Buy a Home Can Lead to Serious Regret. Here's How to Not Hate Your House