Tens of millions of Americans own homes and have mortgages, and for many, mortgage loans represent the largest debt they'll ever owe. Yet in order to encourage homeownership, the federal government gives homeowners valuable tax breaks on their mortgages. There are several things about tax benefits on mortgage debt that you need to know in order to take full advantage of them in your own tax planning.

Can I take the mortgage interest deduction?

The biggest tax break for mortgage borrowers is the mortgage interest deduction. This tax break is available to those who itemize deductions on their tax returns, and lets you reduce your taxable income by the amount you pay in mortgage interest.

Mortgage documents with pen and calculator.

Image source: Getty Images.

How many mortgages qualify for the deduction?

The tax laws let you deduct mortgage interest on two separate homes: your primary home and a second home. However, whether you have one qualifying mortgage or two, the same total limits apply to the deduction.

How much mortgage interest can I deduct?

The mortgage interest deduction sets out two different types of mortgage debt. Different borrowing limits apply to each.

The money you borrow to buy, build, or substantially improve your home counts as what's known as home acquisition debt. The limit on borrowing home acquisition debt is $1 million for most taxpayers and $500,000 for those who are married and file separately. So if you have a $500,000 loan on your first home and $400,000 on your second and you used both loans to purchase the home, then all of your interest will be deductible, because the $900,000 total is less than the $1 million limit.

In addition, you can also borrow money for other purposes, which is called home equity debt. The limit on home equity is lower, at just $100,000. All told, therefore, you can borrow up to $1.1 million and have all the interest be deductible. If you borrow more, then only a prorated portion of your interest payments will get the deduction.

How does refinancing affect the mortgage interest deduction?

If you refinance your mortgage, it retains its original nature as either home acquisition debt or home equity debt as long as you don't increase the principal amount. So if you owe $250,000 on the mortgage you originally used to purchase your home and refinance it with another $250,000 mortgage, then the $250,000 will remain home acquisition debt. However, if you get a money-out refinancing and take $300,000, then you'll have to treat the additional $50,000 as home equity debt unless you use it for allowable home acquisition purposes like substantial improvements.

What can I treat as mortgage interest?

In general, mortgage interest is self-explanatory: It's the interest that your lender charges you on the mortgage. However, as is often the case with tax law, certain special provisions can apply.

One case that often comes up involves paying up-front interest on your mortgage, also known as points. Points can be deductible up front in the year you pay them if they are customary and not more than what's typically charged in your area. Most importantly, points have to be on a mortgage on your main home, not a second home, and you must use the loan proceeds to buy or build your main home. This typically prevents refinancing points from being deducted right away, which requires instead that you deduct a portion of the points payments every year while the mortgage is outstanding.

Also, a special rule allowed taxpayers to deduct private mortgage insurance premiums that their lender requires them to pay as if they were actually mortgage interest. That provision expired at the end of 2016, however, so it might not be available in 2017 unless lawmakers extend the provision.

If you own a home or want to in the future, then keeping these mortgage tax benefits in mind is vital. To make your home as affordable as it can be, you'll want to take advantage of whatever tax breaks you can get on your mortgage.