# How to export a HAR file in Chrome, Edge, Firefox, and Safari

> Export a HAR file in Chrome, Edge, Firefox, or Safari step by step, see what it contains, remove cookies and tokens before you share it, and learn to read one.

Published 2026-11-14 by the Laneshot team. Source: https://laneshot.com/blog/how-to-export-a-har-file

A HAR file (HTTP Archive) is a JSON file that records the network requests a browser made while a page was open: each request's address, headers, body, status code, response, and timing. Developers ask for one when something fails to load or save, because it shows exactly what the browser sent and what the server answered.

To export a HAR file, open the browser's developer tools, go to the Network tab, turn on the option that keeps the log across page loads, reproduce the problem, and use the export button. The exact steps for Chrome, Edge, Firefox, and Safari are below.

One warning before you start: a HAR file can contain cookies, login tokens, and anything typed into forms. Read the section on cleaning it before you send it to anyone.

## What a HAR file contains

A HAR file is plain JSON. Each request is an entry in `log.entries`, with the request, the response, and how long each phase took. A shortened entry looks like this:

```json
{
  "log": {
    "version": "1.2",
    "creator": { "name": "WebInspector", "version": "537.36" },
    "entries": [
      {
        "startedDateTime": "2026-11-14T09:41:07.120Z",
        "time": 812,
        "request": {
          "method": "POST",
          "url": "https://app.example.com/api/payments",
          "headers": [{ "name": "Content-Type", "value": "application/json" }],
          "postData": { "mimeType": "application/json", "text": "{\"amount\":4200}" }
        },
        "response": {
          "status": 502,
          "content": { "mimeType": "application/json", "text": "{\"error\":\"upstream timeout\"}" }
        },
        "timings": { "send": 1, "wait": 790, "receive": 21 }
      }
    ]
  }
}
```

That's enough to answer most "why didn't it save?" questions: which request failed, with what status, what the page sent, and what the server said back. HAR files are most useful for failed or slow requests, redirect and sign-in loops, and bugs that only happen for one customer's account or network.

## Export a HAR file in Chrome or Edge

Edge uses the same developer tools as Chrome, so the steps are the same in both.

1. Open the page where the problem happens.
2. Open DevTools: press F12 or Ctrl+Shift+I on Windows and Linux, or Cmd+Option+I on a Mac. You can also right-click the page and choose **Inspect**.
3. Select the **Network** tab.
4. Check **Preserve log**, so requests aren't cleared when the page reloads or redirects. Optionally check **Disable cache** to see every request as on a first visit.
5. Make sure recording is on: the round button at the top left of the panel is red.
6. Reproduce the problem. If it happens on page load, reload the page now.
7. Select **Export HAR (sanitized)** in the action bar at the top of the Network panel (a download arrow icon), and save the file. Older versions call it **Export HAR**.

You can also right-click any request, choose **Copy**, and save all the listed requests as a HAR file from there.

### Sanitized or with sensitive data

Recent versions of Chrome and Edge export a sanitized HAR by default. It leaves out the `Cookie`, `Set-Cookie`, and `Authorization` headers. Exporting with those headers is a separate choice: turn on **Allow to generate HAR with sensitive data** in the DevTools settings, under **Preferences** and **Network**, then pick **Export HAR (with sensitive data)** from the export button's menu.

Use the sanitized export unless the person who asked for the file needs the cookies, for example to debug a session problem. Even then, send it privately, and turn the setting off afterwards.

The sanitized export isn't fully clean. Tokens in URLs, custom headers such as API keys, form fields in request bodies, and personal data in responses all stay in the file.

## Export a HAR file in Firefox

1. Open the page where the problem happens.
2. Open the Network panel: press Ctrl+Shift+E on Windows and Linux, or Cmd+Option+E on a Mac. You can also open the developer tools with F12 and select **Network**.
3. Turn on **Persist Logs**, so the list isn't cleared when the page reloads or navigates. Depending on your version, it's a checkbox in the Network toolbar or an item in its settings menu (the gear icon).
4. Optionally check **Disable Cache**.
5. Reproduce the problem.
6. Right-click any request in the list and choose **Save All As HAR**. The same item is in the Network panel's settings menu. Save the file.

**Copy All As HAR**, next to it, puts the same content on the clipboard instead. Assume Firefox's export includes cookies and authorization headers, and clean the file before you send it.

## Export a HAR file in Safari

Safari hides its developer tools until you turn them on:

1. In Safari, open **Settings**, then **Advanced**, and check **Show features for web developers**. In older versions, the option is **Show Develop menu in menu bar**.
2. Open the page where the problem happens.
3. Choose **Develop** > **Show Web Inspector**, or press Option+Cmd+I.
4. Select the **Network** tab.
5. Check **Preserve Log**, so requests stay in the list across page loads. Clear the filter field, so nothing is hidden from the export.
6. Reproduce the problem.
7. Select **Export** in the Network tab, or press Cmd+S while it's open, and save the `.har` file.

As with Firefox, assume the file includes cookies and authorization headers, and clean it before sharing it.

## Remove sensitive data before you share it

A HAR file is a record of a signed-in session. In the wrong hands, the cookies and tokens in it can be enough to act as you until the session ends. Treat it like a password.

| What | Where in the file | Why it matters |
| --- | --- | --- |
| Session cookies | `Cookie` and `Set-Cookie` headers, and the `cookies` arrays | Can let someone use your session |
| Authorization headers | `Authorization`, often a bearer token | Same as a password for an API |
| API keys | Custom headers such as `X-Api-Key` | Give access to an account or service |
| Tokens in URLs | Query strings such as `?token=` or `?code=` | Reset links and sign-in codes |
| Form data | `postData.text` of each request | Can include passwords and personal details |
| Responses | `response.content.text` | Account data, customer records, addresses |

A cleaning routine that takes a few minutes:

1. **Reproduce with a test account** if you can, and avoid signing in with your real password while the Network tab is recording.
2. **Use the sanitized export** in Chrome or Edge. It handles cookies and the authorization header, but nothing else.
3. **Blank the sensitive headers and cookies** with the first command below. Add any custom header names your app uses to its pattern.
4. **Search for what's left** with the second command, which counts the sensitive-looking words still in the file.
5. **Edit the rest by hand.** Open `clean.har` in a text editor, search for each word the search found, and replace the values.
6. **Send it privately**, through a ticket or a direct message, never in a public issue or forum. Delete it when the problem is solved.
7. **Sign out afterwards.** In many apps, that ends the session the cookies belonged to, but not every token is revoked on sign-out.

This `jq` command replaces the values of the `Authorization`, `Cookie`, `X-Api-Key`, and `Set-Cookie` headers, and empties the cookie lists:

```bash
jq '
  .log.entries |= map(
    .request.headers |= map(
      if (.name | test("^(authorization|cookie|x-api-key)$"; "i")) then .value = "[removed]" else . end)
    | .response.headers |= map(
      if (.name | test("^set-cookie$"; "i")) then .value = "[removed]" else . end)
    | .request.cookies = []
    | .response.cookies = []
  )
' original.har > clean.har
```

This one lists what's left to check, with a count for each word:

```bash
grep -o -i -E 'password|passwd|secret|token|bearer|session|api[_-]?key' clean.har | sort | uniq -c
```

## How to read a HAR file

The easiest viewer is the browser that made it:

- **Chrome and Edge:** open DevTools, select **Network**, and drag the file into the list of requests, or use the **Import HAR** button in the action bar.
- **Firefox:** use **Import HAR** in the Network panel's settings menu.
- **Safari:** select **Import** in the Network tab, or drag the file onto Web Inspector.

Then look in this order:

1. **Failed requests.** Sort by status and look for 4xx and 5xx codes, or requests that never completed.
2. **The response of the failing request.** Error messages from the server are often in the body.
3. **What the page sent.** Compare the request body and headers with a working request.
4. **Timing.** A long wait time points to the server; a long download points to the size of the response.

Because it's JSON, you can also query it from a terminal. These list the failed requests, then the slowest ten:

```bash
jq -r '.log.entries[] | select(.response.status >= 400) | "\(.response.status) \(.request.method) \(.request.url)"' clean.har

jq -r '.log.entries[] | "\(.time | round)ms \(.request.method) \(.request.url)"' clean.har | sort -rn | head -10
```

A HAR file shows the network side only. Pair it with the [console logs](/blog/get-console-logs-from-users) from the same session and clear steps to reproduce, as described in [how to write a bug report](/blog/how-to-write-a-bug-report).

## Capture network requests without a HAR file

Asking a non-technical person to open DevTools, preserve the log, export, and clean a file is a lot of steps, and each one can go wrong. It's also why many reports arrive without network data at all.

Laneshot's [browser extension](https://laneshot.com/docs/capture/browser-extension) records network requests as part of the bug report. While you record a tab, it captures requests made with `fetch`, `XMLHttpRequest`, and `sendBeacon`: method, address, status, duration, headers, request bodies, and text responses. Images, scripts, and other assets are listed with their address, status, duration, and size. Screenshots include the requests from the two minutes before you took them.

Masking happens in the browser, before anything leaves the page, and again on the server, as described in [what is captured](https://laneshot.com/docs/capture/what-is-captured):

- The values of `Authorization`, `Proxy-Authorization`, `Cookie`, `Set-Cookie`, `X-Api-Key`, `X-Auth-Token`, `X-Csrf-Token`, and `X-Xsrf-Token` become `[redacted]`.
- Query parameters and JSON or form fields with sensitive names, such as `password`, `token`, `secret`, or `card_number`, become `[redacted]`, at any depth.
- Typed text is never recorded, and cookies and storage entries are recorded by name, never by value.

The requests sit next to the video and the console, on one timeline, so a developer sees the failed call at the moment it happened. It doesn't replace a HAR file in every case: requests made by service workers aren't recorded, and [recording links](https://laneshot.com/docs/capture/recording-links), which customers use without the extension, capture the screen, voice, and environment but no requests. For those cases, the steps above still apply. And since video pixels aren't masked, close anything sensitive on screen before you record.

## Frequently asked questions

### What is a HAR file?

A HAR file, short for HTTP Archive, is a JSON file that records the network requests a browser made: addresses, headers, bodies, status codes, responses, and timings. Developers use it to see what the browser sent and what the server answered when something fails.

### Is it safe to share a HAR file?

Not as exported. It can contain session cookies, authorization tokens, API keys, form data, and personal data, so remove those values first and send the file privately. Chrome and Edge's sanitized export leaves out cookies and the authorization header, but not the rest.

### Why is my HAR file empty or missing requests?

The Network tab was usually opened after the requests happened, or the log was cleared by a page load. Open the developer tools first, turn on Preserve log (Persist Logs in Firefox), clear any filter, then reproduce the problem before exporting.

### How do I open a HAR file?

Drag it into the Network panel of Chrome or Edge DevTools, or use the import option in the Network panel of Chrome, Edge, Firefox, or Safari. It's also plain JSON, so any text editor or `jq` can read it.
