← Developer Tools
🔄

cURL Converter — 9 Languages, Instant Output

cURL → fetch · axios · Python · Go · PHP · Ruby · HTTPie · Postman

💡

Paste any cURL command and instantly get equivalent code in 9 languages: JS fetch(), axios, Python requests, Node.js request, PHP curl_exec, Go net/http, Ruby Net::HTTP, HTTPie CLI, and Postman collection JSON. Auto-detects method, headers, body type (JSON/form/raw), and auth (Bearer/Basic). 10 built-in sample cURLs. Toggle pretty print. Share URL with encoded cURL.

cURL COMMAND
POST https://api.example.com/users
Body:json · 42 chars
Headers:1 set
OUTPUTS
Pretty print
CONVERTED CODE 6 languages
🌐JS Fetch
const response = await fetch('https://api.example.com/users', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "name": "John",
    "email": "john@example.com"
  })
});

const data = await response.json();
console.log(data);
Axios
const { data } = await axios({
  url: 'https://api.example.com/users',
  method: 'post',
  headers: {
    'Content-Type': 'application/json'
  },
  data: {
    "name": "John",
    "email": "john@example.com"
  }
});

console.log(data);
🐍Python requests
import requests

headers = {
    'Content-Type': 'application/json',
}

payload = {
        "name": "John",
        "email": "john@example.com"
    }

response = requests.post('https://api.example.com/users', headers=headers, json=payload)
print(response.json())
🟢Node request
const request = require('request');

request({
  url: 'https://api.example.com/users',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: '{"name":"John","email":"john@example.com"}'
}, (error, response, body) => {
  if (error) throw new Error(error);
  console.log(body);
});
🐘PHP cURL
<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://api.example.com/users');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"name":"John","email":"john@example.com"}');

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
🐹Go net/http
package main

import (
    "fmt"
    "io"
    "net/http"
    "strings"
)

func main() {
    payload := strings.NewReader(`{"name":"John","email":"john@example.com"}`)

    req, _ := http.NewRequest("POST", "https://api.example.com/users", payload)
    req.Header.Add("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()
    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}

Frequently Asked Questions

What cURL flags are supported?

Supports -X (method), -H (headers), -d/--data/--data-raw (body), -u/--user (basic auth), -F/--form (multipart), --compressed, -s (silent). Bearer token detection from Authorization header.

How do I get a cURL from browser DevTools?

In Chrome: DevTools → Network tab → right-click any request → Copy → Copy as cURL. Paste directly here. Works with all headers including cookies and auth tokens.

Does it support multiline cURL?

Yes — cURL commands with line continuation backslashes (\) across multiple lines are normalized and parsed correctly.

Is my API key safe?

Yes — all conversion runs in your browser. Nothing is sent to any server. Works completely offline once loaded.

How do I import the Postman JSON output?

Enable "Postman JSON" in the language toggles. Copy the output. In Postman: File → Import → Raw text → paste → Import. Your request is created as a collection item.