Refinancing a mortgage may involve costs such as appraisal fees, legal fees, and possible prepayment penalties if you break your current mortgage before the end of its term.