cURL to Code Converter
Paste a curl command copied from your browser's DevTools or an API's docs to get equivalent JavaScript (fetch) or Python (requests) code.
Covers the common curl flags: -X, -H, -d/--data, -u, -A, -b. Less common flags (like -F for multipart forms) are skipped rather than mis-translated.
Frequently asked questions
Where do I usually get a curl command to paste in here?+
Browser DevTools: right-click any request in the Network tab and choose "Copy as cURL." Many API docs also show example requests as curl commands directly.
Which curl flags does this understand?+
The common ones: -X/--request, -H/--header, -d/--data (and its variants), -u/--user, -A/--user-agent, and -b/--cookie. Less common flags like -F for multipart file uploads are skipped rather than mistranslated.
Does it handle multi-line commands with backslash continuations?+
Yes, a curl command copied with line breaks and trailing backslashes parses the same as if it were on one line.