How to create a HAR file in Chrome, Edge, Firefox and Safari
Short answer: Open the browser's developer tools before you reproduce the problem, go to the Network panel, turn on Preserve log, reload and reproduce the problem, then export. In Chrome and Edge click Export HAR (sanitized)…; in Firefox choose Save All as HAR; in Safari click Export in the Network tab. Before you send the file, open it on your own computer and check it for tokens and personal data.
Before you start: four things that make a useful HAR
A HAR file is a recording of what the browser sent and received (what a HAR file is). Whoever asked for it needs the moment the problem happens, so:
- Open the developer tools first. Browsers record network traffic only while their developer tools are open. Requests made before that are not in the file.
- Keep the log across page loads. Turn on Preserve log (Chrome, Edge, Safari) or Persist Logs (Firefox). Otherwise a redirect, a sign-in hop or a reload can wipe the requests you needed.
- Consider disabling the cache. With Disable cache on, the browser fetches everything again instead of reusing stored copies, so every file the page needs appears in the recording.
- Reproduce, then stop. Reload the page, do exactly what triggers the problem, and export straight away. A short recording is easier to read and carries less private data.
Google Chrome
- Open the page where the problem happens in Google Chrome™.
- Open DevTools: press
F12orCtrl+Shift+Ion Windows and Linux,Cmd+Option+Ion a Mac — or open the three-dot menu and choose More Tools → Developer Tools. - Click the Network panel. Recording is on when the round record button is red; if it is grey, click it.
- Tick Preserve log, and Disable cache if you want a full reload.
- Reload the page and reproduce the problem.
- Click Export HAR (sanitized)… (the button with a download icon in the action bar at the top of the Network panel) and save the
.harfile.
To stop recording before you export — for example so background requests do not keep piling up — press Ctrl+E (Cmd+E on a Mac) while the Network panel has focus.
Sanitized or with sensitive data?
Since Chrome 130, the default export is the sanitized one: it leaves out sensitive data such as the Cookie, Set-Cookie and Authorization headers, to reduce accidental leaks. The other option, Export HAR (with sensitive data), keeps them. It is hidden until you open DevTools Settings → Preferences → Network and tick Allow to generate HAR with sensitive data; after that, clicking the Export button opens a menu with both choices (in Chrome 133 and later; earlier versions needed a long click).
Send the sanitized file unless the person asking explains why they need the cookies or the authorization header — for example, to debug a sign-in problem. Even then, a fresh test account is a better idea than your own.
Microsoft Edge
In Edge the steps are almost the same as in Chrome:
- Open the page, right-click anywhere on it and select Inspect.
- Select the Network tool. Tick Preserve log and, if you like, Disable cache.
- Refresh the page and reproduce the problem.
- In the action bar at the top of the Network tool, click Export HAR (sanitized) and save the file.
Edge saves every request since DevTools was opened, and its sanitized export also leaves out the Cookie, Set-Cookie and Authorization headers. The full version needs the same setting as in Chrome: Customize and control DevTools → Settings → Preferences → Network → Allow to generate HAR with sensitive data.
Firefox
- Open the page and press
Ctrl+Shift+E(Cmd+Option+Eon a Mac) to open the Network Monitor directly. It starts recording as soon as it opens. - In the Network Monitor toolbar's menu of other actions, turn on Persist Logs. Tick the checkbox that disables the cache if you want a full reload.
- Reload the page and reproduce the problem.
- Open the same menu and choose Save All as HAR, or right-click the request list and choose Save All As HAR. A save dialog opens; the file gets the
.harextension.
The toolbar's pause button stops recording if you need to freeze the log before saving. Copy All as HAR puts the same data on the clipboard instead of in a file. Firefox's documentation describes no sanitized variant: the file contains the current contents of the network log, cookies included, so check it before sending.
Safari on a Mac
- If there is no Develop menu in the menu bar, choose Safari → Settings, click Advanced and select Show features for web developers.
- Open the page, then choose Develop → Show Web Inspector (or press
Option+Command+I) and click the Network tab. - Tick Preserve Log. Turn on Ignore Cache if you want a full reload — it stays on across Web Inspector sessions, so switch it off afterwards.
- Reload the page and reproduce the problem.
- Click Export (or press
Command+S) to save the table as a HAR file.
As with Firefox, Safari's documentation mentions no sanitized export, so treat the file as containing everything.
Android and iPhone
On a phone you record from a computer: the phone's browser is connected to the desktop developer tools, and the export happens there.
Chrome on Android. On the phone, turn on USB debugging in Developer Options and connect it to your computer with a USB cable. In Chrome on the computer, open chrome://inspect#devices with Discover USB devices ticked, accept the debugging prompt on the phone, then click Inspect next to the tab you want. A DevTools window for the phone's tab opens on the computer; record and export from its Network panel as described above for Chrome.
Safari on iPhone. On the iPhone, open Settings → Safari → Advanced and turn on Web Inspector. Connect the iPhone to a Mac with a cable, make sure the Mac's Safari shows the Develop menu, and pick the page from the iPhone's submenu in Develop. Web Inspector opens on the Mac; use its Network tab as in the Safari steps.
Before you send it
A HAR file records a session in full — including, potentially, what lets someone else sign in as you. Even Chrome's sanitized export documents only certain headers as removed; tokens in URLs, form submissions, custom credential headers and response bodies with personal data can all still be inside. Firefox and Safari exports should be assumed to contain everything.
- Open the file on your own computer — import it back into DevTools (Import HAR in the Network panel), open it in a text editor, or use an offline viewer. Our guide how to open a HAR file compares the options.
- Search for
cookie,authorization,token,password,key,sessionand your email address, and replace the values (not the names) with something likeREDACTED. Keep quotes and commas so the file remains valid JSON, and reopen it to make sure it still loads. - Send it through the vendor's own support channel, not a public file link, and ask for it to be deleted once the case is closed.
A HAR viewer that runs offline, like HARScope, lets you check what is inside before you send it: it is a free Chrome extension with no permissions and no network requests, so the file never leaves your computer while you read through its requests, headers and bodies.
Questions
How do I get a HAR file from Chrome?
Open DevTools with F12 (Cmd+Option+I on a Mac), go to the Network panel, tick Preserve log, reload the page and reproduce the problem. Then click Export HAR (sanitized)... in the action bar at the top of the Network panel and save the .har file.
What is the difference between Export HAR (sanitized) and Export HAR (with sensitive data)?
The sanitized export, Chrome's default since Chrome 130, leaves out sensitive data such as the Cookie, Set-Cookie and Authorization headers. The export with sensitive data keeps them, and it only appears after you turn on Allow to generate HAR with sensitive data in DevTools Settings, Preferences, Network. Send the sanitized one unless the person asking explains why they need more.
Why is my HAR file missing the requests I need?
Usually because DevTools was opened after the problem happened: browsers record network traffic only while their developer tools are open. The log can also be cleared when the page reloads or navigates. Open DevTools first, turn on Preserve log (Persist Logs in Firefox), then reproduce the problem.
Can I create a HAR file on my phone?
Not from the phone alone. For Chrome on Android, connect the phone to a computer by USB, enable USB debugging and open chrome://inspect#devices in Chrome on the computer; DevTools for the phone's tab opens there. For Safari on iPhone, turn on Web Inspector in the iPhone's Safari settings, connect it to a Mac and inspect the page from Safari's Develop menu.
Is it safe to send a HAR file to support?
Check it first. Even a sanitized HAR can still contain tokens in URLs, form data, other credential headers and response bodies with personal data. Open it on your own computer, replace anything sensitive, and send it through the vendor's support channel rather than a public link.
Microsoft Edge is a trademark of Microsoft Corporation; Firefox is a trademark of the Mozilla Foundation; Safari and iPhone are trademarks of Apple Inc.; Android is a trademark of Google LLC.