This question is asked so often and by so many, there should be a Wikipedia entry for it. And it should be tagged as an "Existential Question," along with other questions of similar ilk: How long is a piece of string? How much does a car cost? How much does it cost to build a house?
You get the drift, I hope.
The fact is, the only way to truly capture and contain your web development cost is to quantify your project accurately by determining its business requirements. This is the most important phase of your project – a fact that most people fail to realize.
The implication of an incomplete scope definition goes right to the bottom line: project costs that spiral out of control, paying too much for features and functionalities that serve no business purpose, allocating inadequate funds to properly build a functional site, etc.
Caveat emptor: if a web firm blazes in with a cost estimate that doesn't include a scoping phase, RUN. How could they possibly provide realistic pricing for a project about which they know next to nothing?