Back to All Tools

cURL Converter

Paste a cURL command and convert it to fetch, axios, Python requests, Go, Rust, PHP, and more — all client-side.

Runs entirely in your browser — nothing is uploaded

About the cURL Converter

The cURL Converter turns a copied curl command into working request code for another language. You find a curl example in an API's docs or grab one from your browser's network tab, but your project runs on Python or Go. Instead of hand-translating the method, headers, auth, and body, you paste the command here and read back equivalent code. It parses the flags so you do not misplace a header.

Paste a command into the cURL command box and the tool tokenizes it, respecting quotes and backslash line continuations. It reads flags like -X, -H, -d, -u, -A, -e, and --cookie, then rebuilds the request as a method, URL, header map, and body. If the body starts with a brace or bracket it is treated as JSON, and a Content-Type header is added when you did not set one.

It parses the curl command and rewrites it in the browser, so it is free and needs no signup. Parsing and code generation happen in JavaScript on the page, so your curl command, including any tokens, cookies, or Basic auth credentials, never leaves your machine or hits a server. That matters because commands copied from docs or DevTools often carry real Authorization headers and session cookies you would not want to send to a remote box.

How to use the cURL Converter

  1. 1Paste your curl command into the cURL command textarea, or press Sample to load a POST login example.
  2. 2Select a target with the buttons: JS fetch, Node fetch, axios, Python requests, Go net/http, Rust reqwest, or PHP cURL.
  3. 3Read the generated code in the Output panel, which refreshes as you change the input or target.
  4. 4Press Copy to put the output on your clipboard; the button shows a checkmark briefly.
  5. 5Press Clear to empty the box and start over.

What you can use it for

Port API docs to Python

An API's reference gives you a curl POST with a JSON body and a bearer token, but your backend is Python. Paste it, choose Python requests, and get a call with a headers dict and json_body to drop into your client.

Reproduce a DevTools request

You copy a request from the Network tab as cURL to debug a 401. Convert it to JS fetch to see exactly which headers and cookies the browser sent, then trim them one at a time to find the culprit.

Share a call with a Go team

You tested an endpoint with curl and need a teammate on a Go service to hit the same URL. Convert to Go net/http so they get a http.NewRequest with every header set, instead of describing the call in chat.

How Basic auth becomes a header

When your command includes -u user:pass, curl would normally build the Authorization header at request time. This tool does it up front: it runs user:pass through btoa, the browser's base64 encoder, then writes Authorization: Basic followed by the encoded value into the header map.

Base64 here is encoding, not encryption. It only rewrites the credentials into an ASCII-safe form; anyone who reads the header can decode it back to the original user and password. That is why Basic auth is only safe over HTTPS, and why you should treat the generated value as a plain secret.

Frequently asked questions

Does my curl command get sent anywhere?

No. The tokenizer, parser, and code generators all run in your browser as plain JavaScript, with no upload and no server request. You can paste a command with a live Authorization header or session cookie and it stays on your machine, which is the safe way to handle credentials from docs.

Which curl flags does it understand?

It reads -X/--request, -H/--header, the -d family including --data-raw, --data-binary, --data-ascii and --data-urlencode, -u/--user for Basic auth, -A/--user-agent, -e/--referer, --cookie/-b, and --compressed. It also handles -G and -I for HEAD, and ignores -L, -k, and -s since they do not change the output.

Why do I get 'No URL detected'?

The parser takes the first bare token that is not a flag as the URL. If your command has no unquoted URL, or every argument reads as a flag or an option value, it cannot find one and shows that error. Make sure the URL is present and not quoted like a flag's value.

Does it handle file uploads or form fields?

No. There is no support for -F/--form multipart uploads or file references like @data.json. Only inline data flags are read, and multiple -d values are joined with an ampersand into a query-style body. For file uploads, add the multipart handling in the generated code yourself.

How does it decide to send JSON?

After parsing, if the body starts with { or [ it marks the body as JSON, then adds Content-Type: application/json unless you already set a content-type header. In the Python and axios output the body is emitted as a real object rather than a quoted string.