cURL to Code Converter
Runs locallyConvert cURL commands to fetch, Axios, Python, Go, Kotlin, Swift, Rust, C# and back.
What is cURL to Code Converter?
Parse multi-line cURL commands (`-X`, `-H`, `-d`, `--data-raw`, `--data-urlencode`, `-F`, `-u`, `-b`, `-L`, `-k`, `--compressed`) and convert them into clean idiomatic code for fetch, Axios, Node undici, Python requests/httpx, Go, Kotlin, Swift, Java, Dart, Rust, C#, PHP, PowerShell, and HTTPie.
How to use cURL to Code Converter
- Step 1
Paste a cURL command (including multi-line backslash continuations) into the editor.
- Step 2
Choose your target language and HTTP client library.
- Step 3
Check any flag compatibility warnings in the Problems panel.
- Step 4
Copy or download the generated code, or open the parsed request in API Playground.
Features
- Supports 15+ targets: fetch, Axios, XHR, Node undici, Python requests/httpx, Go, Kotlin OkHttp/Ktor, Swift URLSession, Java, Dart, Rust reqwest, C#, PHP, PowerShell
- Parses -H, -d, --data-raw, --data-urlencode, -F multipart, -u basic auth, -b cookies, -X, -L, -k, --compressed
- Handles multi-line shell continuations and single/double/ANSI-C quoting
- Warns on unsupported flags instead of silently dropping them
- Reverse builder mode to generate cURL from structured inputs
Example
Input
curl -X POST "https://api.example.com/v1/items" -H "Authorization: Bearer tok_123" -H "Content-Type: application/json" -d '{"name":"widget"}'Output
const res = await fetch("https://api.example.com/v1/items", {
method: "POST",
headers: {
"Authorization": "Bearer tok_123",
"Content-Type": "application/json"
},
body: JSON.stringify({ name: "widget" })
});Extracts method, headers, and JSON body into a clean browser fetch() call.
Frequently asked questions
Does it support Chrome DevTools "Copy as cURL"?
Yes, multi-line bash cURL commands copied from Chrome or Firefox DevTools parse cleanly.
Are my API keys in cURL commands uploaded?
No. Parsing and code generation run locally in your browser.
What happens if a cURL flag is not supported by the target client?
The Problems panel lists a warning so you know which flags need manual handling.
Can I build a cURL command from scratch too?
Yes, switch to the Builder tab to compose a request and export cURL.
Related tools
API Playground
Send HTTP requests with headers, body, auth, environment variables, collections and cURL import.
JWT Decoder & Verifier
Decode, verify HS/RS/ES/EdDSA signatures, sign test tokens and inspect expiry claims locally.
JSON Formatter & Validator
Format, validate, minify, repair, sort keys and query JSON with Tree and Table views.