cURL Converter: cURL to Fetch, Python, Axios & More
Paste a curl command, for example one copied from your browser DevTools, and get ready-to-run code in 8 languages. Headers, JSON bodies, forms, file uploads, auth and cookies are all converted.
Runs in your browserNo sign-upNothing uploaded
How to use the cURL Converter
- Copy a request as cURL: in Chrome or Firefox DevTools, right-click a request in the Network tab → Copy → Copy as cURL.
- Paste it into the input box. Multi-line commands with
\, Windows^continuations and$'…'strings are supported. - Pick the target: JavaScript fetch, Axios, Node.js, Python requests, Python httpx, Go, PHP or HTTPie.
- Read any warnings below the output. They list options that have no equivalent in the target language.
- Copy the code or download it as a file.
Why convert curl commands to code?
curl is the common language of HTTP. API docs show examples as curl, browser DevTools export requests as curl, and support teams send reproductions as curl. When you want that request inside an application you have to rewrite it by hand: move every -H into a headers object, turn -d into a body, convert -u into basic auth and remember that -G moves data into the query string. This converter does that translation for you and produces code you can paste straight into a project.
Supported curl options
| Option | Converted to |
|---|---|
-X, -I, -G | HTTP method (POST is inferred when a body is present) |
-H, -A, -e, -b | Headers, User-Agent, Referer and cookies |
-d, --data-raw, --data-binary, --data-urlencode, --json | Request body: JSON objects, form fields or raw text |
-F | Multipart form data, including @file uploads |
-u, --oauth2-bearer | Basic auth or a Bearer token |
-k, -L, -m, -x, --compressed | TLS verification, redirects, timeout, proxy and compression |
JSON bodies become real objects
When the request sends JSON (a Content-Type: application/json header, --json, or a body that parses as JSON), the converter emits native data structures instead of an escaped string: JSON.stringify({...}) for fetch, a plain object for Axios and json= with a Python dict (True, False, None) for requests and httpx. That makes the payload easy to edit and fill with variables.
Differences to keep in mind
Browsers cannot disable certificate checks or route a single request through a proxy, so -k and -x only appear as comments in browser fetch code. curl does not follow redirects unless you pass -L, while fetch, requests and Go follow them by default. A body sent with -d but no Content-Type is form-encoded by curl; if it looks like JSON, the converter sends it as JSON and tells you so in a warning.
Frequently asked questions
Is my curl command sent to a server?
How do I copy a request as cURL from Chrome?
Does it handle file uploads?
-F name=@file becomes FormData in JavaScript, a files= dict in Python, mime/multipart in Go and CURLFile in PHP. -d @file and -T file read the request body from a file.What happens to options the converter does not know?
-s, -v or -o are ignored because they do not change the request.