cURL to JavaScript Fetch Converter.
Convert cURL commands to JavaScript fetch() code. Paste from DevTools or Postman and get runnable code.
- Data & API
- Runs in your browser
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.
- 01
Copy a cURL command (e.g. from Chrome DevTools → Network → right‑click request → Copy as cURL).
- 02
Paste it into the cURL input box and click Convert to Fetch.
- 03
Review the generated JavaScript fetch() code.
- 04
Copy the code and paste it into your project or run it in the browser console.
Features
Key Features.
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.
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.
CSV Operations
Manipulate and process CSV data
CSV Schema Validator
Validate CSV files against schemas
CSV to SQL Converter
Generate SQL INSERT statements from CSV in the browser; nothing stored on servers
Excel to SQL Converter
Convert XLSX/XLS sheets to SQL INSERT statements locally in the browser
ZIP Text Extractor
Browse a ZIP in the browser and preview UTF-8 text files (.sql, code, etc.)
GZIP Text Tool
Compress text to .gz or decompress gzip to UTF-8 text—fully client-side
Stream Decompressor
Decompress gzip or deflate streams to UTF-8 text in the browser
NDJSON to SQL Converter
Turn JSON Lines (one object per line) into SQL INSERT batches locally
Built by Infyways
Need more than a tool.
These utilities are made by the Infyways studio. When a free tool is not enough, we build the real thing.