โ˜ฐ
๐Ÿ› 
DevToolsDesk
cURL to Code Converter

cURL to Code & Code to cURL Converter

  • Paste any cURL request from your terminal.
  • Get client code in languages like JavaScript, Python, and more.
  • Perfect for API docs, SDKs, and onboarding.
Paste or type your input below, then use the buttons to process it.
Example: Convert a cURL request to code.
curl -X GET "https://api.example.com/users"

Convert curl commands into code for JavaScript fetch, Axios, Node.js, Python, Java, C#, PHP, Go, Ruby, Swift, Kotlin, Rust and Dart โ€“ or paste code snippets and generate the equivalent curl. Everything runs securely in your browser.

cURL โ†’ Code

Input cURL Command

Supports common flags: -X, -H, --header, -d, --data, --data-raw. This is a best-effort helper, not a full shell parser.

After conversion, language-specific snippets appear below.

Generated Code

JavaScript fetch

๐Ÿ“‹ Copy
// Result will appear here after converting.

Axios (JS)

๐Ÿ“‹ Copy
// Result will appear here after converting.

Node.js https

๐Ÿ“‹ Copy
// Result will appear here after converting.

Python requests

๐Ÿ“‹ Copy
# Result will appear here after converting.

Java HttpClient

๐Ÿ“‹ Copy
// Result will appear here after converting.

C# HttpClient

๐Ÿ“‹ Copy
// Result will appear here after converting.

PHP cURL

๐Ÿ“‹ Copy
// Result will appear here after converting.

Go net/http

๐Ÿ“‹ Copy
// Result will appear here after converting.

Ruby (Net::HTTP)

๐Ÿ“‹ Copy
# Result will appear here after converting.

Swift (URLSession)

๐Ÿ“‹ Copy
// Result will appear here after converting.

Kotlin (OkHttp)

๐Ÿ“‹ Copy
// Result will appear here after converting.

Rust (reqwest)

๐Ÿ“‹ Copy
// Result will appear here after converting.

Dart (http)

๐Ÿ“‹ Copy
// Result will appear here after converting.

Code โ†’ cURL

Paste a simple HTTP snippet (fetch, Axios, Python requests, Java HttpClient, C# HttpClient, PHP cURL, Go net/http) and this tool will try to infer the equivalent curl command. This is a best-effort converter and works best with small, self-contained examples.

Input Code Snippet

Generated cURL

# Result will appear here after converting.