API & Web Processed locally

cURL Converter

Paste a cURL command and convert it to Fetch, Axios, Python, Go, Java, C#, PHP, Rust, Postman, HAR, OpenAPI, raw HTTP, and more — preserving method, headers, query params, and body. It also runs in reverse: paste fetch(), axios, or Python requests code and get the equivalent cURL back. Sanitize or extract secrets to env vars before sharing. Runs in your browser; nothing is uploaded.

Auto-converts as you type. Ctrl+Enter to re-run.

Guide & FAQ

Turn a curl command — copied from API docs, a terminal, Postman, "Copy as cURL" in browser DevTools, or a ticket — into ready-to-use code in the language you actually ship. Supports JavaScript fetch, Axios, Node.js (https / node-fetch), Python requests, Go, Java, C#, Ruby, PHP, and PowerShell. Preserves method, headers (auth, content-type, custom), query parameters, JSON body, and form data. Runs locally; cURL command never leaves your browser.

What it does
  • Parses any curl command — handles -X, -H, -d, --data-raw, --data-urlencode, --form, -u, --compressed, --insecure.
  • Emits clean code for fetch, Axios, Node.js, Python requests, Go, Java, C#, Ruby, PHP, PowerShell.
  • Handles JSON bodies (with proper escaping), form-encoded data, and multipart uploads.
  • Preserves Basic auth, Bearer tokens, and custom auth headers.
  • Removes shell line continuations (\) and normalizes quoting.
  • Normalized cURL output: clean, re-shareable cURL for tickets — with sanitized or env-var secrets.
When to use it
  • Port a cURL command from API docs into your frontend or backend code.
  • Reproduce a browser DevTools network request in Python or Go.
  • Convert a Postman "Code" snippet into a different language.
  • Generate a quick fetch wrapper for an experiment.
  • Share a working example with a team that uses a different language.
  • Build integration tests from a known-good cURL command.
How to use it
  1. Paste your curl command (multi-line works — shell continuations are normalized).
  2. Pick the target language / library (fetch, Axios, Python requests, Go, etc.).
  3. Copy the generated snippet straight into your editor.
  4. For browser-side fetch with auth, double-check CORS — the original cURL succeeds outside CORS rules.
  5. Use the Request Snippet Generator for JSON-first input, or the HTTP Headers Parser to inspect just the headers.
Tips & pitfalls
  • Browser CORS: a cURL command runs outside browser CORS, so a "Copy as cURL" snippet may not work from JavaScript without server-side CORS support.
  • Preserve all -H headers — auth and content-type often come from headers you forgot.
  • Use -d / --data-raw for JSON bodies; verify the converter emitted JSON.stringify or json= as appropriate.
  • Multi-line cURL from --next or piped output may be multiple requests — separate them first.
  • For --insecure (skip TLS verification), do not replicate this in production code — it disables certificate checks.
  • Cookies pasted via -b / --cookie often expire quickly — refresh and re-export.
FAQ

FAQ

  • How do I convert cURL to fetch? Paste the cURL, select fetch, and copy the generated JavaScript.
  • How do I convert cURL to Axios? Paste the cURL and choose Axios (browser or Node.js) — the converter maps the method, URL, headers, query params, and body into an axios() config object, and flags any browser-forbidden headers so the request matches the original.
  • How do I convert cURL to Python? Pick Python (requests) — the snippet uses the requests library with the right method, headers, and JSON body.
  • Does it support multipart uploads? Yes — --form / -F flags are translated to multipart bodies in each target language.
  • Why doesn't my fetch work in the browser when the cURL works? Browser fetch is subject to CORS — the server must allow the origin, methods, and headers. cURL ignores CORS.
  • Is my cURL uploaded? No. Conversion runs in your browser. The cURL is never sent to a server.
  • Can it produce a Postman collection? For Postman specifically, see the OpenAPI → Postman Exporter or paste the cURL into Postman's "Import" dialog.
Use-case guides

Runs locally in your browser. No uploads. Watch out for browser CORS when porting a cURL to client-side fetch.

Need the full picture? Open the request in the API Debugging Studio for a one-screen debugging board with parsed headers, JWT decode, body pretty-print, scan, snippets, and gated share.

Common tasks solved by this tool

Continue in an API request workflow

Chain this into related tools, or build it as a saved workflow in Workflows.

  1. Parse the request URL
  2. Convert the cURL command to code — this tool
  3. Format the JSON payload
  4. Decode JWT headers
  5. Verify webhook signatures