Curl Converter
Paste a curl command and get working code for fetch, Python requests or Node axios - headers, body, method and auth all carried across. Everything runs in your browser.
From curl to real code
curl is the lingua franca for sharing an HTTP request - API docs, bug reports and Stack Overflow answers are full of curl one-liners. But when you actually need that request inside a JavaScript app, a Python script or a Node service, translating it by hand is fiddly and easy to get wrong. This converter parses the command properly, the way a shell does, and rebuilds it in the language you pick.
What gets carried over
The method comes from -X, or is inferred as POST when a body is present. Every
-H header is preserved, and repeated -d flags are joined with an
ampersand just like curl does. Basic auth from -u user:pass turns into an
Authorization: Basic header, cookies become a Cookie header, and
-A and -e map to User-Agent and Referer.
When the body is JSON, the output uses a native object and the idiomatic serialiser for each
language rather than an ugly escaped string.
Flags with no equivalent
Some curl flags describe transport behaviour that fetch, requests and axios handle
automatically or differently. --compressed is a no-op because all three decode
gzip for you, and -L is noted because each library follows redirects by its own
default. Anything the converter cannot map is listed in a note under the code so you are never
left wondering what was dropped.
Working with API payloads? The JSON formatter tidies a response body, the Base64 encoder handles token and credential encoding, the JWT decoder inspects bearer tokens, and the URL encoder escapes query strings.