A HAR file records every network request your browser makes

A HAR file (HTTP Archive) is a text file that captures a complete record of all the network activity that happens when you load a webpage. It logs every request your browser sends — for HTML, images, scripts, stylesheets, fonts, API calls — and every response the server sends back. The file includes timing data, response codes, headers, cookies, and the actual content transferred. Developers use HAR files to troubleshoot slow pages, debug network problems, and share exactly what happened during a browsing session without needing to recreate the issue.

HAR files are formatted in JSON, which means they are human-readable text files you can open in any text editor. Most modern browsers can export a HAR file directly from the developer tools — usually by right-clicking a network request and selecting "Save as HAR" or through the Network panel menu. Because HAR files contain everything that crossed the network, they can be large (sometimes several megabytes for a complex page) and may include sensitive data like authentication tokens or personal information, so you should review the contents before sharing one with someone else.

Key Takeaways

  • A HAR file records every network request and response that occurs when loading a webpage, including timing, headers, and content.
  • HAR files are JSON-formatted text that you can open in any editor, and most browsers can export them directly from the Network tab in developer tools.
  • Developers use HAR files to diagnose performance problems, debug failed requests, and reproduce issues without needing to watch the network activity happen live.
  • HAR files can contain sensitive information like cookies and authentication tokens, so review the contents before sharing them with others.

How to export a HAR file from your browser

In Chrome, open the developer tools (F12 or right-click and select Inspect), go to the Network tab, reload the page to capture the traffic, then right-click anywhere in the network list and select "Save as HAR with content". Firefox works similarly: open developer tools, go to the Network tab, reload the page, right-click in the network panel, and choose "Save All as HAR". Safari requires you to enable the Develop menu first (Preferences > Advanced > Show Develop menu in menu bar), then go to Develop > Show Web Inspector, click the Network tab, reload the page, and click the export button (usually a downward arrow or gear icon).

The exported file will be named something like archive.har and will contain every request made during the time the Network tab was recording. If you only want to capture a specific action — like loading a search results page or submitting a form — start recording, perform that action, then export. This keeps the file smaller and focused on the problem you are investigating.

What information a HAR file contains

A HAR file records the request line (the URL, HTTP method like GET or POST, and HTTP version), all request headers (including User-Agent, Accept, Authorization), request body for POST requests, the response status code (200, 404, 500, etc.), all response headers, the response body (the actual HTML, JSON, image data, or other content returned), and precise timing data showing how long each phase of the request took — DNS lookup, TCP connection, waiting for the server, downloading the response.

The file also captures cookies sent with each request, cache headers that control whether a resource should be reused, redirects (when a request is sent to a different URL), and MIME types that identify what kind of content was returned. This level of detail is why HAR files are so useful for debugging: they show you exactly what the browser asked for, exactly what the server returned, and how long each step took. A slow page might show that the server took 5 seconds to respond to one request, or that a large image file took 10 seconds to download, or that the browser spent time waiting for a third-party script to load.

Common reasons developers use HAR files

The most common use is troubleshooting a slow or broken webpage. If a page loads slowly for one user but not another, that user can export a HAR file and send it to the developer, who can see exactly which requests were slow or failed. If a form submission fails, the HAR file shows whether the request was even sent, what the server responded with, and whether there was a network error or an application error.

Developers also use HAR files to reproduce issues that are hard to catch live. If a user reports that a page sometimes fails to load, the developer can ask them to export a HAR file the next time it happens, then analyze it offline without needing the user to sit on a call or repeat the steps. HAR files are also useful for performance analysis: you can load a HAR file into tools like WebPageTest or import it into browser developer tools to see a waterfall chart showing which requests ran in parallel, which ones blocked others, and where the bottlenecks were.

Testing and QA teams use HAR files to verify that an application makes the correct network requests. If you are building an API client or a web application that calls multiple services, you can record a HAR file of a successful workflow and use it to check that all the expected requests were made with the correct parameters. Some developers also use HAR files to mock network responses during testing, so they can test how the application behaves when a server is slow or returns an error, without needing to set up a test server.

Privacy and security considerations when sharing HAR files

Because a HAR file contains everything that crossed the network, it can include sensitive data. If you logged into a website, the HAR file may contain your session cookie or authentication token. If you filled out a form with personal information, that data will be in the request body. If you made an API call with an API key in the URL or header, that key will be visible in the HAR file. Before sharing a HAR file with a developer or posting it in a public forum, open it in a text editor and search for or remove any passwords, tokens, API keys, email addresses, or other personal information.

Some browsers offer options to exclude sensitive data when exporting. Chrome's "Save as HAR with content" includes everything by default, so you must review it manually. If you are regularly sharing HAR files with a development team, consider using a tool or script to automatically redact sensitive fields before export, or ask the developer what specific information they need and export only that portion of the network activity.

Tools for viewing and analyzing HAR files

You can open a HAR file in any text editor to read the raw JSON, but specialized tools make it easier to understand. The HAR Viewer (a free online tool at ericduran.github.io/chromeHAR/viewer) lets you upload a HAR file and see a formatted waterfall chart showing all requests, their timing, and their status. This is useful for spotting which requests are slow or which ones are blocking others.

Browser developer tools can also import HAR files. In Chrome, you can open the Network tab, click the import button, and select a HAR file to view it as if you had recorded it live. This lets you use all the browser's built-in analysis tools on a file someone else recorded. Other tools like WebPageTest and Lighthouse can accept HAR files as input for performance analysis. If you are analyzing a HAR file programmatically — for example, to extract all failed requests or calculate total page load time — you can parse it as JSON in any programming language.

Frequently Asked Questions

Can I use a HAR file to replay a webpage exactly as it was?

Not exactly. A HAR file records the network requests and responses, but it does not capture the state of the browser's JavaScript engine, local storage, or the rendered page. You can use a HAR file to see what requests were made and what responses came back, but replaying those requests will not necessarily produce the same visual result, especially if the page uses JavaScript to modify the DOM or if it depends on the current time or user location.

How large can a HAR file get?

A HAR file can range from a few kilobytes for a simple page to several megabytes for a complex site with many images, videos, or API calls. If you are exporting a HAR file for a long browsing session with many page loads, the file can become very large. To keep the file manageable, export only the specific page load or user action you are investigating, rather than an entire browsing session.

Is it safe to share a HAR file with someone I do not know?

Not without reviewing it first. A HAR file can contain cookies, authentication tokens, API keys, and personal information. Always open the file in a text editor and search for sensitive data before sharing it. If you are unsure what to remove, ask the person requesting the file what specific information they need, and consider exporting only that portion of the network activity.

Do all browsers export HAR files the same way?

The basic process is similar across Chrome, Firefox, Safari, and Edge — open developer tools, go to the Network tab, reload the page, and export — but the exact menu locations and button labels differ slightly. Some browsers include more or less detail by default. Chrome and Firefox both have straightforward export options, while Safari's process requires enabling the Develop menu first.