cURL Converter. Paste a command, get real code.
Your command never leaves your browser, nothing is uploaded.
From curl to any client, without the guesswork
A curl command is a great way to describe an HTTP request, but turning it into working fetch, Axios, Python requests or PowerShell code by hand is fiddly, headers, JSON versus form bodies, basic auth, multipart uploads, redirects and timeouts all have to line up. This converter parses the command with a real shell-style tokenizer (single quotes, double quotes, escapes and line continuations all handled), classifies the body, applies sensible content-type defaults, and prints clean, idiomatic code in all four languages at once. It runs entirely in your browser, nothing is uploaded, and it keeps working offline.
How to use the cURL Converter
This converter turns a curl command into the same request written in JavaScript fetch, Axios, Python requests and PowerShell. It splits the command the way a shell would, works out the method, headers, body and auth, then writes code for all four at once. Use it when API docs give you a curl example and you need it in your own code.
Step by step
-
Paste the command
Paste the full command into the curl command box. Commands split over several lines with a backslash, a caret or a backtick at the end of each line are joined for you. If the command has no http:// or https:// in front of the address, https:// is added.
-
Convert it
Press Convert. The box also converts on its own about a third of a second after you stop typing. Press Load sample to see a POST with two headers, basic auth, a JSON body and a 30 second timeout.
-
Check the summary
Above the code, a row of tags shows the method, the URL, the number of headers and the body type, plus Basic auth, follow redirects or a timeout when the command uses them. Read this first to confirm the request was understood.
-
Read the notes
Amber notes flag anything that could not be carried over, such as an unsupported flag or a body read from a file. Gray notes explain choices the converter made, such as adding a JSON Content-Type header.
-
Pick a language
Switch between the JS fetch, Axios, Python and PowerShell tabs. All four are built from the same command, so you can compare them without converting again.
-
Copy or download
Press Copy code to copy the tab you are viewing, or Download to save it as fetch-request.js, axios-request.js, request.py or request.ps1.
Reading the output
- With no -X flag, the method is POST when the command sends data, HEAD with -I and GET otherwise.
- The body type tag reads JSON body, form-urlencoded body, raw body, multipart form or no body. A body that starts with { or [ is treated as JSON even without a Content-Type header, and the header is added for you.
- With -G, the data is moved into the URL query string instead of the body, and the method stays GET.
- Basic auth from -u becomes an Authorization header in fetch and PowerShell, the auth option in Axios and auth= in Python.
Tips and common mistakes
- Bodies loaded from a file, such as -d @body.json, are not read. Paste the file contents into the command instead, or the converter warns and leaves the body out.
- File fields in -F forms become a comment in fetch and Axios, because a browser can only send a file the user picks. Python opens the file by name and PowerShell uses Get-Item, and -Form needs PowerShell 7 or later.
- The -k flag becomes verify=False in Python and -SkipCertificateCheck in PowerShell, which needs version 6 or later. Fetch in a browser cannot skip certificate checks, and the Axios code only shows the Node.js option as a comment.
- Axios follows redirects by default and curl only does with -L, so the Axios code reminds you when the command did not ask for it.
- Commands copied from browser developer tools often carry cookies and tokens. Remove them before you share the converted code.
Privacy and limits
The command is parsed and the code is written in your browser. Nothing is uploaded, and the converter never sends the request itself, so the API in the command is not contacted. Nothing is saved between visits.
Everything the command actually says.
--json and JSON pretty-printing.
-u basic auth, -A user-agent, -e referer and -b cookies map to each library's idiomatic option.
-F forms, -G query moves, --data-urlencode, -L redirects, -k insecure and --max-time timeouts.
.js, .py or .ps1 file.
Frequently asked questions.
Is the cURL Converter free?
Is my command uploaded anywhere?
Which languages does it output?
fetch, Axios, Python requests, and PowerShell Invoke-RestMethod. All four are generated at once so you can switch tabs and compare.Which curl flags are supported?
-X, -H, -d / --data / --data-raw, --data-urlencode, --json, -F forms, -u basic auth, -A, -e, -b, -G, -L, -k, -I and --max-time. Flags that can't translate (file uploads, proxies) are flagged with a note.Does it handle JSON bodies and multipart forms?
-F multipart forms become FormData, files= in Python and -Form in PowerShell. File-backed fields (@file) are pointed out so you can wire them to a real file input.Does it work offline?
Published · Last updated .