cURL to JSON & Code Converter

Convert cURL commands into clean JSON payloads and code snippets for JavaScript Fetch, Python Requests, and Go.

Private by architecture: All processing is 100% client-side memory. Your data never leaves this browser tab.
cURL Command
0 lines · 0 charscURL
Output
Ctrl/Cmd+Shift+C
0 charsJSON

About This Tool

Parses a raw cURL command (copied from browser devtools, an API doc, or a terminal) into its method, URL, headers, and body, then regenerates that same request as JavaScript fetch, Python requests, or Go net/http code from the same parsed result.

Parsing happens locally and nothing is ever sent over the network. If more target languages are needed (Axios, HTTPX, Rust), see cURL to Code instead.

Key Features

  • Output Mode dropdown: Switches instantly between parsed JSON/headers, JS fetch, Python requests, and Go net/http.
  • Line-continuation joining: A multi-line cURL command with trailing backslashes is parsed as-is without manual cleanup.
  • Mode-aware download: Download button file extension follows the selected Output Mode (.json, .js, .py, .go).
  • Sample request: Loads a realistic Stripe-style POST request with an auth header and JSON body.
  • Keyboard shortcuts: Cmd/Ctrl+Enter to convert, Cmd/Ctrl+Shift+C to copy output.

Frequently Asked Questions

Which cURL flags are recognized?
-X/--request, -H/--header, -d/--data/--data-raw/--data-binary/--data-ascii, and -u/--user. Multi-line commands with trailing line continuations are joined automatically.
What method is used if I pass -d without -X?
The request defaults to GET, but supplying a -d/--data body automatically upgrades it to POST, matching real cURL behavior.
Is my -u username/password sent anywhere?
No. It is base64-encoded into an Authorization: Basic header entirely in your browser; nothing is transmitted off the page.
What if the request body isn't valid JSON?
The converter tries JSON.parse on the body; if that fails, it is kept as a plain string in the body field instead of an error.
Which code output formats are available?
Parsed JSON/Headers, JavaScript (fetch), Python (requests), and Go (net/http), selectable from the Output Mode dropdown.