There is no one answer to the question of how much it costs to replace a roof.
When seeking estimates from different roofers, make sure that the costs of materials are detailed.
If you are on a budget, inform the roofer so he can include low cost recommendations in the estimate.
The estimate should be based on roofing materials and square footage. The roofing contractor should measure your roof and base the estimate upon how much material is needed to complete the project.
The roofer may also charge more depending upon the slope or angle of your roof, as this may need additional materials to cover.
All these particulars should be reflected in the estimate.
The roofing contractor may need to remove the prior roof which will add to your total cost of your roof replacement.
Do not attempt to remove the roof yourself in an attempt to save some money. This type of work should only be done by an experienced roofer.
Never make the mistake of assuming that the roofing contractor can simply install the new roof over the existing one. The roofer will make that determination and will know what permits will be needed.