Skip to content
Docs navigationBrowse tools →

Tool docs

cURL Converter

Convert curl commands into Python, JavaScript, TypeScript, Go, PHP, Ruby, Java, and Rust code, or turn a fetch/axios/requests snippet back into curl. This guide covers what the converter handles, common gotchas, and how the parser works under the hood.

Tool

Overview

01

cURL Converter

The cURL Converter parses a curl command into a neutral request model — method, URL, headers, body, auth, and flags — then generates idiomatic code for each target language. It also works in reverse: paste a fetch(), axios(), or requests.*() call and get back an equivalent curl command. Everything runs in your browser; nothing is sent to a server.

Guide

Common usage patterns

01

Converting curl commands and reproducing requests

  • Paste a curl command — including one copied straight from your browser's DevTools "Copy as cURL" — to generate Python, JavaScript, TypeScript, Go, PHP, Ruby, Java, or Rust code.
  • Switch between library variants (requests/httpx, fetch/axios, curl/Guzzle) once a language is selected.
  • Use reverse mode to turn a fetch, axios, or requests snippet back into a curl command you can run in a terminal or share with a teammate.
  • Check the warnings panel for anything the converter had to skip, like -c/--cookie-jar or an unrecognized flag.

Guide

Edge cases & common pitfalls

01

Multipart uploads, JSON bodies, and dynamic values

  • -F/--form file uploads (name=@path) become CURLFile/os.Open/File objects in the generated code — update the file path to match your local file, the tool can't read your filesystem.
  • When a body's Content-Type is application/json and the body itself is valid JSON, the Python emitters use json=... instead of a raw string; changing the Content-Type header changes that behavior.
  • Reverse mode only resolves literal values. Variables, template-literal interpolation, and computed expressions are flagged as warnings and left as placeholders instead of guessed at.
  • --insecure has no browser equivalent for fetch or axios in the browser — the generated code includes a comment noting TLS verification wasn't disabled.

Internals

How it works internally

01

A hand-written parser, not a shell or a WASM runtime

The converter tokenizes the curl command the way a shell would — respecting single/double quotes and the '\' escape pattern DevTools emits — then walks the arguments into a small request model. Each language has its own code generator (emitter) that reads that model, so adding a new target language only means adding a new emitter, not touching the parser. Reverse mode uses a lightweight bracket-aware scanner to pull literal values out of JS/Python call arguments — it's a heuristic, not a full JavaScript or Python parser.