The Good Faith Estimate Could Be Your Best Friend
Mortgage lenders are required by law to provide borrowers with a document called the Good Faith Estimate (GFE). The GFE details the terms, costs, and fees associated with the loan: Interest rate and points, lenders fees, title and transfer charges, inspections, prepaid interest, and other costs. Although the GFE is designed to be an estimate rather than an official breakdown of all charges, the figures quoted on the GFE should be very close to those you see at the actual closing. (In general, the overall costs should not vary by more than 10% from the original Good Faith Estimate.)
If you are comparing different loans from different lenders, the GFE is a great way to make apples to apples comparisons of all the costs of each loan. Different lenders charge different origination fees, service fees, etc. The GFE should give you an opportunity to see exactly how the costs of your loan are calculated.
Never commit to a loan before reviewing the GFE; ask questions, feel free to negotiate, and make sure you know exactly what you're getting into. And also keep in mind you can still void the deal within three days of committing, and if you do all fees paid to that point must be refunded.