What is the cURL to Code Converter?
API documentation, browser developer tools and Postman all speak curl. When you need the same request inside your app, rewriting every header and option by hand is slow and easy to get wrong.
Paste the command here and pick a language. The tool reads the method, the address, every -H header, JSON and form bodies, file uploads with -F, user and password with -u, cookies, the user agent and options such as -L, -k and -G, and writes clean, ready-to-run code. A JSON body is turned into a real object, not a long string.
The command never leaves your browser, so tokens and passwords copied from your browser stay private.
Features
5 languages
JavaScript fetch, Node.js, Python requests, PHP cURL and Go.
All the headers
Every -H header, cookies, user agent and referer.
JSON as objects
JSON bodies become real objects in the code.
Forms and files
-F fields and @file uploads become multipart code.
Login kept
-u user:password becomes the right auth option.
Stays private
Your tokens are never sent anywhere.
How to use the cURL to Code Converter
- 1
Paste a curl command.
- 2
Pick the language.
- 3
Copy the code.
Who it is for
From docs to code
Turn the curl examples of an API into your own code.
From the browser
Use "Copy as cURL" in developer tools and rebuild the request in Python or PHP.
Bug reports
Share a request as code your colleague can run.
Tips for better results
- In Chrome or Firefox, open developer tools, right-click a request in Network and choose "Copy as cURL (bash)".
- Remove cookies and tokens before you share the generated code with anyone.
- Commands copied from Windows that use ^ at the line ends work too.
Your privacy: it stays on your device
- This tool runs entirely in your browser. What you type and the files you choose are processed on your own device and are never sent to our server.
- Nothing is uploaded, stored or kept in a history, so it is safe for private text, documents, photos and keys.
- It keeps working on a slow connection, because no answer has to come back from a server.
Questions people ask
Which curl options are supported?
The method (-X), headers (-H), data (-d, --data, --data-raw, --data-binary, --data-urlencode, --json), forms (-F), login (-u), cookies (-b), user agent (-A), referer (-e), -G, -L, -k, -I and --compressed. Options that only change how curl prints its output are skipped.
Is my command sent to your server?
No. It is converted inside your browser, so keys and passwords in the command stay on your device.
Why does the Python code use json= instead of data=?
When the body is JSON and the Content-Type says so, requests can send the object for you, which keeps the code short and the JSON valid.