Back to Tools

Curl Converter

My tools
No tools yet

Loading...

Convert curl commands to Python, Go, Java, and more online

  1. 1

    Paste the curl command

    Copy a command from your terminal or DevTools "Copy as cURL" and paste it — multi-line continuations are fine. Or click the example button to see it in action.

  2. 2

    Pick a target language

    Choose Python, Go, Java, PHP, C++, or JavaScript; the code regenerates instantly, and invalid commands report which flag is at fault.

  3. 3

    Copy or run it

    Copy the code into your project, or for Python, Go, and Java click "open in runner" to load it into the built-in runner and verify it on the spot.

Features Overview

Convert curl commands (including browser DevTools "Copy as cURL") into Python requests, Go, Java, PHP, C++, and JavaScript fetch code. Supports common flags like -H, -d, --data-raw, --json, -u, and -b, plus multi-line continuation, and sends the generated code straight into the built-in online runners.

Tool Description

Describe what Curl Converter helps you accomplish.

Last updated

Capabilities Checklist

  • Six target languages: Python (requests), Go (net/http), Java (HttpClient), PHP (cURL), C++ (libcurl), and JavaScript (fetch) — switch instantly to compare outputs.
  • Parse with validation: commands are parsed as you paste; errors point to the offending flag, and out-of-scope flags (like -F or -o) are listed instead of silently dropped.
  • Run what you generate: Python, Go, and Java targets open directly in the online runners with the code loaded into the editor.
  • Behavior-faithful output: a request body without Content-Type gets application/x-www-form-urlencoded (matching curl's default), -u becomes an Authorization Basic header, and -G moves data into the query string.
  • Nothing leaves your browser: parsing and generation happen locally, so tokens and cookies in your command are never uploaded.

User feedback

Your feedback will be reviewed (and redacted if needed) before it appears publicly. Please do not include emails, passwords, or other personal information.

Your feedback helps us do better ❤️

Related Tools

Frequently Asked Questions

Which curl syntax does this tool support?
URL, -X/--request (including the -XPOST attached form), -H/--header (including the "name;" removal form), -d/--data/--data-raw/--data-binary/--data-urlencode/--json, -u/--user, -b/--cookie, -A/--user-agent, -e/--referer, -G/--get, -L/--location, -k/--insecure, --compressed, combined short flags like -sSL, backslash line continuation, and single, double, or $'...' quoting. When -d is present without -X, the method is inferred as POST, matching curl.
Why were flags like -F, -o, or -x not converted?
Multipart forms (-F), saving files (-o/-O), proxies (-x), client certificates (--cert), and reading data from files (-d @file) are outside the conversion scope for now. The tool lists these flags in the "not converted" notice; the rest of the generated code stays correct so you can add the missing pieces by hand.
What does the "open in runner" button do differently from copying?
Python, Go, and Java targets have this button: clicking it loads the generated code straight into the matching online runner — no copy-paste needed — so you can tweak and run it immediately. PHP and C++ are copy-only because the browser runtimes lack the cURL extension and libcurl; the generated code is standard for real projects.
Can the generated code make real requests?
The Python runner ships with requests and can send real requests. Outbound networking in the Go and Java runners depends on the sandbox; loading and compiling happen in the browser, and for production use we recommend running the code locally. All output is based on each language's standard HTTP library.
Is there a risk of leaking the tokens or cookies in my command?
No. Parsing and code generation run entirely in your browser; the command is never sent to any server. When sharing results (screenshots, pastes), remember that DevTools-copied commands often contain session credentials.