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:
CommentsPaste 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.
Parsed request
- Method
- POST
- URL
- https://api.example.com/v1/users
- Headers
- Content-Type: application/json
- Authorization: Bearer YOUR_TOKEN
- Body
- json
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.
Try Next
Meta Tag Preview
Preview how your page will appear in Google search results and social share cards on Facebook, Twitter/X, and LinkedIn. Parses <title>, meta description, canonical, and full Open Graph / Twitter Card tags with diagnostics. 100% local.
Related Tools
HTTP Status Codes
Complete reference of HTTP status codes with meanings, use cases, and RFC citations. Search 60+ codes from 100 Continue to 511 Network Authentication Required.
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.
Color Converter
Convert colors between HEX, RGB, HSL, and HSV instantly with a live color preview and copy-ready CSS strings. Free, no signup, runs entirely in your browser.
User Agent Parser
Parse User-Agent strings to identify browser, engine, operating system, and device. Instantly see what your own browser sends.
Cookie Parser
Parse cookie strings from HTTP headers or document.cookie into readable key-value pairs. Handles URI-encoded values. 100% local.