HAR to cURL Converter

Paste a HAR file exported from your browser’s Network panel and get a runnable curl command for every request it contains. The parser walks log.entries[].request, rebuilds the method and URL, replays each header (skipping HTTP/2 pseudo-headers and content-length), folds cookies into a Cookie header, and appends --data when there is a post body. Multiple requests are separated by a comment line so you can pick the one you need. Everything runs in your browser — the HAR never leaves your machine.

How to use the HAR to cURL Converter

In your browser open DevTools, go to the Network tab, reproduce the traffic, then right-click a request (or use the panel menu) and choose Save all as HAR / Export HAR. Open the resulting .har file, copy its JSON, and paste it into the HAR file box here. Press Convert to cURL (it also converts as you type) and a curl command for each captured request appears below, each preceded by a # METHOD URL comment and separated by a blank line. Click Example to load a small two-request HAR sample, then Copy the output. The converter emits curl -X METHOD 'url', one -H 'Name: Value' per header, a single -H 'Cookie: ...' when the request carried cookies, and --data '...' for the post body. It skips pseudo-headers (names starting with a colon, like :authority) and the content-length header, both of which curl sets for you.

What is a HAR file?

HAR — the HTTP Archive format — is a JSON file that records a browser session’s network activity. Every modern browser’s DevTools can export one, and the structure is standardized: a top-level log object holds an entries array, and each entry describes a single request/response pair. The request side that this tool reads exposes method, url, httpVersion, an array of headers (each an object with name and value), a cookies array, query parameters, and an optional postData object whose text field carries the body. Converting that back into curl commands lets you replay, share or script a request you captured live in the browser.

Two quirks of HAR drive the conversion rules. First, captures made over HTTP/2 or HTTP/3 include pseudo-headers whose names begin with a colon — :method, :authority, :scheme, :path. These are protocol framing, not real headers, and passing them to curl produces errors, so the converter drops any header whose name starts with :. Second, it removes content-length because curl recomputes it from the body; replaying a stale length causes truncated or hung requests. Cookies recorded in the dedicated cookies array are reassembled into a single Cookie header so the replay carries the same session.

Going the other direction — from a single shell command to language code — is what the cURL to Python converter and the multi-language cURL converter do. This tool is the capture-to-command path: it turns a whole HAR export into a set of reproducible curl invocations.

Common use cases

  • Reproduce a bug — turn the exact failing request from a HAR into a curl command you can rerun in a terminal.
  • Reverse-engineer an API — see precisely which headers and body a web app sends, as a copy-pasteable command.
  • Share a repro — hand a teammate a runnable curl instead of a 2 MB HAR file.
  • Seed load tests — extract real requests from a session to script against a staging environment.
  • Support tickets — convert a customer-supplied HAR into the specific call that misbehaved.
  • Document integrations — capture a working flow once, then publish the curl commands.

Frequently asked questions

How do I get a HAR file?

Open DevTools → Network, reproduce the traffic, then right-click a request and choose “Save all as HAR” (Chrome/Edge) or use the panel’s export button (Firefox/Safari). Paste the JSON contents here.

Why are some headers like :authority removed?

Those are HTTP/2 pseudo-headers — protocol framing, not real headers. curl rejects them, so any header whose name starts with a colon is skipped, along with content-length, which curl sets itself.

What if the HAR has many requests?

It emits one curl command per entry, each preceded by a # METHOD URL comment and separated by a blank line, so you can scan and copy just the one you want.

Does my HAR get uploaded anywhere?

No. Parsing happens entirely in your browser with JavaScript — nothing is sent to a server. HAR files can contain auth tokens and cookies, so this matters.

Can I turn a curl command into code instead?

Yes — use the cURL to Python converter or the multi-language cURL converter for the reverse direction.