If you plan to buy a home and obtain a mortgage, either now or in the future, there are certain things you should know about how mortgage loans work. Specifically, here are 10 principles you should be aware of that can help you get the best deal on a mortgage, choose the best loan for you, and stay within a realistic budget.

1. Know how much you can borrow -- and what you can really afford to spend

When you apply for a mortgage, your lender will consider two different debt metrics and use the one that produces the lower monthly mortgage payment.

The front-end ratio just considers your new mortgage payment as a percentage of your pre-tax income. For example, if you earn $5,000 per month and your new mortgage payment will be $1,000, your front-end ratio is 20%. On the other hand, the back-end ratio considers your new mortgage and all of your other monthly debt obligations, such as auto loans, student loans, and credit cards.

Young couple in front of home they just bought.

Image source: Getty Images.

The industry standards are a maximum of 28% for the front-end ratio and 36% for the back-end ratio, but it's possible to qualify for a loan that produces a back-end ratio of up to 45% in many cases. More importantly, just because you can get a loan for a certain amount doesn't make it a good idea. It's important to consider how much you can actually afford to pay per month on an ongoing basis, not just what a bank's computer says.

2. Don't forget that the 30-year mortgage isn't the only option

The 30-year mortgage has been the standard of the U.S. mortgage industry for years, but it's not the only option out there. Ask your lender to run your numbers for a 15-year mortgage as well -- you may be surprised that it's far less than double the payment of a 30-year. Not only will you pay off your home in half the time, but 15-year mortgages typically have lower interest rates, which can save you lots of money.

3. If you put less than 20% down, you'll have an extra expense

The "standard" down payment when buying a home is 20% of the purchase price. It's possible to buy a home with much less down than 20%, but with a few notable exceptions (such as VA loans), doing so will require you to pay private mortgage insurance, or PMI. So, with a lower down payment, not only will you have a higher monthly payment due to a higher principal balance, but you'll have the additional expense of PMI added to your payment each month.

4. A great credit score can save you tens of thousands of dollars

It's common knowledge that better credit makes it easier to get approved for loans and can get you more favorable terms. However, many people don't fully understand how much of a difference this can make, especially when it comes to mortgages. Based on the current averages, a borrower with a 690 FICO score, which is generally considered to be a good score, can expect to pay $182,428 in interest over the term of a 30-year, $250,000 mortgage. However, a borrower with an "excellent" score of 760 can expect to pay $161,917, a savings of $20,511.

Because of this, if your credit isn't quite as great as it could be, it can be a smart idea to put your homebuying ambitions on hold for a little while and work on boosting your score. You might be surprised at the impact you can make in a relatively short period of time.

5. Your mortgage approval is based on four main factors

There are four main categories of information your lender will consider. Credit is an obvious one, which your lender will verify by ordering your credit report. In addition, your employment, income, and assets will also be considered, and you'll need to thoroughly document each one.There may be additional factors, depending on your situation, but these are the big ones.

Before applying for a mortgage, start gathering documents such as W-2s, tax returns, a good contact number for your employer, bank and brokerage statements, and anything else that helps prove where you work, how much you make, and how much money and other assets you have.

6. Don't apply with just one mortgage lender

Different lenders can offer slightly different mortgage rates, and a seemingly small difference can translate into thousands of dollars in savings over the long run.

Fortunately, there is a "rate-shopping" provision in the FICO scoring formula that says that no matter how many mortgage lenders you apply with, as long as they all occur within a two-week window, it won't affect your credit any more than a single application would.

7. After you're approved, don't apply for anything else before closing

Your lender approves your mortgage application based on the information available at the time you apply. They'll also pull your credit again shortly before you close. If your information changes before you close, your lender may have to requalify you, or even worse, cancel your approval altogether. To be safe, don't apply for any new credit, make any late payments, or run up your credit cards before your mortgage closes.

8. You can use your IRA to help fund the purchase

If you're having trouble coming up with a down payment, there's a special provision in the IRA rules that could help you. Specifically, you're allowed to withdraw up to $10,000 from your IRA penalty-free (although you may have to pay taxes on the money) for the purpose of a first-time home purchase. Whether or not this is the best use of your IRA funds is another matter, and depends on your situation, but the option is available.

9. Fixed vs. adjustable rate: Know the difference

A fixed-rate mortgage has one set interest rate that doesn't change throughout your loan, and therefore your monthly principal and interest payments won't change over time. On the other hand, an adjustable-rate mortgage, or ARM, has an interest rate that can increase or decrease over time in tandem with the prevailing market interest rates. ARMs are generally better ideas in high-rate environments, or if you don't plan on owning your house for longer than the ARM's introductory, or "teaser," period. In low-interest environments, like we're in now, fixed-rate mortgages are usually the better choice.

10. The tax benefits of a mortgage can be fantastic

Finally, it's important to know the tax benefits of a mortgage. Specifically, the interest that you pay on your mortgage is tax-deductible as an itemized deduction. Any discount points you pay to get the loan are also deductible, as are the property taxes you pay on the home each year. In addition, PMI has been deductible in previous years, although it's unclear at this point if it will continue to be.