cURL to Fetch / Axios

Convert cURL commands to JavaScript fetch() or axios code. Supports headers, JSON body, form data, basic auth, and more.

Tools run in your browser. Shared links may include your input; check the URL before sharing.

How to use

  1. Paste a cURL command and choose Fetch or Axios.
  2. Check the method, headers and body before copying the code.

This example illustrates one supported operation. Choose the matching mode and settings above; generated values and formatting may vary.

Example input or settings

curl 'https://api.example.com/users'

Example result

const response = await fetch('https://api.example.com/users');

Why does cURL work when the browser fails?

Browsers enforce cross-origin restrictions and restrict some headers. Check server CORS settings and the console.