cURL to code — convert a cURL command to code
Paste a cURL command and get equivalent code in JavaScript (fetch or axios), Python, Go or PHP. It converts entirely in your browser (0 uploads, works offline), so commands that contain tokens never leave your device.
How to use it
- Paste your cURL command.
- Pick the target language.
- Copy or Download the generated code.
FAQ
How do I convert a cURL command to fetch or Python for free?
Paste the command and choose a target. This page parses the method, URL, headers and body and emits idiomatic code — fetch, axios, Python requests, Go net/http or PHP cURL — on your device with no upload.
Is it safe to paste a cURL command that includes an auth token?
Yes. The conversion runs entirely in your browser and nothing is transmitted or stored, which you can verify by turning off your Wi-Fi. That is important because cURL commands copied from dev tools often carry bearer tokens and cookies.
Which parts of the command does it understand?
It reads -X/--request for the method, -H/--header for headers, -d/--data for the body and -u for basic auth, and it infers POST when a body is present without an explicit method.
Does it handle multi-line commands?
Yes — backslash line continuations are supported, so you can paste a wrapped command straight from your terminal.
Limits
Handles the common cURL flags; exotic options (cookies files, form uploads, client certificates) are not translated.
Related
The HAR analyzer inspects network exports; the API spec generator scaffolds OpenAPI.
Bookmark this page (Ctrl+D, or ⌘D on Mac) or install the app — it works offline the next time you need it.