Every borrower wants to get the lowest mortgage rate. But mortgage rates don't stand still. They fluctuate, moving up and down over a period of days, weeks, even hours. Given that it can take a month or two to close on a home or a mortgage refinance, how can you pin down a low rate and be sure it will still be available to you when it's time to sign the papers?

You can do it by locking your mortgage rate. Most lenders will allow you to do this. Locking in a rate means that a lender promises to let you take out a mortgage at the rate it's offering today, provided that you close the loan within a certain time, usually 30-60 days.

To lock a mortgage rate, you need to submit a loan application, because the lender will require all the pertinent information about your credit score, debt-to-income ratio and other factors needed to determine the rate you qualify for. If you're buying a home, you'll need to have a purchase offer that's been accepted by a seller as well, since your mortgage application will be for that specific property.

When to lock a mortgage rate?

If you're buying a home, you'll need to chose a lender and lock your rate with a few days of your offer being accepted. But if you're refinancing, you've got a bit more leeway in when you choose to submit an application and lock your rate. You may choose to do it when rates seem to have taken a favorable turn.

This is a difficult decision to make, because you don't know what direction rates will go. If rates rise, you could miss your chance at the low mortgage rates that were offered a few weeks ago. But if rates go down, you could save money by holding off a few weeks.

The truth is, timing the market is almost impossible to do. Not even mortgage professionals can do it reliably. So your best bet is to find the lender that will give you the best mortgage rate and lock it in.

What if rates fall after I lock?

Locking a mortgage rate primarily protects you against an increase in rates should they go up in the 30-60 days between when you lock and when you close the loan. But what if rates go down during that time? Are you simply out of luck?

Many lenders will offer you a chance to re-lock your rate if overall mortgage rates take a tumble after you lock. Generally, the rule is that market rates need to fall by at least a quarter of a percent (0.25 percentage points) and that you can only re-lock your rate once. But that does offer you some protection against missing out on a drop in rates.

What does it cost to lock a mortgage rate?

Some lenders may charge you a fee for locking a mortgage rate but more commonly will charge a slightly higher rate in return for locking. So the lowest rate they'll quote you may be for an unlocked, or floating rate, you'll pay a slightly higher rate for a 30-day lock and small additional boosts for a 45- or 60-day lock. You can sometimes lock a rate for longer than 60 days, but the higher rate you pay will jump significantly at that point.

Ask your lender and real estate agent for advice on how long it typically takes loans or sales like yours to close and use that as a guide for how long to lock your rate.

You want to be sure you lock your rate long enough to be able to close the loan within that period. If your mortgage application is straightforward and there are no problems with the property, 30 days may be enough. But if there are any complications - such as documenting your income, problems with the title, an iffy appraisal – it could take longer.

What if my rate lock expires?

If your mortgage rate lock expires before you are able to close, some lenders will grant you a short extension. Others will charge for extending the lock. If the delay is due to the seller's fault, you should ask them to pay for it as an amendment to the sales agreement.

If rates have fallen, don't assume you can just let your lock expire and then lock in a new one at the lower rate. Few lenders will allow you to do that. If you're going to take that route, you'll need to apply with a different lender, for whom the fact that you recently applied for but did not follow through on a loan with another lender will be a red flag – it'll be on your credit report.

On the other hand, if rates rise and your lock expires without an extension, you'll just have to pay the higher rate.

Get it in writing

You want to be sure to get your rate lock in writing. Most lenders have forms that will describe the exact terms of the lock. Don’t allow the agreement to be made orally – when the time comes to close, you don’t want to be dependent on somebody’s memory as to what you agreed upon.

A mortgage rate lock can take some of the uncertainty out of borrowing and help you ensure you can get the best mortgage rate you can find. Just be sure you know what your option are and how much time you'll need, and you'll be fine.