API and HTTP tools

cURL converterOne request, several languages

One request, several languages

cURL converter

Input

Your input is processed in this browser and is not sent to a server.

Results

Options

Flags: -X, -H, -d, --data-raw, --data-binary, --data-urlencode, -G, -I, --url. Other flags, duplicate/empty headers and transport-managed headers are rejected.

Reverse input requires Fetch redirect: "manual" or Axios maxRedirects: 0. Axios JSON string bodies require transformRequest: []; literal JSON objects are supported.

Targets: Fetch Node 18+, Axios Node, Python requests, PHP cURL, Go standard library, Java 11+, C# 9+, Ruby standard library. Code is never executed.

Limits: 100,000 UTF-16 units; 1,000 arguments; 100 headers; JSON depth 10 and 5,000 AST nodes.

Paste one curl, Fetch or Axios request, or preview an example.

The cURL converter helps move an API example into a project without retyping its URL, headers and text body. Choose a target and compare the generated request before adding your own error handling.

Convert curl to Python for a script, curl to JavaScript for Node, or curl to axios for an existing client. The reverse direction accepts a single Fetch or Axios call with supported literal values.

Why use this cURL converter?

Compare the same request across languages

The cURL converter keeps method, URL, headers and body in one model. Switch among eight code targets without manually rewriting the payload. Library defaults still require review.

One request branches into several programming languages.

Return a literal call to curl

Bring a supported Fetch or Axios snippet back to a command for documentation. Variables and executable expressions are rejected instead of being evaluated.

A JavaScript request returns to a single curl command.

Choose the direction before pasting

01

Start with one request

The page starts empty. Select curl, Fetch or Axios input; URLs must be absolute HTTP(S), with Unicode percent-encoded. Example replacement requires preview and Apply.

02

Control when results change

Automatic conversion waits 350 ms. Switch it off to use Convert or Ctrl/Cmd+Enter. Changing input or options disables exports until a fresh result succeeds.

03

Review before replacing or sharing

Format, Example and Clear preview input changes and provide one undo after Apply. Check embedded credentials before copying or downloading code.

From command flags to request code

Eight code targets

Generate Fetch for Node 18+, Axios for Node, Python requests, PHP, Go, Java, C# or Ruby. Fetch used in a browser remains subject to browser policies.

Text payloads remain explicit

Supported data flags produce a UTF-8 text body; -G moves data into the query. Standard uppercase methods include GET, HEAD, POST, PUT, PATCH, DELETE and OPTIONS.

Literal JavaScript input

Read supported Fetch options or Axios configuration and method calls. JSON.stringify with literal JSON is interpreted statically; no supplied code runs.

Visible conversion errors

Unsupported syntax and options stop generation with a position. A rejected request cannot leave an old result available for export.

Supported syntax and deliberate limits

One command and URL
No multiple commands, pipes, redirects, shell expansion, URL globs, URL credentials or fragments. Only ASCII absolute HTTP(S) URLs are accepted.
A defined flag subset
Accept -X, -H, -d, --data-raw, --data-binary, --data-urlencode, -G, -I and --url with supported combinations. Unknown flags are errors.
No implicit request changes
Duplicate headers, empty-header removal, -u, -b, redirect settings and multipart/file input are unsupported. GET and HEAD cannot carry a body.
No dynamic JavaScript
Variables, spread, functions and computed properties are outside the literal subset. Static JSON is limited to depth 10 and 5,000 AST nodes. Reverse input requires Fetch redirect: "manual" or Axios maxRedirects: 0. Axios JSON string bodies require transformRequest: []; literal JSON objects are supported.
Bounded input
Maximum 100,000 UTF-16 units, 1,000 command arguments and 100 headers. Exceeding a limit rejects conversion rather than truncating the request. If formatting expands input beyond 100,000 UTF-16 units, you can preview it but cannot apply it. The complete generated output can still be exported.
Runtime behavior needs review
Code generation does not test connectivity or promise identical wire traffic. Axios Node disables redirect following and automatic request-body transforms; credentials in source remain in output. Default Accept is written explicitly: */* for curl/Fetch and application/json, text/plain, */* for Axios. Axios DELETE/OPTIONS string bodies require an explicit Content-Type. Percent-encode characters that RFC 3986 does not allow in a URL; empty userinfo is rejected too.

cURL converter questions

Which curl flags can be converted?

Supported request flags include -X, -H, text data options, -G, -I and --url. Unsupported flags produce an error; inspect the rules before simplifying a copied command.

How can I obtain curl from DevTools?

In the browser Network panel, select a request and choose Copy as cURL, preferably the bash form. Extra transport flags may need review because this converter uses a strict subset.

Which output languages are available?

Fetch, Axios, Python, PHP, Go, Java, C# and Ruby are available. The cURL converter can also return supported literal Fetch and Axios calls to curl.

How do I produce a Fetch request?

Select curl input and Fetch output. The generated code targets Node 18+; moving it into a browser may introduce CORS and restricted-header differences.

Can shell variables change conversion?

Shell variables are rejected rather than resolved. Paste a literal request; the tool does not run commands or read environment values.

Something looks wrong?

Prepare your next request

Use the cURL converter to inspect a curl to code result, verify its payload and adapt the snippet to your application.