Skip to main content
Direct WebTools

cURL to Code Converter Online Free

Convert cURL commands to C# HttpClient, JavaScript fetch, axios, Python requests, Go and PHP code online, right in your browser with nothing sent to a server.

100% local processing — the cURL command (including any credentials) is converted entirely in your browser and never sent to a server.

Supported: -H/--header <Name: value>, -X/--request, -d/--data/--data-raw/--data-binary, --data-urlencode, -F/--form, --form-string, -u/--user, --url, -G/--get, -I/--head, -A/-e/-b. Ignored: -s -k -v -L -i --compressed --max-time 30 -o /dev/null and similar transport flags.

Target language
Generated code
characters

Examples

Click an example to fill the input and convert it. The result column shows the code actually generated for the default target language (C#).

Input Result
curl https://api.example.com/v1/users using System.Text; var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.example.com/v1/users"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
curl -X POST -H "Content-Type: application/json" -d "{\"name\":\"Ana\",\"age\":30}" https://api.example.com/v1/users using System.Text; var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.example.com/v1/users") { Content = new StringContent("{\"name\":\"Ana\",\"age\":30}", Encoding.UTF8, "application/json"), }; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
curl -H "Accept: application/json" -H "Authorization: Bearer token123" https://api.example.com/v1/secure using System.Text; var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.example.com/v1/secure"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer token123"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
curl -F name=Ana -F [email protected] https://api.example.com/upload using System.Text; var client = new HttpClient(); var form = new MultipartFormDataContent(); form.Add(new StringContent("Ana"), "name"); form.Add(new FormFileContent([]), "photo", "photo.png"); // upload placeholder var request = new HttpRequestMessage(HttpMethod.Post, "https://api.example.com/upload") { Content = form }; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
curl -G -d page=2 -d limit=50 https://api.example.com/v1/users using System.Text; var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.example.com/v1/users?page=2&limit=50"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);

Frequently asked questions

Is my cURL command sent to a server?

No. Parsing and code generation happen entirely in your browser — the command, including any credentials, never leaves the page.

Which cURL flags are supported?

The request flags -H, -X, -d (also --data-raw, --data-binary and --data-urlencode), -F, --form-string, -u, --url, -G, -I, -A, -e and -b. Transport flags such as -s, -k, -L, --compressed and --max-time are ignored.

Which target languages are available?

C# (HttpClient), JavaScript fetch, axios, Python (requests), Go (net/http) and PHP (cURL). Switch with the tabs above the output.