OTTAWA -- Mortgage rates are near-record lows, but brokers say those shopping around for a loan should look beyond the rates they're being offered and pay close attention to how much it will cost to break their mortgages.

Divorce, a desire for a new and bigger home or an opportunity to move to another city for a new job -- all may prompt people to want out of a five-year mortgage early, and the penalties vary depending on the type of mortgage they have and the lender involved.

Greg Williamson, founder of the Canadian Home Buyers Academy, says nobody signs a fixed rate five-year closed mortgage thinking they're going to have to break it, but a significant number don't make it the full term.

"It doesn't really become a problem until two or three years down the road when I get divorced or whatever happens and I've got to break the mortgage and then I get absolutely whacked," Williamson said.

Whether you're dealing with a mortgage broker or your bank when negotiating a mortgage, he added, you should have them walk you through the penalty calculation so that you fully understand how much it will cost if you need to get out of the loan early.

Focusing on the rate may save you a few bucks on your monthly payment, but if don't pay attention to the penalty fees, it could cost thousands more if you have to get out of the mortgage early, Williamson said.

The penalty for breaking a closed mortgage is generally the greater of three months interest on the remaining balance or the interest for the remainder of the term on the remaining balance -- all calculated using something called the interest-rate differential.

While mortgage rates are at historical lows, the posted rates offered by the big Canadian banks have remained much higher. That means borrowers have received substantial discounts from the posted rates -- but that can work against them when calculating the interest-rate differential when a big bank determines how much they'll have to pay to break their mortgage.

The interest-rate differential is meant to compensate the lender for having the loan paid early, but Frank Napolitano, manager partner at Mortgage Brokers Ottawa, noted the penalties differ depending on the lender -- something to keep in mind when shopping around for a mortgage.

Napolitano says smaller lenders that specialize in mortgages may offer better terms if you need to break your mortgage early, and that could save a homeowner thousands.

"It could mean whether they get any equity out of the home after three years," he said.

Napolitano noted that penalty calculations are different if you hold a variable-rate mortgage. Getting out of such a loan will generally set you back three months' interest, which is for the most part less than the cost to break most fixed-rate mortgages.

But if that makes variable-rate mortgages seem attractive, borrowers need to be comfortable with the other aspects of such a loan, including the possibility that the interest rate you pay could go higher.

"Don't take a variable-rate mortgage just because the penalty is less," Napolitano said. "You want to take a variable-rate mortgage because you think it is the right mortgage to have."