HAR file

A HAR file is a JSON log of the network requests a web page made, saved from a browser's developer tools. HAR stands for HTTP Archive. Each entry records one request and its response: URL, method, status, headers, cookies, timings and sometimes the body. Teams ask for one to see what the browser actually sent and received.

The longer version

Open the Network panel in Chrome, Firefox, Edge or Safari, reproduce the problem with recording on, and export the result as HAR. The file holds one entry per request in the order the browser made them, with the time spent on each stage: waiting for DNS, connecting, sending, waiting for the first byte, receiving. A developer who loads it into a viewer sees the same waterfall the reporter saw, including the call that returned a 500 and the script that never arrived. The file covers the network only: the console errors, the page the reporter was looking at and the steps they took have to arrive some other way.

The format came out of Firebug and HttpWatch in 2009, written by Jan Odvarko and Simon Perkins after Steve Souders suggested the two tools share one format, and its version 1.2 was later set out as a W3C draft that was abandoned without becoming a standard. In practice that matters little, because browsers, proxies and many testing tools read and write it, and the structure is stable enough to script against. The file is plain JSON, so it can be searched, diffed against a recording from a working session, or replayed into a tool that mocks the server.

Before a HAR file leaves the machine that recorded it, strip the cookies, the authorization headers and any token carried in a URL or a body, and choose the sanitized export where the browser offers one.

Common questions

What is a HAR file used for?

A HAR file is used to investigate how a page loaded and which requests failed. Support teams ask for one when a customer reports a page that hangs or a feature that errors, and developers load it into a viewer to see every request, its status and its timing without needing access to the customer's machine.

How do I create a HAR file in Chrome?

Open developer tools, switch to the Network tab, enable recording, and reload or reproduce the problem. Then use the export control in the panel's toolbar or the context menu to save all requests as HAR. Firefox, Edge and Safari have an equivalent export in their own network panels.

Is a HAR file safe to share?

A raw HAR file is not safe to share publicly, because it can contain cookies, authorization headers, tokens and response bodies. Anyone holding a file with a live session cookie may be able to act as that user until the session expires. Remove sensitive values before sending it, and delete it when the case closes.

What does HAR stand for?

HAR stands for HTTP Archive, a JSON format the Firebug and HttpWatch teams announced together in 2009. A W3C draft of its version 1.2 was abandoned before it became a standard, and the format is nonetheless the common export for browser network logs.

Does a HAR file include console errors?

A HAR file does not include console errors. It records requests and responses only, so a JavaScript exception that was thrown after a successful request leaves no trace in it. The console output has to be copied separately or captured by a tool that records both.

Bug reports that arrive ready to triage.

Collect replay, console, network and browser context with the Free plan.

<script src="…/widget.js" data-key="pb_pub_…">