Diese Seite ist noch nicht auf Deutsch verfügbar, daher zeigen wir die englische Version.

cURL to Code Converter

Paste a curl command — from API docs or “Copy as cURL” in your browser’s DevTools — and get ready-to-run code for six languages, with headers, body and authentication carried over.

Aktualisiert am

  

Deine Daten verlassen nie deinen Computer. Die Verarbeitung erfolgt zu 100 % lokal im Browser.

So nutzt du: cURL to Code

  1. Copy a request as curl — in Chrome or Firefox DevTools right-click a request in the Network tab and choose Copy › Copy as cURL — or take a curl example from API documentation.
  2. Paste it into the curl command box. Multi-line commands with \ continuations are fine.
  3. Pick a language tab: JavaScript fetch, Axios, Node.js, Python, PHP or Go.
  4. Read the notes below the code for anything that needs your attention, then click Copy code.

What does a curl to code converter do?

curl is the universal language of HTTP examples: API documentation, Postman exports and every browser’s “Copy as cURL” feature produce curl commands. Translating one by hand into your application’s language means re-typing headers, escaping JSON and remembering how each HTTP client handles forms and authentication. This converter parses the command the way a POSIX shell and curl would, then generates idiomatic code for the client library you use.

Supported curl options

OptionConverted to
-X, --requestHTTP method (otherwise GET, or POST when a body is present)
-H, --header, -A, -e, -bRequest headers, including User-Agent, Referer and Cookie
-d, --data, --data-raw, --data-binary, --data-urlencodeRequest body (form-encoded by default, like curl); @file reads a file
--jsonJSON body with Content-Type and Accept: application/json
-F, --formMultipart form data, including file uploads with ;type= and ;filename=
-u, --user, --oauth2-bearerBasic authentication or a Bearer token
-G, --get, --url-queryData appended to the URL query string
-I, -L, -k, -m, -x, --compressedHEAD requests, redirects, TLS verification, timeouts, proxies and compression where the library supports them

Quoting follows shell rules: single quotes, double quotes with backslash escapes, ANSI-C $'…' strings (Chrome uses these for bodies containing quotes) and line continuations. Windows “Copy as cURL (cmd)” commands with ^ escapes are detected and converted too. Output-only flags such as -s, -v or -o are ignored, and anything unsupported is listed in the notes rather than silently dropped.

Choosing a target

  • JavaScript fetch — built into every browser. Cross-origin requests also need the server to send CORS headers, and browsers refuse to set headers like Cookie or Host; the converter warns you when that applies.
  • Node.js fetch — built into Node 18+, no dependency needed; file uploads use fs.openAsBlob.
  • Axios — popular for its interceptors and automatic JSON handling.
  • Python requests — JSON bodies become native dictionaries passed with json=; forms become data= dicts.
  • PHP cURL — uses curl_setopt_array with the matching CURLOPT_* constants, ideal for WordPress or Laravel code without extra packages.
  • Go net/http — a complete runnable main.go with error handling and multipart support.

Security tips

Commands copied from DevTools often contain session cookies and access tokens. The conversion runs entirely in your browser and the command is never sent anywhere or added to the URL, but remember to remove secrets before committing generated code — load them from environment variables instead. Want to try a request right away? Use the API Tester. Need to inspect a token from the command? Paste it into the JWT Decoder.

Auch gesucht als: curl converter, curl to fetch, curl to python, curl to javascript, curl to axios, curl to php, curl to go, curl to node.

Passende Tools zu: cURL to Code

  • Base64-Kodierung / -Dekodierung — Konvertiere Text in Base64 und zurück – mit vollständiger UTF-8-Unterstützung (Akzente, Emojis), wechsle zu URL-sicheren Base64-Werten oder zieh eine Datei per Drag & Drop hinein, um deren Base64-Zeichenkette oder Daten-URI zu erhalten.
  • URL Encode / Decode — Percent-encode text for safe use in URLs, decode encoded strings back to readable text, and break any URL down into its parts and query parameters.
  • JSON Formatierer — Füge JSON ein, um es zu formatieren, zu minifizieren oder zu prüfen.
  • HTTP Header Checker — Fetch any URL and see exactly what the server sends back — status code, redirect chain and every response header, with a plain-English explanation of the ones that matter for SEO, caching and security.

Häufige Fragen

Is it safe to paste a curl command with my API key or cookies?
The command is parsed in your browser and never sent to our server or stored, and it isn’t added to the page URL. Still treat generated code like any secret-bearing file and move tokens into environment variables.
How do I copy a request as curl from Chrome?
Open DevTools (F12), go to the Network tab, reload the page, right-click the request and choose Copy › Copy as cURL (bash). On Windows, “Copy as cURL (cmd)” also works here.
Why is my -d data sent as form data and not JSON?
That mirrors curl: -d sets Content-Type: application/x-www-form-urlencoded unless you pass your own header. Add -H 'Content-Type: application/json' or use --json and the converter will produce a JSON body.
What happens to file uploads like -F file=@photo.jpg?
They become multipart uploads in every language — FormData in JavaScript, files= in Python, CURLFile in PHP and mime/multipart in Go — referencing the same local path, which you may need to adjust.
Does it follow redirects like curl -L?
fetch, Axios (in Node), Python requests and Go follow redirects by default, while curl only does with -L. In PHP the converter adds CURLOPT_FOLLOWLOCATION when -L is present.
Kann ich cURL to Code als Web-App installieren und offline nutzen?
Ja. cURL to Code ist eine installierbare Web-App (PWA) – sie wird über Ihren Browser installiert und nicht aus einem App-Store heruntergeladen. Klicken Sie oben auf dieser Seite in Chrome oder Edge (Windows, macOS, Linux, ChromeOS) auf „App installieren“ oder verwenden Sie auf Android-Geräten „Teilen“ → „Zum Startbildschirm hinzufügen“ auf dem iPhone und iPad bzw. „Datei“ → „Zum Dock hinzufügen“ in Safari 17+ auf einem Mac. Die App öffnet sich dann in einem eigenen Fenster mit einem eigenen Symbol, und da sie vollständig in Ihrem Browser ausgeführt wird, funktioniert sie auch offline. Firefox auf dem Desktop kann keine Web-Apps installieren. So funktioniert die Installation.

Ähnliche Tools