cURL to JavaScript Fetch Converter.

Convert cURL commands to JavaScript fetch() code. Paste from DevTools or Postman and get runnable code.

cURL command

Paste a cURL command (e.g. from DevTools or Postman)

Try an example

Click to load a sample cURL command

How it works

Four steps.

  1. 01

    Copy a cURL command (e.g. from Chrome DevTools → Network → right‑click request → Copy as cURL).

  2. 02

    Paste it into the cURL input box and click Convert to Fetch.

  3. 03

    Review the generated JavaScript fetch() code.

  4. 04

    Copy the code and paste it into your project or run it in the browser console.

Features

Key Features.

Turn any cURL command into clean fetch() code for browser or Node.js.
  • Paste any cURL

    Paste cURL from browser DevTools, Postman, or the command line. GET, POST, headers, and JSON body supported.

  • JavaScript fetch()

    Get clean, runnable fetch() code for browser or Node.js. Headers, method, and body are preserved.

  • One-click convert

    Convert in one click. Copy the result into your project or run it in the console.

  • Copy to clipboard

    Copy the generated fetch code with one click for quick use in your app.

  • Basic auth support

    cURL -u user:pass is converted to fetch() with an Authorization: Basic header.

  • API and DevTools friendly

    Ideal for converting network requests from Chrome DevTools or API docs into fetch code.

FAQ

Questions.

Can't find an answer? Send us your question.

Where can I get a cURL command?

In Chrome or Edge: open DevTools (F12) → Network tab → perform the request → right‑click the request → Copy → Copy as cURL. In Firefox: same steps, then Copy as cURL. Postman and other API tools also offer “Copy as cURL”.

Does it support all cURL options?

It supports the most common options: -X / --request , -H / --header , -d / --data , -u / --user (Basic auth), -G / --get , and --url . Options like -k (insecure) or --compressed are not reflected in the fetch output.

Can I use the output in Node.js?

Yes. In Node.js 18+ the native fetch is available. For older Node, use a polyfill (e.g. node-fetch ) or run the code in the browser.

Why does my cURL not convert?

Ensure the command starts with curl and includes a valid URL (e.g. https://... ). Multi-line cURL is supported. If it still fails, simplify the command to the minimal form (e.g. curl 'https://api.example.com' ) and add options back one by one.

Related tools

More Data & API tools.