cURL to Code Converter
Paste a curl command — like the one you get from a browser's "Copy as cURL" DevTools option, or from API documentation — and instantly get equivalent, ready-to-paste code in JavaScript (fetch), Python (requests), Node.js (axios), PHP (cURL), or Go (net/http), with support for the method, headers, request body, and basic auth. Runs entirely in your browser — the command you paste, including any API keys or credentials in it, is never sent to a server.
Everything happens in your browser — your curl command and any credentials in it are never sent anywhere.
Covers the common case: method, headers, a request body, and basic auth. Multipart/form-data uploads (-F) and file uploads (-T) aren't supported yet.
Paste a curl command above to generate equivalent code.
What this tool does
Converts a curl command — the kind you copy from a browser's developer tools or from API documentation — into equivalent code in a programming language.
When to use it
- You copied a request from developer tools and want to reproduce it in your code.
- API documentation gives its examples in curl and you work in another language.
- Turning a request you tried in the terminal into permanent code.
How to use it
- Paste the curl command into the field.
- Choose the target language.
- Copy the code snippet.
A practical example
Input
A curl command with a POST method, a content-type header and a JSON body.
Output
A snippet sending the same request with the same method, header and body in the language you chose.
Limitations
- The command is never executed; the processing is pure string handling.
- What is covered is the common real-world subset: method, headers, a single data body, basic auth, and the cookie, user-agent and referer shorthands — not curl's entire flag surface.
- Unrecognised flags are skipped safely rather than failing the parse, because a genuinely pasted command often carries flags that make no difference to what equivalent code would do.
- Read the generated code before using it; it is an accurate starting point, not a substitute for reviewing it.
Privacy and processing
The command is parsed on your device and is never sent to any server — which matters, because copied curl commands routinely carry real auth tokens and session cookies.
Technical notes
- Parsing is kept separate from code generation, so adding a language does not touch the logic that reads the command.
Frequently Asked Questions
You can copy any curl command — for example using a browser's DevTools "Copy as cURL" option on a network request, or from any API's documentation — and paste it directly into this tool.