Skip to content
Marvin's Toolbox.

cURL Converter

Paste a cURL command and get the same request as JavaScript fetch, Python requests, Go net/http, PHP, Rust and more. Headers, cookies, auth, form data and JSON bodies carry over, and a fetch() call can be turned back into a cURL command.

Runs entirely in your browser. Nothing you put in here gets uploaded.

Convert

Language

Parsed request

Method
POST
URL
https://api.example.com/v1/users?notify=true
Query (1)
  • notify = true
Headers (2)
  • Content-Type: application/json
  • Authorization: Bearer YOUR_TOKEN
Body
{
  "name": "Ada Lovelace",
  "email": "ada@example.com",
  "roles": [
    "admin"
  ]
}

Next steps

Keep going. These tools open with your result loaded in.

Convert text into every case at once: title case in the APA, AP, Chicago, MLA, Bluebook, AMA and NYT styles, sentence case, upper, lower, camelCase, snake_case, kebab-case and more.

Count words, characters, sentences, paragraphs, lines and more as you type, with estimated reading and speaking time.

Remove duplicate lines from a list or text, keeping the first occurrence. Optionally ignore case and whitespace, or drop blank lines too.

Replace text in two modes: plain find and replace all, or regular expressions with flag controls and capture group references like $1.

Compare two texts and see every added, removed and changed line highlighted, side by side or inline, with the changed words marked within each line. Ignore case, whitespace or blank lines, read a summary of how much changed, and export the result as a unified diff.

Paste a UUID to see what it carries: version, variant, and for time-based versions the exact timestamp, clock sequence and node. Also shows the raw bytes, the 128-bit integer and the URN form.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly, reads URL-safe Base64, and shows binary payloads as a hex dump you can download.

Convert numbers between binary, octal, decimal, hexadecimal and any base up to 36. Type into any field and the others update as you go. Handles huge integers without losing precision and accepts 0x, 0b and 0o prefixes.

Convert between scientific notation and full numbers as you type. Reads 1.23e5, 1.23 × 10^5 and plain numbers, shows the value written out, in normalized scientific notation and in engineering notation, and can round to any number of significant digits.

About the cURL Converter Tool

This tool turns a cURL command into code that sends the same request. Paste a command, pick a language, and you get JavaScript fetch, Node axios, Python requests, Go net/http, PHP curl, Rust reqwest, HTTPie or wget code that carries over the method, URL, headers, cookies, basic auth, form fields, file uploads and JSON bodies.

It also works the other way. Paste a fetch() call, for example from your browser's Copy as fetch, and get a cURL command back to run in a terminal or share in a bug report.

Below the code, the parsed request lists the method, URL, query parameters, headers and body, so you can check how the command was read before you copy anything.

What you can do

  • Convert a cURL command to JavaScript fetch
  • Convert cURL to Python requests
  • Convert cURL to Go, PHP, Rust or Node axios
  • Turn a cURL command into an HTTPie or wget command
  • Convert a fetch() call back into a cURL command
  • Convert a request copied from browser dev tools into code
  • Pretty-print a JSON request body

How to use the cURL Converter

  1. 1Paste a cURL command into the left pane. Multi-line commands with backslashes work, and so does the Windows cmd version with carets.
  2. 2Pick the language you want. The code updates as you type.
  3. 3Check the parsed request and any notes about options that could not be carried over.
  4. 4Copy the code or download it as a file.

Which cURL options are understood

The converter reads the options that shape a request: -X, -H, -d and its --data-raw, --data-binary and --data-urlencode variants, --json, -F form fields and uploads, -u basic auth, -b cookies, -A, -e, -k, -L, -G, -I, --compressed, -m and --url. Short flags can be grouped like -sSL.

Options that only change curl's own output, like -s, -v or -o, are skipped quietly. Options that change the request but have no match in the generated code, like a proxy or a client certificate, show up as a note instead of breaking the conversion. Shell variables such as $TOKEN stay in the code as written so you can fill them in.

How bodies are written

A JSON body becomes a native object in each language when pretty-printing is on, like a dict passed as json= in Python or serde_json::json! in Rust. Turn it off to keep the body as the exact string from the command.

A body read from a file with -d @file or -T reads that file in the generated code. Form uploads use each library's own multipart support, so the boundary and content type are set for you.

From fetch() to cURL

The reverse direction understands what browsers put in Copy as fetch, plus hand-written calls with JSON.stringify, URLSearchParams, Headers and AbortSignal.timeout. Variables in the code stay as placeholders and are listed so you can replace them. Since fetch follows redirects and curl does not by default, the command gets -L. To escape a string for a shell by hand, use the String Escaper, and to look at a URL's parts in detail, use the URL Parser.

Tools that share a tag with this one.

Encode and decode Base16, Base32, Base36, Base45, Base58, Base62, Base64 and Base85. Pick the alphabet variant you need, from Crockford Base32 to Bitcoin Base58 and Ascii85, and convert in either direction.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly, reads URL-safe Base64, and shows binary payloads as a hex dump you can download.

Convert a color between HEX, RGB, HSL, HSV, HWB, CMYK, OKLCH and OKLAB. Type into any field and the others update as you go, or pick the color visually. Reads CSS color syntax and keeps alpha where the format supports it.

Convert config and data between JSON, YAML, TOML, JSON5, INI, XML, CSV and .env. Type or paste on the left, pick the output format on the right, and copy the result. Includes a format button and a minify toggle.

Convert between px, rem, em, percent, pt and viewport units with a configurable root font size. Type into any field and the others update as you go, set the parent font size for em math, and read a conversion table for common sizes.

Turn docker run commands into a docker-compose.yml, or a compose file back into docker run. Ports, volumes, environment variables, networks, restart policies and resource limits carry over.