cURL Parser

Runs in browser Web

Paste any cURL command (from browser DevTools "Copy as cURL" or docs) to understand it and convert it into code or JSON.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

How to use cURL Parser

  1. Paste the cURL command (multi-line is fine).
  2. Choose the target language.
  3. Optionally drop browser-only headers, then copy the converted code or the JSON structure.

cURL Parser features

  • Shell-aware tokenizer: single/double/ANSI-C quotes, escaped characters, backslash, backtick and caret line continuations
  • Recognises -X, -H, -d/--data-raw/--data-binary/--data-urlencode, --json, -F, -u, --oauth2-bearer, --url, -A, -e, -b, -L, --compressed, -k, -I, -G, --max-time, combined flags and --flag=value
  • Infers the method (POST for bodies, HEAD for -I), decodes Basic credentials and extracts Bearer tokens and API keys
  • Converts to thirteen targets including fetch, axios, Python, Java, C#, Go, PHP and Ruby
  • Option to drop browser-only headers from DevTools exports
  • Structured JSON view of the request and a list of ignored flags

cURL Parser example

Convert a DevTools export to fetch

Input:

curl 'https://api.example.com/v1/orders' -H 'authorization: Bearer eyJ…' -H 'content-type: application/json' --data-raw '{"sku":"KB-100"}' --compressed

Output:

const response = await fetch("https://api.example.com/v1/orders", {
  method: "POST",
  headers: {
    "Authorization": "Bearer eyJ…",
    "content-type": "application/json"
  },
  body: JSON.stringify({
    "sku": "KB-100"
  })
});

Frequently asked questions about cURL Parser

Which cURL flags are understood?

-X/--request, -H/--header, -d/--data/--data-raw/--data-binary/--data-urlencode, --json, -F/--form, -u/--user, --oauth2-bearer, --url, -A, -e, -b, -L, --compressed, -k, -I, -G, -m/--max-time, combined short flags (-sSL), --flag=value syntax, $'…' quoting and line continuations for bash, PowerShell and cmd. Unknown flags are listed as ignored.

Why is the method POST when the command has no -X?

That is curl's own rule: any -d or -F option implies POST unless -G (send data as query) or an explicit -X is given. -I implies HEAD.

What does "Drop browser-only headers" remove?

Headers that browsers add automatically and that break or bloat scripted requests: sec-ch-*, sec-fetch-*, user-agent, cookie, referer, origin, accept-language, accept-encoding, priority, cache-control and pragma. Authorization and Content-Type are always kept.

Is a Basic Authorization header decoded?

Yes. "Authorization: Basic …" is base64-decoded into username and password so the converted code can use the client's native auth option; Bearer tokens and X-API-Key headers are recognised too.