cURL Converter
Paste a cURL command and get ready-to-run code for 8 languages, a live request-anatomy breakdown, and one-click secret redaction.
About cURL Converter
You copied a request as cURL from Chrome DevTools, or an API doc only shows a curl snippet, and now you need it running in your own stack. This cURL converter turns any curl command into ready-to-run code for JavaScript fetch, axios, Node https, Python requests, Python httpx, Go net/http, PHP curl, and HTTPie, all in a single parse, with one click to copy. Paste the command and you get three things at once. First, a live request-anatomy breakdown that shows the resolved method, URL, query parameters, headers, detected authentication scheme, and parsed body, so you can confirm the command does what you think before you run it. Second, tabbed output for eight languages generated from the same parse, so switching stacks is a single click. Third, optional secret redaction that masks Authorization tokens, cookies, and API keys in both the breakdown and the generated code, which is useful when you are about to share a reproduction with a teammate or paste into an issue. Everything runs locally in your browser. Your tokens, cookies, and payloads never leave the page; there is no server round-trip and nothing is logged. The parser also handles the messy realities of copy-paste: Windows curl.exe caret continuations, PowerShell backtick continuations and prompts, bash backslash line breaks, and curly smart quotes are normalized automatically, and the tool tells you exactly what it cleaned up.
How to use the cURL Converter
- Copy a request as cURL (in Chrome DevTools, open Network, right-click a request, choose Copy, then Copy as cURL), or grab a curl example from your API docs.
- Paste the command into the input box on the left. Output updates instantly. There is no submit button.
- Read the request-anatomy breakdown to confirm the method, URL, query parameters, headers, auth scheme, and body were parsed correctly.
- Pick a language tab: fetch, axios, Node https, Python requests, Python httpx, Go, PHP, or HTTPie.
- Toggle "Redact secrets" before copying if you plan to share the snippet, so tokens, cookies, and API keys are masked.
- Click the copy button on the active tab and paste the generated code into your editor.
Common Use Cases
Port a DevTools request into your client
Take a "Copy as cURL" request straight from the browser Network panel and drop it into a Python or JavaScript client without hand-translating headers and bodies.
Run an API doc's curl example
Convert the curl snippet from a vendor's API documentation into runnable code for your project's language and HTTP library in one step.
Share a reproduction safely
Redact Authorization tokens and cookies before pasting a failing request into a bug report, pull request, or chat, so secrets never leak.
Sanity-check a complex command
Use the anatomy breakdown to verify exactly how a long curl command parses (method, query params, headers, auth, and body) before you execute it.
Frequently Asked Questions
How do I convert a curl command to Python requests?
Paste the curl command, then open the "Python requests" tab. The tool emits a requests.request() call with the method, URL, headers, and body wired up. The "Python httpx" tab produces the equivalent httpx code if you prefer that library.
How do I convert a curl command to JavaScript fetch or axios?
Paste the command and choose the "fetch" tab for a native fetch() call, or the "axios" tab for an axios config object. JSON bodies are pretty-printed and headers are carried over verbatim, so the result is ready to paste into your code.
How do I copy a request as cURL from Chrome DevTools?
Open DevTools, go to the Network panel, reload to capture traffic, right-click the request you want, then choose Copy and Copy as cURL (Copy as cURL (bash) on Windows). Paste the result here and it will be parsed immediately.
Are my tokens and cookies sent to a server?
No. The entire conversion runs locally in your browser. Parsing, anatomy, redaction, and code generation all happen client-side. There is no network request and nothing is stored or logged. Your tokens, cookies, and payloads never leave the page.
Why does my Windows curl.exe command convert incorrectly elsewhere?
Windows shells use caret (^) line continuations and PowerShell uses backticks, and both often add prompts and curly smart quotes that break naive parsers. This tool normalizes carets, backticks, prompts, bash backslashes, and smart quotes automatically, and shows you a note of exactly what it cleaned up.
Does it support form data (-F) and JSON bodies?
Yes. The parser detects multipart bodies from -F, urlencoded form bodies from -d a=b&c=d, and JSON bodies (either by Content-Type or by parsing the payload), and shows each in the breakdown. For multipart, text fields are emitted using each target's proper multipart API (FormData for fetch/axios, files= for Python requests/httpx, mime/multipart for Go, an array for PHP curl, --form for HTTPie). File fields written as name=@/path cannot be read from your local disk by generated code, so those are emitted as a clearly marked placeholder with the path preserved, so wire the actual file in yourself before running.
What does "Redact secrets" actually mask?
Redaction masks values that are clearly secret-bearing: the Authorization header, Cookie/Set-Cookie, headers matching api-key/token/secret/x-*-key patterns, the detected auth scheme, and form fields whose names look like token/key/secret/password. It does NOT scrub secrets embedded inside a JSON request body or inside the URL query string, because those have no reliable signal for which value is sensitive. Review the body and URL by hand before sharing a redacted snippet.