Skip to content

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.

§ · written guide

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

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

Back to the tool

§ 02 · what you can do

Everything the command actually says.

Four languages at once One paste generates JavaScript fetch, Axios, Python requests and PowerShell Invoke-RestMethod together, switch tabs to compare.
Smart body detection JSON, form-urlencoded, raw and multipart bodies are recognised and emitted the right way, including --json and JSON pretty-printing.
Real header & auth handling Headers, -u basic auth, -A user-agent, -e referer and -b cookies map to each library's idiomatic option.
Advanced flags parsed Handles -F forms, -G query moves, --data-urlencode, -L redirects, -k insecure and --max-time timeouts.
Honest warnings Unsupported or browser-impossible flags (file uploads, TLS bypass in fetch) are flagged with clear notes instead of silently dropped.
Copy or download Grab the generated snippet to your clipboard or download it as a ready-named .js, .py or .ps1 file.
§ 04 · faq

Frequently asked questions.

Is the cURL Converter free?
Yes, completely free for everyone. No sign-up, no account and no usage limits.
Is my command uploaded anywhere?
No, never. The command is parsed entirely in your browser on your own device, nothing is sent to a server, so tokens and secrets in your curl stay local.
Which languages does it output?
Four: JavaScript 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?
Common ones: -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?
Yes. JSON bodies are pretty-printed and sent with the right content-type; -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?
Yes, once the page has loaded, all parsing and code generation runs locally, so it keeps working without a connection.

Published · Last updated .

Priya sent you a message Online now

Talk to a Developer Now

Share your name and email to reply.

Reply