cURL Converter
About this tool
About cURL Converter
API docs and browser DevTools hand you cURL commands; your app needs code. Paste a command here and get the same request as JavaScript fetch, Node.js, Axios, Python requests, Go net/http, PHP's cURL extension or HTTPie. The parser reads commands the way a shell does: single and double quotes, $'…' strings, backslash line breaks, and the ^ escapes in Windows cmd commands that Chrome's Copy as cURL (cmd) produces. It understands the options people actually use: -X, -H, -d and --data-raw (several -d are joined with &), --data-urlencode, --json, -F file uploads, -u basic auth, -b cookies, -A, -e, -G, -I, -L, -k and --compressed. JSON bodies become native objects and dictionaries rather than escaped strings, and multipart uploads use each client's own form-data API. Anything that can't be carried over, such as a proxy, a timeout or a body read from a file, is listed in a warning instead of being dropped silently. Conversion happens in your browser, so tokens and cookies in the command never leave your device. Optionally, the AI button writes a cURL command from a plain-English description using your own AI key; only that description is sent, never the command you pasted.
Built and maintained by Abhi JainUpdated
How to Convert a cURL Command to Code
- 1
Paste the command
Paste a cURL command into the cURL command pane, for example from DevTools: right-click a request, Copy, Copy as cURL. Or click Sample.
- 2
Pick a language
Choose fetch, Node.js, Axios, Python, Go, PHP, HTTPie or cURL under Convert to. Tick Follow redirects if you want the code to follow them.
- 3
Check warnings and copy
Read any warnings about options that were not converted, then copy the code or download it as a file.
cURL Converter: questions and answers
How do I copy a request as cURL from Chrome or Firefox?
Open DevTools, go to the Network tab, right-click the request and choose Copy, then Copy as cURL. On Windows pick the bash version if offered; the cmd version also works here because its ^ escapes are understood.
Why does my converted request not follow redirects?
curl does not follow redirects unless you pass -L, so the Python, Axios and Go code keeps that behaviour. Tick Follow redirects, or add -L to the command, to follow them. Browser fetch always follows redirects.
What happens to -d @file or -F file=@photo.jpg?
File uploads with -F become multipart code that opens the file from disk (or uses a file input in browser fetch). A body read with -d @file can't be inlined, so the code leaves a clear placeholder and a warning tells you to load the file.
Does -u become an Authorization header?
Yes. -u user:password is Basic authentication: the credentials are base64-encoded into an Authorization: Basic header. Each language uses its native option where it has one, such as auth= in Python requests or SetBasicAuth in Go.
Is the command sent anywhere?
No. Parsing and code generation run entirely in your browser, and this page never executes the request.
Can AI help me write a cURL command?
Yes, optionally. Click AI, describe the request in plain words, and you get a cURL command that is checked by the same parser before you use it. Only your description is sent, never the command you pasted. It uses the AI provider and key you connect in AI settings (Claude, OpenAI, Gemini, DeepSeek, OpenRouter or a compatible endpoint), and the request goes straight from your browser to that provider; KissThePDF has no server in between. The converter itself works without AI.
Related Tools
- HTTP Request Code GeneratorBuild a request in a form and get cURL, fetch, Axios, HTTPie, Python, Go or PHP code.
- JSON FormatterBeautify, minify and validate JSON with exact error locations, without changing a single value.
- URL ParserSplit a URL into protocol, host, port, path, query and fragment; edit any part and rebuild it.
- HTTP Headers ReferenceSearchable reference of HTTP request and response headers with examples.
- HTTP Status CodesSearchable list of HTTP status codes with meanings, when to use them and retry advice.