IQ
PayloadIQ
PayloadIQ Utilities

cURL to Code

Paste a cURL command and get equivalent client code — Python requests, JavaScript fetch, Go, PHP, or Ruby. Method, headers, and JSON body are carried over, all in your browser.

Client code appears here.

This only rewrites the command as code — no request is sent and nothing leaves your browser.

Runs in your browser. Your input is not uploaded to PayloadIQ.

cURL to Code turns a cURL command into a ready-to-run HTTP client snippet in Python, JavaScript, Go, PHP, or Ruby — method, headers, and body included. It is a pure text transformation that runs in your browser: no request is sent, and the command (including any tokens) never leaves your device.

One command, five languages

Paste the cURL you already have from an API doc, the browser's “Copy as cURL”, or your terminal history, then switch the Language selector to get idiomatic code — requests for Python, fetch() for JavaScript, net/http for Go, the cURL extension for PHP, and Net::HTTP for Ruby. A JSON body is detected and formatted as the right native type.

Built for copy-paste, not for surprises

The parser respects shell quoting and line continuations, defaults the method sensibly, and adds a JSON Content-Type only when your body is JSON and you didn't set one. Need just a fetch template, or want to turn the response body into types? Try cURL to Fetch or JSON to Python.

FAQ

Does this send the request?
No. The cURL command is only parsed and rewritten as code in your browser — no network request is made and nothing is uploaded. Tokens and URLs in the command stay on your device.
Which languages are supported?
Python (requests), JavaScript (fetch), Go (net/http), PHP (cURL), and Ruby (net/http). Pick one with the Language selector and the output updates instantly.
What does it carry over?
The URL, the HTTP method (-X / --request, defaulting to POST when there's a body, otherwise GET), every header (-H), and the request body (-d / --data / --data-raw). A JSON body is detected and a Content-Type is added if missing; Python emits it as a dict via json=.
Which cURL flags are understood?
Common ones: -X/--request, -H/--header, -d/--data and its variants, --url, and -u/--user. Display-only flags like -s, -L, -k, -i, -v and --compressed are ignored, and unknown flags are skipped so the conversion still works.

Related utilities

cURL to Fetch TemplateJSON to PythonJSON Formatter / ValidatorJWT Decoder
Open PayloadIQ Playground