Skip to main content
Screendesk
Free tool

curl Converter

Paste a curl command and get the same request as JavaScript fetch, Node axios, Python requests, Go net/http or PHP cURL. Nothing leaves your browser.

Open source on GitHub

curl command

Tip: in Chrome or Firefox DevTools, right-click a request in the Network tab and choose Copy → Copy as cURL (bash).

JavaScript fetch

Paste a curl command to convert it to code.

Runs entirely in your browser. Nothing you paste here is uploaded or stored.

Reference

curl flags, explained. What each option means and how it maps to code.

Common curl options and what they do
OptionWhat it doesMaps to
-X, --requestSets the HTTP method (GET, POST, PUT, PATCH, DELETE…).method
-H, --headerAdds a request header, e.g. -H "Authorization: Bearer …". Repeatable.headers
-d, --dataSends a body and switches the method to POST. Defaults to Content-Type: application/x-www-form-urlencoded. With @file it reads the file and strips newlines.body
--data-rawLike -d, but a leading @ is sent literally instead of reading a file.body
--data-binaryLike -d, but keeps newlines and bytes exactly as given.body
--data-urlencodeURL-encodes the value before sending it (name=value encodes only the value).body
--jsonSends a JSON body and sets Content-Type and Accept to application/json (curl 7.82+).json
-F, --formSends multipart/form-data. name=@path uploads a file, name=<path sends file contents as text.multipart
-u, --userHTTP Basic authentication as user:password.auth
-b, --cookieSends cookies, e.g. -b "session=abc; theme=dark".Cookie header
-G, --getAppends the -d data to the URL as a query string and sends a GET.query string
--compressedAsks for a compressed response and decompresses it.Accept-Encoding
-L, --locationFollows redirects. Most HTTP libraries do this by default; curl does not.redirects
-k, --insecureSkips TLS certificate verification. Only use against local or test servers.TLS
FAQ

Frequently asked questions

How do I get a curl command for a request in my browser?

Open DevTools, go to the Network tab, right-click the request and choose Copy → Copy as cURL (bash). In Chrome on Windows, pick the bash variant rather than cmd so quotes paste cleanly. Paste the result here to turn it into code.

Which curl options does the converter support?

Method (-X), headers (-H, -A, -e), every data flag (-d, --data-raw, --data-binary, --data-urlencode, --json), multipart forms (-F), Basic auth (-u), cookies (-b), -G, --compressed, -L and -k, plus combined short flags like -sSL and line continuations with a backslash. Options that only affect curl’s own output, such as -s or -v, are ignored.

Is it safe to paste commands with tokens or cookies?

The conversion happens entirely in your browser and nothing is sent to a server. Copied curl commands often include session cookies and bearer tokens, though, so remove them before sharing the converted code with anyone.

Why does the Python output use json= instead of data=?

When the request has a JSON Content-Type and a valid JSON body, the converter passes it as a Python dict with json=, which serializes it and sets the header for you. Bodies that are not valid JSON are sent unchanged with data=.

Why is the response different from what curl returns?

Common causes are redirects (curl does not follow them without -L, most libraries do), compression, cookies that have expired since you copied the command, and browser-only headers. Comparing the failing request with the network log from the user’s session is usually the fastest way to spot the difference.

Customer support runs on Screendesk.

Start for free