The math is straightforward: your sale price minus the mortgage payout, legal fees of $800 to $1,500, and total closing costs of 4 to 6 percent leaves your net proceeds. If your mortgage has a fixed term, ask your lender about a prepayment penalty for paying it out before renewal, since that reduces what you walk away with.
Your lawyer handles the mortgage discharge and registers it against the title through Information Services Corporation as part of closing, so you are not personally responsible for coordinating the payoff timing with your lender beyond providing the required documents.
Knowing your payout figure early lets you plan your next move with real numbers instead of a guess. Get your hand-reviewed valuation from Joel Dyck.