Dev.to WebDev 🛠 Dev 👁 0 📖 6 min read

What is a HAR file, and how to get one from Chrome

A HAR file (HTTP Archive) is a JSON file that records every network request a browser made while a page was open, including URLs, headers, request bodies, responses and timings. Support teams ask for one because it shows

A HAR file (HTTP Archive) is a JSON file that records every network request a browser made while a page was open, including URLs, headers, request bodies, responses and timings. Support teams ask for one because it shows exactly what your browser sent and received when something broke. You can generate a HAR file in Chrome from the Network panel in DevTools in under a minute.

Disclosure: I build Netraptor, which this guide mentions as one option. The steps work with plain Chrome and free tools.

Steps

  1. Open the Network panel. Go to the page with the problem and open DevTools with F12, Ctrl+Shift+I on Windows and Linux, or Cmd+Option+I on macOS. Click the Network tab.
  2. Turn on Preserve log. Check Preserve log so requests are kept across page loads and redirects. Check Disable cache too if the problem only shows up on a fresh load.
  3. Reproduce the problem. Reload the page and repeat the exact steps that cause the issue. DevTools only records while it is open, so keep it open the whole time.
  4. Export the HAR file. Click the download icon, Export HAR (sanitized)..., in the action bar at the top of the Network panel, and choose where to save the file.
  5. Check the file before sharing. Open the .har file in a text editor and search for tokens, emails or other secrets before you send it to anyone.

What is a HAR file?

HAR stands for HTTP Archive. A HAR file is plain JSON with a .har extension that describes a browser's network activity: one entry per request, grouped under the pages that triggered them. Chrome, Edge, Firefox and Safari can all export it, and most debugging tools can read it.

The format was drafted as HAR 1.2 for the W3C Web Performance Working Group. That draft was never published as a standard and is now marked as abandoned, but browsers still write files that follow it. A trimmed HAR file looks like this:

{
  "log": {
    "version": "1.2",
    "creator": { "name": "WebInspector", "version": "537.36" },
    "pages": [{ "id": "page_1", "title": "https://app.example.com/" }],
    "entries": [
      {
        "pageref": "page_1",
        "startedDateTime": "2026-10-16T09:12:03.120Z",
        "time": 184.2,
        "request": { "method": "GET", "url": "https://app.example.com/api/orders" },
        "response": { "status": 500, "statusText": "Internal Server Error" },
        "timings": { "blocked": 1.1, "dns": 0, "connect": 0, "send": 0.2, "wait": 176.4, "receive": 6.5 }
      }
    ]
  }
}

What's inside a HAR file

Each entry in log.entries captures one request and its response. The fields you will look at most:

  • request: method, full URL, query string, headers, cookies and the request body (postData).
  • response: status code, headers, cookies, MIME type and usually the response body in content.text.
  • timings: how long the request spent blocked, on DNS, connecting, sending, waiting for the server (wait) and downloading (receive), in milliseconds.
  • startedDateTime and time: when the request began and how long it took in total.
  • pages: the page loads the requests belong to, so you can tell which navigation triggered what.

Because it holds full headers and bodies, a HAR file is often the fastest way for someone else to see a failed API call, a slow request or a bad redirect without access to your account.

Export HAR (sanitized) vs. with sensitive data

Since Chrome 130, the default HAR export is sanitized: it leaves out the Cookie, Set-Cookie and Authorization headers. This change was made to cut down on accidental leaks of login sessions when people attach HAR files to support tickets.

If you need those headers, for example to debug your own auth flow, open DevTools Settings > Preferences > Network and turn on Allow to generate HAR with sensitive data. The Export HAR button then offers both a sanitized and a sensitive-data option. See the Network features reference for the current labels.

Sanitized only removes those three headers. Tokens in URLs, request bodies, custom headers like X-Api-Key and response bodies are still in the file.

How to get a HAR file in Edge, Firefox and Safari

  • Microsoft Edge uses the same DevTools as Chrome. Follow the steps above.
  • Firefox: open the Network Monitor (Ctrl+Shift+E or Cmd+Option+E), reproduce the issue, then right-click any request and choose Save All As HAR.
  • Safari: enable the Develop menu in Safari settings, open Web Inspector, go to the Network tab, reproduce the issue and click Export.

Whichever browser you use, start recording before you reproduce the problem. A HAR file only contains requests made while the network tools were open.

Is it safe to share a HAR file?

Treat a HAR file like a password. A file exported with sensitive data contains session cookies and bearer tokens, and anyone who has it can often act as you until those expire. Even a sanitized file can include personal data from API responses, IDs in URLs and API keys in custom headers.

Before you share one:

  • Use the sanitized export unless the recipient specifically needs auth headers.
  • Record in a fresh tab with only the steps needed to reproduce the issue, so unrelated traffic stays out of the file.
  • Search the file for token, key, password, secret and your email address.
  • Log out after sending a file that included cookies. That invalidates the session on most sites.

Google's HAR Analyzer also has a redaction button that downloads a copy with sensitive values removed.

Doing this with Netraptor

Chrome's Network panel records everything, but only while DevTools is open, and you have to remember to turn on Preserve log first. If you capture the same app often, Netraptor can record it in the background instead.

  • In the Netraptor toolbar popup, turn on Record this site. It records the fetch and XHR API traffic for that domain and its subdomains across page loads, with or without DevTools open.
  • Open the Netraptor panel in DevTools to browse the recorded requests in a Chrome-style Requests table, or group them by endpoint in API Map.
  • On the Export tab, export a HAR file. Strip auth headers and cookies is on by default, so the file is safer to share.

HAR export is part of the Free plan, along with Postman and curl exports. Everything stays in your browser and no account is needed. Netraptor records API calls only, so if you need images, scripts and the full page-load waterfall in the file, use Chrome's own export.

What to do with a HAR file next

Once you have the file, you can load it back into Chrome DevTools, open it in an online viewer or query it with jq. See how to open and analyze a HAR file. If you want to replay the requests you captured, turn them into a Postman collection.

FAQ

What does HAR stand for?

HAR stands for HTTP Archive. It is a JSON-based format for logging a browser's network requests and responses.

Why is my HAR file empty?

DevTools only records network traffic while it is open. Open the Network panel first, check Preserve log, then reload the page and reproduce the problem before exporting.

Can I open a HAR file in Notepad?

Yes. A HAR file is plain JSON text, so any text editor can open it. For a readable request list, import it into the Chrome DevTools Network panel or a HAR viewer.

Does a HAR file contain my password?

It can. If you log in while recording, the login request body may include your password in plain text. Record after logging in, or check the file before sharing it.

Why are cookies missing from my HAR file?

Chrome exports sanitized HAR files by default and strips the Cookie, Set-Cookie and Authorization headers. Turn on Allow to generate HAR with sensitive data in DevTools settings if you need them.

Originally published at netraptor.dev/guides/what-is-a-har-file. More guides: netraptor.dev/guides.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.