cURL Converter: cURL to Fetch, Python, Axios & More

Paste a curl command, for example one copied from your browser DevTools, and get ready-to-run code in 8 languages. Headers, JSON bodies, forms, file uploads, auth and cookies are all converted.

Runs in your browserNo sign-upNothing uploaded

Convert to
JavaScript fetch

    

    How to use the cURL Converter

    1. Copy a request as cURL: in Chrome or Firefox DevTools, right-click a request in the Network tab → Copy → Copy as cURL.
    2. Paste it into the input box. Multi-line commands with \, Windows ^ continuations and $'…' strings are supported.
    3. Pick the target: JavaScript fetch, Axios, Node.js, Python requests, Python httpx, Go, PHP or HTTPie.
    4. Read any warnings below the output. They list options that have no equivalent in the target language.
    5. Copy the code or download it as a file.

    Why convert curl commands to code?

    curl is the common language of HTTP. API docs show examples as curl, browser DevTools export requests as curl, and support teams send reproductions as curl. When you want that request inside an application you have to rewrite it by hand: move every -H into a headers object, turn -d into a body, convert -u into basic auth and remember that -G moves data into the query string. This converter does that translation for you and produces code you can paste straight into a project.

    Supported curl options

    OptionConverted to
    -X, -I, -GHTTP method (POST is inferred when a body is present)
    -H, -A, -e, -bHeaders, User-Agent, Referer and cookies
    -d, --data-raw, --data-binary, --data-urlencode, --jsonRequest body: JSON objects, form fields or raw text
    -FMultipart form data, including @file uploads
    -u, --oauth2-bearerBasic auth or a Bearer token
    -k, -L, -m, -x, --compressedTLS verification, redirects, timeout, proxy and compression

    JSON bodies become real objects

    When the request sends JSON (a Content-Type: application/json header, --json, or a body that parses as JSON), the converter emits native data structures instead of an escaped string: JSON.stringify({...}) for fetch, a plain object for Axios and json= with a Python dict (True, False, None) for requests and httpx. That makes the payload easy to edit and fill with variables.

    Differences to keep in mind

    Browsers cannot disable certificate checks or route a single request through a proxy, so -k and -x only appear as comments in browser fetch code. curl does not follow redirects unless you pass -L, while fetch, requests and Go follow them by default. A body sent with -d but no Content-Type is form-encoded by curl; if it looks like JSON, the converter sends it as JSON and tells you so in a warning.

    Frequently asked questions

    Is my curl command sent to a server?
    No. Parsing and code generation run entirely in your browser. Commands copied from DevTools often contain cookies and tokens, so nothing is uploaded or stored.
    How do I copy a request as cURL from Chrome?
    Open DevTools (F12), go to the Network tab, right-click the request and choose Copy → Copy as cURL (bash). The cmd variant for Windows also works here.
    Does it handle file uploads?
    Yes. -F name=@file becomes FormData in JavaScript, a files= dict in Python, mime/multipart in Go and CURLFile in PHP. -d @file and -T file read the request body from a file.
    What happens to options the converter does not know?
    They are listed as warnings under the output so nothing is dropped silently. Output-only flags such as -s, -v or -o are ignored because they do not change the request.
    Should I use requests or httpx in Python?
    requests is the long-standing default for synchronous scripts. httpx has a nearly identical API, adds HTTP/2 and async support, and does not follow redirects unless you ask, which matches curl more closely.

    Related tools