The one-off fees due when a mortgage completes.
Closing costs are the charges that settle at completion: origination and underwriting fees, appraisal, title insurance, recording fees, prepaid interest and the first escrow deposit.
They normally land between 2% and 5% of the loan amount. Some can be rolled into the balance, which spreads them across thirty years of interest rather than removing them.
They are the number that decides whether a refinance is worth doing: the monthly saving has to clear them before the refinance is actually profitable.
On a $400,000 loan at today's 6.76%, expect roughly $12,000 in closing costs. A refinance that saves $180 a month takes about 67 months just to pay those costs back.
See the 30-yr mortgage page