# curl Converter - Convert curl Commands to fetch, axios, Python, Go, PHP & Java

> Free online curl converter: paste a curl command and get fetch, axios, Node, Python requests, Go, PHP or Java code, plus a parsed view of the request.

- URL: https://qilingtools.com/en/curl-convert
- Category: Developer Tools (https://qilingtools.com/en/dev)
- Tags: [Converters](https://qilingtools.com/en/tags/convert), [Developer](https://qilingtools.com/en/tags/dev), [Network & HTTP](https://qilingtools.com/en/tags/network)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

Right-click a request in your browser’s DevTools and choose Copy as cURL, or grab a curl example from API docs, then paste it here to get runnable code. The parser follows shell rules for single quotes, double quotes, $'...' escape strings, backslash line continuations and even the ^ continuations of Windows cmd. It understands -X, -H, -d / --data / --data-raw / --data-binary / --data-urlencode, --json, -F file uploads, -u basic auth, -b cookies, -A user agent, -e referer, -G, -I, -L, -k, --compressed, --max-time, -x proxy and more, and infers the method and Content-Type the way curl does — -d implies a form-encoded POST, while -G moves the data into the query string. Code is generated for JavaScript fetch, axios, Node.js http(s), Python requests, Go net/http, PHP cURL and Java 11 HttpClient; JSON bodies become native object literals and file uploads become FormData or multipart code. The parsed request panel lists the method, URL, query parameters, headers, auth, body and any ignored options, which also makes it a handy way to read a complicated curl command.

## How to use

1. Copy a request as cURL from DevTools, or copy a curl command from API docs
2. Paste it into the input and pick a target language
3. Copy the generated code and check the parsed request on the right

## Features

- Handles single and double quotes, $'...', backslash and ^ continuations
- Understands -X -H -d --data-raw --data-urlencode --json -F -u -b -A -e and more
- Infers method and Content-Type like curl; -G builds the query string
- Generates fetch, axios, Node.js, Python, Go, PHP and Java code
- JSON bodies converted to native object literals
- File uploads as FormData / multipart code
- Parsed request overview; nothing is uploaded

## FAQ

### How do I copy a request as curl from my browser?

Open DevTools (F12), switch to the Network panel, trigger the request, then right-click it and choose Copy → Copy as cURL (bash). On Windows prefer the bash variant; the cmd variant’s ^ continuations are handled too, but cmd escaping is intricate, so double-check unusual characters.

### Why is it a POST even though the command has no -X POST?

That is how curl behaves: any -d / --data option or -F form field makes curl send a POST, -I sends HEAD, -T uploads with PUT, and -G turns the -d data into query parameters on a GET. The converter follows the same rules, and an explicit -X always wins.

### Which curl options are not supported?

Options that do not affect the request itself, such as -s, -v, -o or --http2, are ignored without changing the code, and uncommon options are listed under Ignored options. Bodies read from files (-d @file) and -F file uploads generate file-reading code with the path for you to adjust. Browser fetch cannot skip TLS verification, so -k is noted in a comment.

### Are the tokens and cookies in my command safe?

Yes. Parsing and code generation happen entirely in your browser; no request is sent and the command is never uploaded. Commands copied from a browser often contain session cookies and tokens, though, so remove them before sharing the generated code.

## Related tools

- [JSON Formatter](https://qilingtools.com/en/json): Free online JSON formatter: beautify or minify, validate with the exact line and column of any error, browse a collapsible tree, sort keys and escape strings.
- [Base64 Encode/Decode](https://qilingtools.com/en/base64): Free online Base64 encoder and decoder: UTF-8 safe, optional URL-safe variant, convert text to Base64 and back in real time. Processed locally, never uploaded.
- [URL Encode/Decode](https://qilingtools.com/en/url-encode): Free online URL encoder and decoder with encodeURIComponent and encodeURI modes. Escapes Chinese, spaces and special characters. Real-time and local, no upload.
- [JWT Decoder](https://qilingtools.com/en/jwt): Free online JWT decoder: decode the header and payload of a JSON Web Token, show expiry and issued-at times, all locally without uploading the token.
- [Timestamp Converter](https://qilingtools.com/en/timestamp): Free online Unix timestamp converter: convert timestamps and dates, auto-detect seconds or milliseconds, and show local, UTC, ISO 8601 and relative time.
- [Hash / Checksum](https://qilingtools.com/en/hash): Free online hash calculator: SHA-1, SHA-256, SHA-384 and SHA-512 of text or any file through the browser crypto API. Files never leave your device.
- [UUID Generator](https://qilingtools.com/en/uuid): Free online UUID generator: create RFC 4122 UUID v4 in bulk with a cryptographic RNG. Options for uppercase, no hyphens and braces, with one-click copy.
- [Base Converter](https://qilingtools.com/en/base-convert): Free online number base converter: convert between binary, octal, decimal, hexadecimal and any base 2–36. Uses BigInt for huge integers, computed locally.
