cURL to fetch converter

Browser devtools and API docs both hand you cURL commands, and translating one by hand is where header typos come from. The conversion itself is mechanical, but the shell quoting is not — a header value containing a colon or a body containing an apostrophe will break a naive split.

Tokens are split with quote awareness and line continuations removed first, then flags are walked one at a time so a body argument is never mistaken for the URL. A JSON body is emitted as JSON.stringify with readable indentation.

Runs entirely in this tab. Nothing you paste is uploaded, logged or stored — close the page and it is gone.

Questions about this tool

Which flags are supported?

Method, headers, request bodies, basic auth, cookies, user agent and referer. Flags with no fetch equivalent — output paths, timeouts, proxies — are dropped rather than mistranslated into something that looks equivalent but is not.

Why is the body wrapped in JSON.stringify?

Because a raw object literal in the body position would be a mistake: fetch needs a string or a stream, not an object. Emitting the parsed object inside JSON.stringify keeps it readable and correct.

Does the generated code send anything?

No. It is text in a box. Nothing is executed and nothing leaves the page until you paste it into your own code and run it.

AI alternatives from the directory

Browse coding tools →

This utility handles the job by hand. These do it with a model — worth a look when the task outgrows copy and paste.

Cursor logo
Cursor
Coding
☆

The AI-first code editor

Built on VS Code, Cursor offers codebase-aware chat, multi-file edits and fast autocomplete for real engineering work.

Codeium logo
Codeium
Coding
☆

Free AI autocomplete for every language

A fast, free completion and chat tool that plugs into 40+ editors with strong privacy options.

Claude Code logo
☆

Anthropic's terminal agent that edits whole repos

Claude Code runs in your shell, reads the repository, plans a change and applies multi-file edits with tests.