ToolConvoyToolConvoyv2.6
DEV

HAR to cURL — Convert HAR Files to cURL, fetch, Python, or Go Code

Convert HAR (HTTP Archive) files to cURL commands or to fetch, Python, Go, or Node.js code. Runs entirely in your browser. No uploads, no limits.

● LOCAL · GENERATED IN YOUR TAB0 network requests since page load
DEV

HAR to cURL / fetch / Python / Go / Node

Convert HAR (HTTP Archive) files to runnable code in 5 languages. 100% local — your traffic never leaves the browser.

● LOCAL · GENERATED IN YOUR TAB0 network requests since page load
Loading…

HAR (HTTP Archive) is the standard format for capturing HTTP traffic from a browser. Every browser since 2012 can export a HAR file from the Network tab, and the format is well-documented JSON that records every request the page made: method, URL, headers, cookies, query parameters, request body, response status, response headers, response body, and timing. The use case is debugging — when an API call fails in production but works in development, or when a third-party API behaves differently in your test environment than the docs say it should, exporting a HAR and inspecting the actual HTTP traffic is the fastest way to find the discrepancy. The tool here turns that HAR into runnable code in five languages, so the captured request can be replayed in a controlled environment.

The non-obvious thing about HAR files is what they expose. A HAR captures every header, every cookie, every Authorization token that was sent during the recording. If you recorded a HAR while logged into a banking site, a social network, or an internal admin tool, the HAR contains your session credentials. Sharing a HAR publicly is equivalent to sharing your logged-in session. The tool’s request detail panel lets you edit headers before conversion — the right pick for a HAR you need to share is to redact the Authorization, Cookie, and any custom auth headers before exporting the converted code. The same advice applies to sharing the HAR file itself.

For a final hand-off: if the goal is replaying a single request to reproduce a bug, pick that request in the list, choose cURL, and run the output in a terminal. If the goal is writing a test fixture, pick fetch or Python and paste the output into your test file with the right assertions. If the goal is understanding a multi-step flow (login, fetch user data, log out), select all the requests and convert them as a sequence — the output preserves the order so you can replay the flow step by step. The tool here gives you runnable code in seconds; the next step is usually adding the right assertions and error handling for your specific use case.

How to use

  1. Drop a HAR file

    Drag a .har file into the drop zone, or paste the HAR JSON into the input. HAR is the HTTP Archive format — Chrome, Firefox, Edge, and Safari all export network traces as HAR. The tool parses the JSON and shows the request list.

  2. Pick requests to convert

    The request list shows every HTTP call in the HAR — method, URL, status, size, time. Select one, several, or all requests. Multi-select is the right pick when the HAR captures a full user flow (login, fetch data, logout).

  3. Pick an output language

    Choose cURL (the lingua franca for HTTP in shell scripts), fetch (browser/Node.js), Python `requests`, Go `net/http`, or any combination. The output is a code block per request, ready to paste.

Frequently asked

How do I get a HAR file from my browser?

Open DevTools (F12 or Cmd+Opt+I), go to the Network tab, reproduce the request you want to capture, right-click any request in the list, and choose 'Save all as HAR with content' (Chrome) or 'Save All As HAR' (Firefox). The file is plain JSON.

What does the HAR format contain?

A HAR file is a JSON document with a 'log' object containing an 'entries' array. Each entry has the request (method, URL, headers, cookies, queryString, postData) and the response (status, headers, content, timing). Sensitive headers like Authorization are included in the file.

Can I edit requests before converting?

Yes — the request detail panel shows all headers, cookies, and body fields. Edit any field inline; the conversion uses the edited values, not the original HAR values. Useful for redacting Authorization headers or replacing the host with a test server.

Does the output include response handling?

The output is the request code, not a full request-response handler. For cURL, the response is printed to stdout. For fetch, the output is a single call without response.json() or error handling — add those in your code as needed.

Can I convert a HAR with thousands of entries?

Yes — the parser handles large HAR files (a few MB) without issue. The conversion itself is per-entry, so selecting all entries and converting is just a longer output. For very large HAR files (10+ MB), the UI may stall during initial parse.

Limitations

  • Authorization headers are exposedHAR files contain every request header, including Authorization, Cookie, and API keys. Saving a HAR from a logged-in browser session exposes your session credentials. Treat HAR files like passwords — do not share them publicly, and sanitize them before sharing.
  • No WebSocket entriesHAR's spec includes WebSocket frames, but the format is rarely populated by browser exporters. The tool focuses on HTTP/HTTPS requests. For WebSocket traces, use the browser's WebSocket inspector or a dedicated tool like Wireshark.
  • Binary bodies are not reconstructedRequest and response bodies in the HAR are base64-encoded when binary. The tool emits the base64 string in the output but does not reconstruct the original file. For a binary download, save the response from the browser instead of converting the HAR.

Platform notes

macOS
Safari's Web Inspector exports HAR from the Network tab. The browser tool accepts Safari-exported HARs (the format is identical to Chrome's). For command-line work, the same library that powers this tool is the `curlconverter` npm package.
Windows
Edge's DevTools exports HAR with the same format as Chrome. The browser tool accepts Edge-exported HARs without modification. For command-line work, pipe the HAR through jq and a cURL generator script.
Linux
Firefox's DevTools exports HAR from the Network tab. The browser tool accepts Firefox-exported HARs. For command-line work, `har-to-curl` (the npm CLI) does the same conversion without a browser: `npx har-to-curl input.har > output.sh`.
CLI
The same library that powers this tool is available as the `har-to-curl` and `curlconverter` packages on npm, with a CLI mode. Useful for embedding in build scripts, in test fixtures, or for batch conversion of saved HAR files.
Web
Runs entirely client-side. Works offline once the page has loaded. The HAR file is parsed in memory and never sent to a server. Safe to use with HARs that contain session credentials, though the standard advice (do not paste secrets into browsers) still applies.