​Most mortgages have a fee to exit the contract, but calculating it can be confusing and expensive. You have to pay the greater of 3 months interest or the IRD, Interest Rate Differential. The reason for the penalty is to compensate the lender for the loss of expected profit. If a borrower promises to borrow money for five years, the bank counts on five years of interest payments. Reneg on that deal, and the lender needs to recoup some of that loss revenue. The issue is how this penalty is calculated and, for the most part, each lender has a slightly different variation. This is one of the top 3 complaints to the banking Ombudsman. In fact in 2011 there was a class action suit against CIBC in B.C. and Ontario.

If you are in a variable rate mortgage, the penalty is most often 3 months worth of interest, but the IRD is more difficult to calculate. In it's most simplistic form, this is how it looks:

Most big bank websites offer their own online calculator, but for the most accurate answer, consider calling your mortgage adviser and ask for the exact amount as if you were to break your mortgage today.