cURL to HAR Converter
Convert curl commands to HAR code using HAR 1.2. Paste a command and the HAR snippet appears instantly — everything runs in your browser.
- Instant ConversionCode updates as you type
- Multiple Languages40 languages, 61 libraries
- 100% Client SideYour data stays private
How to use this tool
Steps for using the cURL to Code.
- Copy a curl command — from API documentation, or from your browser's DevTools (Network tab → right-click a request → Copy as cURL (bash)).
- Paste it into Enter cURL command. The HAR 1.2 code appears instantly.
- Set up: No setup — the output is a JSON file.
- Run it: Save it as
request.harand import it into tools that read HAR files, such as browser DevTools or API clients. Replace placeholders such asYOUR_TOKENfirst, and check any notes under the editors for curl options that have no HAR 1.2 equivalent.
Example
GET with headers → HAR 1.2
curl 'https://api.example.com/v1/users?page=2' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN'{
"log": {
"version": "1.2",
"creator": {
"name": "curl-to-code",
"version": "1.0"
},
"entries": [
{
"request": {
"method": "GET",
"url": "https://api.example.com/v1/users?page=2",
"httpVersion": "HTTP/1.1",
"cookies": [],
"headers": [
{
"name": "Accept",
"value": "application/json"
},
{
"name": "Authorization",
"value": "Bearer YOUR_TOKEN"
}
],
"queryString": [
{
"name": "page",
"value": "2"
}
],
"headersSize": -1,
"bodySize": 0
}
}
]
}
}Common use cases
- Sharing a request with a teammate or support
- Importing a request into an API client
- Documenting API calls
Converting curl to HAR 1.2
HAR (HTTP Archive 1.2) is a JSON format for recording HTTP requests. The output describes the request — URL, method, headers, query and body — in that format.
The converter reads the curl command the way curl does — the method (-X), headers (-H), request bodies (-d, --data-raw, --json, -F), query strings, basic auth (-u) and cookies — and writes the equivalent HAR 1.2 code. Options that have no HAR 1.2 equivalent are listed under the editors rather than silently dropped.
Limitations
- Only the request is described — there is no response in the HAR.
- The code is a starting point: add timeouts, retries and error handling for production use.
- Secrets in the curl command are copied into the code — move them to environment variables before committing.
Frequently asked questions
What can open a HAR file?
Browser DevTools (Network panel) and many API clients and proxies can import HAR files.
Does the HAR include a response?
No. It's built from the curl command, so only the request is recorded.
Is my curl command sent to a server?
No. The conversion runs entirely in your browser, so tokens and passwords in the command never leave your device. Still, replace real secrets before sharing the generated code.