As mortgage rates increase, homebuyers should pay close attention — higher rates mean more cash out of pocket for borrowers.

For those worried that rates will climb even further before closing, a mortgage rate lock could be the solution.

What is a mortgage rate lock?

rate lock freezes an interest rate on a mortgage for a period of time. The lender guarantees (with a few exceptions) that the mortgage rate offered to a borrower will remain available to that borrower for a specific amount of time. The borrower doesn’t have to worry if rates go up between the time they submit an offer and close on the house.

Mortgage rate locks typically last from 30 to 60 days, though they can also last 120 days or more. Some lenders may offer a free rate lock for a specified amount of time. After that, however, the lender may charge fees for extending the lock.

When to lock in a mortgage rate

Borrowers can’t lock in a rate until after the initial loan approval. However, many borrowers wait until they have found a home to purchase.

Borrowers typically wait because they don’t know how many days it will take to find a home and have an offer accepted. They worry that by locking in too early, they may miss the opportunity for a better rate before they complete a purchase or get stuck paying extra to extend the lock once it expires.

A longer rate lock is more expensive. For example, a borrower who chooses a 30-day lock on a loan may pay a 4.875 percent rate and zero points, while a 60-day lock might cost 1 point (equal to 1 percent of the loan) or a slightly higher rate with a half-point.

However, with mortgage rates expected to rise, you might consider jumping on the lower rate as soon as possible. Even a small hike, such as a quarter of a point, can mean a difference of hundreds or thousands of dollars in interest each year.

“In this current environment, it makes the most sense to start the process quickly,” says Randy Hopper, senior vice president of mortgage lending at Navy Federal Credit Union. “The borrower would contact the loan officer and say, “Hey, I’ve got a contract on a place,” and then the loan officer locks in the rate as soon as they review the contract.”

What to ask your lender before you lock

Be sure to get a clear explanation of your lender’s rate lock rules. Find out if your locked rate can change in certain circumstances — for example, if mortgage rates drop, or if you change from a 30-year fixed-rate mortgage to an FHA loan.

Finally, be sure that your rate lock is long enough to cover the entire homebuying process. For example, if you anticipate that your closing will take longer than a month, talk to your lender about locking in a rate for that period without paying fees.

Make sure you’re financially prepared

Before you lock in a rate, make sure your budget is in order and you are financially prepared to apply for a mortgage.

Hopper says to ask yourself these questions:

If you lock in a rate too soon and end up going with a different type of loan, your rate lock might be void. Borrowers also can lose a rate lock if their circumstances change — such as a shift in their credit score or in their debt-to-income ratio — before settlement.