cURL to Python, JavaScript, Go, PHP, Java, Node.js Converter
Convert cURL commands to Python (requests), JavaScript (fetch), Node.js, Go (net/http), PHP, or Java (HttpClient). Parses -H, -d, --data-urlencode, -F, -u, --json and more. 100% local.
Last updated:
Parsed request
- Method
- POST
- URL
- https://api.example.com/v1/users
- Headers
- Content-Type: application/json
- Authorization: Bearer YOUR_TOKEN
- Body
- json
Paste a cURL command to generate equivalent code in Python (requests), JavaScript (fetch), Node.js, Go (net/http), PHP, or Java (HttpClient). Parses -H, -d, --data-urlencode, -F, -u, --json and more.
Tips & Best Practices
- ▸Copy cURL commands directly from Chrome DevTools → Network → right-click → 'Copy as cURL' to get exactly the request the browser sends.
- ▸The converter preserves headers, body, method, and auth. It does not translate cookies-from-file (--cookie file) — inline cookies work.
- ▸For gRPC, GraphQL, or streaming responses, the generated request code is a starting point; you may need to add specific client libraries.
Frequently Asked Questions
Which cURL flags are supported?
Method (-X / --request), headers (-H / --header), all body variants (-d, --data, --data-raw, --data-binary, --data-urlencode, --json), multipart form (-F / --form), basic auth (-u / --user), cookies (-b / --cookie), user agent (-A) and referer (-e). Flags that do not affect the request itself (--compressed, --insecure, --location, --silent, etc.) are recognized and ignored, and are listed under 'Ignored flags' so you know what was skipped.
How does it detect whether the body is JSON or form-encoded?
If the request uses --json, or if a Content-Type header contains 'json', the tool treats the body as JSON. If the Content-Type is 'application/x-www-form-urlencoded' or the body looks like key=value pairs joined by '&', it is parsed as form-urlencoded. Everything else is emitted as a raw string body.
Is my curl command sent to any server?
No. Parsing and code generation happen entirely in your browser using JavaScript. Even if your command contains real Authorization headers or API keys, nothing is transmitted.
The generated code doesn't handle files — why?
When curl uses -d @body.json or -F 'file=@upload.png' it reads local files that the browser cannot access. The generator emits a TODO comment where the file should be attached so you can fill it in with your own file object.
Related Tools
URL Parser
Parse any URL into scheme, host, port, path, and query parameters — or build a URL from scratch with a form. Great for debugging redirect chains, tracking pixels, and OAuth flows. 100% local.
CIDR Calculator
Calculate IPv4 subnets from CIDR notation online. Get network address, broadcast, netmask, wildcard, usable host range, IP class, and binary representation. 100% local — nothing leaves your browser.
URL Encode/Decode
Percent-encode and decode URLs online. Handles query strings, path segments, and special characters correctly.
Color Converter
Convert colors between HEX, RGB, HSL, and HSV instantly. Includes a live color preview and copy-ready CSS strings.
HTML Minifier
Minify HTML by removing comments, collapsing whitespace, and stripping optional attribute quotes and void-element slashes. Reports byte savings. Preserves IE conditional comments and preformatted <pre> / <textarea> / <script> / <style> content. 100% local.
HTML Beautify
Format messy or minified HTML with clean indentation and line breaks. Handles void elements (<br />), preserves preformatted <pre> / <textarea> / <script> / <style>, and normalizes self-closing tags. 100% local.