Whether it's your first home loan or you're refinancing an existing one, new mortgage are costly. The average homeowner pays 3% to 6% of his outstanding principal for a new loan. But you do have options when you're shopping for a mortgage. Here's how to get some leverage and use it.

Start mortgage shopping

A mortgage broker can be a valuable asset, especially for anyone who has credit problems. And even if your credit is good, using a broker can simplify cost comparisons since you're shopping the brokers' fee, not lenders' settlement costs. If you go this route, hire an up-front mortgage broker who discloses fees in writing at the outset.

For non-brokered deals, use competing bids to negotiate. And if you're refinancing, don't automatically dismiss your current lender: It's more efficient (and cheaper) for it to hang onto your business. If the bank servicing your loan isn't your original lender, even better. It paid to acquire your mortgage; it has more incentive to keep it.

A detailed cost-benefit analysis is critical. There are a number of factors you'll have to consider, but don't be daunted -- given the size and importance of this transaction, your homework will pay off.

No-cost loans? Not so fast

You'll likely run across lenders offering "no-cost" mortgages. That's not the same as "free." It just means expenses are baked into the transaction -- either via a higher interest rate or rolled into the amount of the loan. If it's the latter, it could affect your ability to deduct the costs from your taxes, plus you'll pay interest on the added amount for the life of the loan.

A no-cost mortgage or refinance is best for borrowers who will hold the mortgage for no more than three or four years, says Jack Guttentag of mtgprofessor.com. If you plan to sell or refinance in that time, be sure to include the costs in your calculations.

How to cut mortgage costs

According to a 2007 Bankrate.com survey, the average homeowner pays $2,736 in closing costs (not including taxes, escrow, or other governmental fees) on a $200,000 loan.

The real negotiations begin once you get a good-faith estimate (GFE) from the lender. The key word is "estimate": You won't see the actual costs until you get the HUD-1 three to five days before closing.

Even though they're boring, make sure you familiarize yourself with these documents well before you see the final drafts. The earlier you identify any fee-padding or bait-and-switch techniques, the more leverage you'll have to negotiate or walk away from the deal.

Your best shot at cutting costs is not with the third-party fees (those paid to title companies, lawyers, and county tax offices), but with the lender's line items (points and application, administration, and processing fees). And unless you see something really egregious (like a $200 credit check fee), concentrate on the big-ticket items.

Start with the yield spread premium (YSP) -- the rebate paid to the lender or broker -- which is typically 1% to 3% of the loan value. It can be called a number of things on the GFE, such as "loan origination," or "lender" or "broker" fee. (The average outlay for "lender fees" is $1,114.) Shoot for 0.5% to 1% if you're a good credit risk. Negotiating from 3% to 1% on a $200,000 loan puts $400 in your pocket.

The next biggest line item is title search and insurance (average $707). If your original loan is less than two years old, ask for the "reissue rate" -- which should be 50% to 70% less than the original policy (at least $353 in savings). Even if you bought five years ago, ask for a discount.

Other items like the application fee (average $425) are also negotiable because they are usually there to cover the lender's costs if you back out. And if you really want to get into the weeds, look into "document prep" ($187), "underwriting" ($247), and "processing" ($371) fees.