cURL converter · JavaScript

cURL to JavaScript

Paste a curl command and get browser-ready JavaScript. Switch between fetch (zero deps), axios (batteries included), and ky (fetch with saner defaults).

InputcURL command
1 secret
MethodPOST·Headers2·Body46 B· Chars 187
OutputJavaScript · fetch(browser/Node)
const response = await fetch("https://api.example.com/v1/messages", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk_test_123",
    "Content-Type": "application/json"
  },
  body: "{\"to\":\"+15551234567\",\"body\":\"Hello from curl\"}",
  redirect: "manual"
});
const data = await response.json();
Inspect

Top guides for JavaScript

All guides →

Common questions

Which one should I pick?
fetch for anything modern with no dependencies. axios if you're already on it or need interceptors. ky for a small, ergonomic wrapper over fetch.
Does the output work in the browser and Node?
Yes. fetch works natively in browsers and Node 18+. axios and ky both work in either after installing.
How is -F multipart handled?
It compiles to a FormData instance with each field appended; file uploads become Blob placeholders you can swap for a real File.
Is my curl sent anywhere?
No. Everything runs client-side.

Also convert cURL to

All guides →

Same parser, same idiomatic output — swap the target language whenever your stack changes. Every hub carries its own reference guides for methods, payloads, and auth.