A rule of thumb I have heard is to start with your target salary/year (say $150k), and divide it by 1000 to get your hourly rate ($150). This advice is usually targeted at those who are just starting out and have "no idea what to charge."
The worst thing you could do is say "I made $100k at my last job therefore I am going to charge $50/hour." Because the economics of freelancing are not the same as the economics of having a full time salary. You will need to, at minimum, DOUBLE your equivalent-hourly rate from your last job.
After you get some successes and understand your core value proposition, you can charge more, especially if you find a solid niche.