Skip to content

curl to Code

Converts a curl command into fetch, axios, Python requests, Go, PHP or PowerShell.

Takes a `curl` command — usually one copied out of a browser’s network panel — and writes the equivalent request in fetch, Python, Go, Node or another target. It parses with real POSIX quoting rules, so a JSON body full of escaped quotes comes through intact.

🔒 Runs entirely in your browsercurlconverthttpcodegen
Generate

curl command

fetch

Parsed request

Method

POST

Headers

2

Body

31 chars

The command is split with real POSIX quoting rules — single and double quotes, backslashes and $'…' strings — so bodies with escaped JSON survive intact. Nothing is executed and no request is sent; $VARIABLES are kept literally and flagged, since only your shell knows their values.

How to use it

  1. Copy the request as cURL

    Every browser’s network panel has "Copy as cURL" in its context menu. Paste that here, backslashes and all.

  2. Choose the target

    The generated code carries the method, the headers, the body and basic auth if there was any. Nothing is sent from this page.

  3. Check the parsed summary

    It shows the method, the header count and what the body was read as. Anything the parser could not map is listed as a warning rather than being dropped.

Common questions

Are my credentials sent anywhere?

No. Nothing is executed and no request is made — the command is parsed as text in your browser. That said, a cURL copied from a network panel usually contains a live session cookie or bearer token, so treat the generated code the same way you would treat a password.

Why is `$TOKEN` still in the output?

Because only your shell knows what it expands to. A variable is kept literally and flagged, rather than being guessed at or silently emptied — an empty Authorization header is a much worse bug than a visible placeholder.

Does it handle file uploads?

A `-F` multipart form is parsed and reported, but a `@filename` reference points at a file this page cannot read, so the generated code has a placeholder where the file goes. Everything else in the request is complete.

Feed it from

Next

These accept what this tool produces, so the result can go straight in.