Skip to content

HAR to curl converter

Turn every request in an exported HAR file into a runnable curl command.

Input
Output

HAR to curl converter

Export a HAR file from your browser's DevTools network panel and this tool turns every request inside it into a curl command you can paste straight into a terminal. It's built for reproducing a bug outside the browser, sharing a request with a teammate, or scripting a call you first captured by clicking around a site.

Filter the requests before converting: narrow by domain to isolate one API, by method to pull out only the POSTs, or by content type to grab just the JSON exchanges. Browser noise — User-Agent, Accept, Sec-Fetch-* and similar headers — is stripped by default since it rarely matters for replaying a call, and one checkbox brings it back. Cookies are excluded by default too, since a captured session cookie is usually stale by the time you use the command; auth headers have their own toggle. Bodies attach with --data-raw so JSON with embedded quotes survives untouched, or switch to --data for curl's own escaping. Add --compressed or --location when the target expects gzip or follows redirects, and wrap long commands across multiple lines for readability.

Prefer something other than curl? The same filtered requests can come out as JavaScript fetch() calls for a script or browser console, or as HTTPie commands for its friendlier header:value syntax. A HAR file with dozens of entries produces one command block per matching request, separated by a blank line, so you can copy the whole batch or pick out the one you need.

Everything happens in your browser — the HAR file, which can hold full request and response bodies, cookies and auth tokens, is never uploaded anywhere. Copy the result, download it as a .txt file, or send it to another tool to keep working.

FAQ

What is a HAR file?
HAR (HTTP Archive) is the JSON format browsers use to export network activity — in Chrome or Firefox DevTools, open the Network tab, right-click a request (or select all) and choose "Save all as HAR".
Why are cookies and browser headers left out by default?
A captured session cookie is usually expired or sensitive by the time you reuse the command, and headers like User-Agent or Sec-Fetch-* rarely affect whether the request succeeds. Turn either back on with the matching option.
Does it handle requests with no body, like GET requests?
Yes. Requests without a postData block generate a plain curl command with no --data flag, and GET doesn't get an unnecessary -X GET.
Can I generate something other than a curl command?
Yes. Switch the output format to fetch() for a JavaScript snippet or HTTPie for its httpname:value header syntax, using the same filters and header rules.
Is my HAR file uploaded anywhere?
No. The file is parsed and converted entirely in your browser — including any bodies, cookies or tokens it contains — and never leaves your device.