HAR to cURL Converter

Turn requests captured in a browser HAR file into runnable cURL commands, with cookies and auth headers strippable.

HAR to cURL runs entirely in your browser. The archive is parsed on your device, so the session cookies a HAR contains never leave it.

Open the HAR File Viewer

About HAR to cURL

HAR to cURL reads the network archive your browser's DevTools exports and turns any request in it into a command you can paste into a terminal. It is the fastest way to close the gap on "it works in the browser but not from my script": every header, the method and the request body come across exactly as the browser sent them. Two details get handled carefully. Shell quoting uses the POSIX escape for a single quote inside single quotes, so a JSON body containing an apostrophe does not silently truncate the command. And because a HAR routinely contains live session cookies, a single toggle strips Cookie and Authorization headers before you paste anything into a bug report.

Features

How to use the HAR to cURL

  1. In DevTools, open the Network panel and choose Save all as HAR with content
  2. Drop the .har file here, or paste its contents
  3. Pick a request from the list, or leave All selected to convert every one
  4. Turn on strip cookies and auth if you plan to share the command, then copy it

Example

Input

POST https://api.example.com/login with a JSON body

Output

curl 'https://api.example.com/login' \
  -H 'Content-Type: application/json' \
  --data-raw '{"user":"jo"}' \
  --compressed

No -X flag is emitted for a POST that carries a body, because --data already implies it.

Common errors & troubleshooting

Frequently asked questions

How do I export a HAR file from my browser?
Open DevTools, go to the Network panel, reproduce the request, then right-click any row and choose Save all as HAR with content. Chrome, Edge, Firefox and Safari all offer some version of this.
Why does the generated cURL command not include -X POST?
Because --data-raw already implies POST, and adding -X on top can change how cURL handles redirects. The method flag is emitted only when it is actually needed, such as for PUT, PATCH or DELETE.
Is it safe to share a cURL command from a HAR file?
Not by default — a HAR captures live session cookies and Authorization headers, which are as good as a password. Turn on the strip option first, which removes Cookie, Authorization and common API-key headers.
Why are some headers left out of the command?
Browser-managed headers like Content-Length, Host and Connection are recalculated by cURL, and HTTP/2 pseudo-headers beginning with a colon are not valid to send manually. Including them causes errors rather than fidelity.
Is my HAR file uploaded when I convert it?
No. The file is parsed entirely in your browser, which matters because a HAR routinely contains session cookies and personal data from every request it captured.

Related tools

All ArrayKit tools