cURL Converter

Convert a cURL command to code — Python, JavaScript, Java, PHP, Go, Ruby and C#

Paste a cURL command and get the same request as code — Python, JavaScript, Java, PHP, Go, Ruby or C#. It runs in the browser, so tokens and cookies never leave your machine. Handy for turning a request copied from DevTools into a working script.

cURL command
Language
Generated code
Paste a cURL command above — the code appears here…

How to use

  1. 1Paste a cURL commandUse "Copy as cURL" in DevTools (Chrome/Firefox) — both the bash and Windows cmd styles work.
  2. 2Pick a language and clientPython, JS, Java, PHP, Go, Ruby or C#. JS and Java let you pick the client: fetch/axios, HttpClient/OkHttp/Apache.
  3. 3Copy the codeImports, headers and body are already in place — drop it into your project.

Examples

cURL → Python requests
curl 'https://api.example.com' → requests.get(...)
A ready-to-run requests script for your scraper from a copied request.
cURL → Node.js fetch
curl ... → fetch(url, options)
A fetch call that runs in Node 18+ or the browser.
cURL → Java HttpClient
curl ... → HttpRequest.newBuilder()
A zero-dependency java.net.http snippet (Java 11+), or switch to OkHttp / Apache.
POST with a JSON body
-X POST --data-raw '{...}' → body publisher
Headers and the JSON body carry over into the code on every language.
Request with auth headers
-H 'Authorization: Bearer …' → headers map
Every header — Cookie, Authorization, User-Agent — is kept as-is.

When to use for web scraping

You have a working request as cURL — from DevTools, Postman, or an API doc — and you need it as code. Instead of hand-translating the URL, method, headers and body, paste the command and copy the snippet. It's most useful for scraping: right-click a request in DevTools → Copy as cURL, convert it to Python or Node, and you start from the exact headers and cookies the server expects. Everything is computed locally, so requests with tokens or cookies stay on your machine.

FAQ

How do I convert a cURL command to Python?
Paste the command and pick Python — you get a ready-to-run requests snippet with the URL, method, headers and body filled in.
Which Java HTTP client does it support?
Three: the built-in java.net.http.HttpClient (Java 11+, no dependencies), OkHttp, and Apache HttpClient 5. Pick the one your project uses from the Client list.
Can I convert cURL to Node.js?
Yes — pick JavaScript, then fetch (Node 18+ and the browser) or axios. The headers and request body are included.
Does the conversion happen on a server?
No. Parsing and code generation run entirely in the browser, so a cURL command with tokens or cookies never leaves your machine.
Does it accept cURL copied from Windows cmd?
Yes — both DevTools styles: Copy as cURL (bash) and Copy as cURL (cmd), the Windows caret-escaped format.

Related tools