cURL to Code
Turn a curl command into JavaScript, Python, Go or PHP code.
100% private — everything runs in your browser
How to Use
- 1
Copy a curl command from your terminal or API docs.
- 2
Choose the language you want to target.
- 3
Convert, then copy the generated code.
Examples
JSON POST
Input
curl -X POST https://api.example.com/users -H 'Content-Type: application/json' -d '{"name":"Ada"}'Output
fetch code with method POST, the JSON header and the body.Basic auth
Input
curl -u user:pass https://api.example.com/meOutput
Code that sends an Authorization: Basic header, or the native auth option of the language.FAQ
Which flags are supported?
Headers, data, GET query mode, basic auth, follow-redirect and insecure flags, plus method overrides.
Why are -F and --upload-file rejected?
Multipart and file uploads need extra runtime code. The tool refuses rather than emit code that silently behaves differently.
Does it follow redirects by default?
It mirrors curl: redirects are followed only when -L or --location is present.
Related Tools
JSON to Go StructGenerate Go structs with JSON tags from a JSON sample.JSON to Python ModelGenerate Python dataclasses or Pydantic models from a JSON sample.URL Encoder / DecoderEncode text for URLs with encodeURIComponent or encodeURI, and decode percent-encoded strings.JSON FormatterFormat, beautify, minify and validate JSON instantly — right in your browser.JSON ValidatorValidate JSON instantly and find syntax errors with the exact line, column and position — right in your browser.Base64 Encoder/DecoderEncode text to Base64 and decode Base64 back to text with full Unicode and emoji support — 100% in your browser.