Developer Tools

cURL to JavaScript Fetch Converter

Convert cURL commands into JavaScript fetch code. Parses -X, -H, and --data-raw into method, headers, and body, with optional async/await wrapping.

cURLHTTPDeveloper

Favorite this tool

No favorite storage mode has been selected.

Quick actions

Copy this tool URL or open the system share sheet on a supported device.

Use cases

  • Rewrite DevTools Copy as cURL requests as frontend code
  • Replay captured requests in Node.js scripts
  • Add executable fetch examples to API docs

How to use

  1. Paste a cURL command from browser DevTools
  2. Toggle async/await wrapping if needed
  3. Copy the generated fetch code

Example input and output

cURL

curl a.com -H "A: 1"

Fetch

fetch("a.com", { headers: { "A": "1" } })

FAQ

Is --data-raw supported?

Yes. --data and --data-raw become the request body and may set POST automatically.

Are cookies and auth headers kept?

Headers from -H are preserved; scrub secrets before sharing generated code.

Tools

Related tools

Continue with another translated tool for a nearby task.

URL Builder

URL Builder — Assemble and Parse Query Parameters

Available

Build URLs from protocol, host, port, path, hash, and query parameters with automatic value escaping, or parse a full URL back into fields. Handy for API debugging and campaign link setup. Processing stays in the browser.

URL Query Builder

JSON to TypeScript Interface

JSON to TypeScript Interface Generator

Available

Infer TypeScript interface definitions from JSON in your browser. Nested objects become separate interfaces, with options for the root name, optional fields, readonly, export, and type aliases.

TypeScript JSON Developer