I just finished a small freelance gig.
If I'm looking purely at how much time I worked, I got about +5 times my hourly rate at my full time job.
But thanks to my code the client saved at least 4 times what I charged him.
I can't help but feel a bit dumb for not having charged him more.(guess I was afraid he'd refuse, or that he wouldn't come back)
If you think a task seems very valuable to the client,
what do you do to make it fair?
Do you inflate the time you spent on the task to charge them more?
Or do you manage to flat out ask them for crazy rates like a few hundred of dollars per hour?
You should focus on adding business value and how to attach fair prices for delivering that value, in concrete terms. Hours spent at a keyboard, or lines of code, do not describe anything of value to a business.
You can ask the customer to attach a value to deliverables and then decide if you can profitably deliver. Structuring projects to support that means you and the customer have to break the tasks down into well-defined steps with clear deliverables, something freelancers should do in any case. It also means getting the customer to think about business value. You should also consider cost over time (i.e. is the customer losing money because of a bug or missing requirement), and risk to the business.
Freelancers too often either accept a price the customer attaches to a project (based on what?), or guess at the time required and multiply by the desired rate. No one specifies the project in detailed steps with clear deliverables and a definition of "done" for each stage. As a result the freelancer and the customer will conflict over schedule and budget, usually well into the project.
For skilled freelancers with a solid reputations "a few hundred of dollars per hour" doesn't describe a "crazy rate."