From my perspective, figure out what you are worth. If you believe that your time is worth $20 an hour before all expenses then that's where you can start. Next determine what it cost you to be able to perform your job such as home office space, computers, software, etc. You would then need to figure out the average of that cost. For instant, a computer might cost you $2000 and is in service for 3 years. Based on 2000 work hours per year, that would be roughly about 33 cents per hour over the course of 3 years. Same thing for home office, software and anything else you use such as printer, supplies, phone/cell, etc. Also, keep in mind administrative time. Although you don't bill them directly for such service you need to factor that into your cost.
You can do the same thing with domain and hosting but I usually keep those separate since most client wants to know the cost of hosting and such.
Hypothetically, you may need to charge $30 per hour in order to satisfy the fact that you are making $20 per hour after all expenses.
Finally, if you charge a fixed rate job then you need factor in approximately how many hours it would normally takes you to build a site and then times that by your rate. If it takes you 10 hours to build a site then it would be 10 hours X $30 = $300.
This is not something written in stone but it will give you a general idea how to determine your cost.