Convert curl commands to fetch, axios, Python requests and Go code.
The curl to Code converter reads a curl command and writes equivalent code for fetch, axios, Python requests or Go net/http. It understands headers, request bodies, basic auth, form fields and common flags. Use it to turn an example from API docs or browser DevTools into code you can start from.
curl describes an HTTP request in a compact command: a URL, a method with -X, headers with -H, a body with -d, and options such as -u for basic authentication or -F for multipart form fields. To convert it, the command text is first split into arguments the way a shell does, honouring single quotes, double quotes and line continuations. Then each flag is mapped to a request property: method, URL, headers, body, credentials and form fields. If a body is present and no method is given, curl uses POST, and a body without a Content-Type is sent as application/x-www-form-urlencoded. The converter follows these rules and prints code for the chosen target. Flags that only affect curl's own behaviour, such as -s or -k, have no code equivalent and are ignored.
Method (-X), headers (-H), data options (-d, --data-raw, --data-binary, --data-urlencode), --json, -u, -F, --url, -A, -b, -e, -I, -G and the long forms of these. Others such as -s, -k or -L are ignored.
No. It only converts text to code, and nothing is sent anywhere.
curl uses POST by default when a body or form is present, and the converter follows that. With -I or --head the method is HEAD.
No. The data is used as typed and the code does not apply curl's encoding step, so encode the value yourself if needed.
Yes, with & between them, which matches how curl combines them.
The text is processed in the page and not sent anywhere. Even so, replace real secrets with placeholders before sharing the generated code.