Blog

How to capture and read a HAR file|Finding why a page is slow from the request list and the waterfall

When a support desk asks you to "please send a HAR file", or when you want to know why a page loads slowly, this is how to save a HAR in Chrome DevTools and how to read what is inside. Using a real 12-request HAR I recorded, I checked that Export HAR (sanitized) removes only the Cookie, Set-Cookie and Authorization headers, and walked through using a HAR viewer to read the request count, transfer size and waterfall to spot a heavy image, an API call that waits on another one, and 404 and 503 errors.

The English version of the HAR viewer. At the top, the Summary shows Requests 12, Total transfer 4.04 MB and Overall load time 2768.1 ms. In the waterfall below, the hero.jpg row has the longest bar at 2624.1 ms, the products/1024 row takes 1663.7 ms, and the reviews?id=1024 row is a red bar with status 503.
The recorded HAR loaded into the viewer. The two long bars, hero.jpg and products/1024, account for most of the slow load.

When you report a problem with a web service, support sometimes asks you to “capture a HAR file and send it to us”. Or someone tells you that your own site “loads slowly”, and you want to find out where the time is going. In both cases the clue is a HAR (HTTP Archive). It is a JSON file, with the extension .har, that records the requests the browser sent and the responses it received while opening a page, with the URL, status, headers, size and duration of each one.

You can save a HAR from the browser’s developer tools. The contents, however, are one big lump of JSON, so opening it in a text editor does not tell you much about what is slow. It may also contain cookies or the token of a logged-in session, so you should not hand it to someone without checking what is in it.

In this article I first go through how to save a HAR in Chrome and what “sanitized” actually covers before you hand the file over, and then read the contents with the HAR Viewer. The tool parses the file inside the browser and does not send it anywhere. As an example, I recorded a real HAR from a test page that imitates a slow product page, and followed it all the way to identifying which requests cause the slowness.

Saving a HAR in Chrome

A HAR records only the traffic that happens while the developer tools are open. So the order is: open the developer tools first, then repeat the action that causes the problem. Edge uses the same developer tools as Chrome, so the steps are identical.

  1. Open the page in question, press F12 (Command + Option + I on a Mac) to open the developer tools, and select the “Network” tab.
  2. Check “Preserve log”. This keeps the earlier records when you move to another page or are redirected after logging in. If you are investigating slow loading, also check “Disable cache” so that files left in the cache do not make the page look faster than it is.
  3. Reload the page and carry out the problematic action all the way through.
  4. Click the downward-arrow button (Export HAR) in the Network tab’s toolbar and choose where to save the file. You can also right-click the request list and choose “Copy all as HAR (sanitized)” to copy it to the clipboard instead of saving a file.

Firefox’s developer tools also have “Save All As HAR”, which saves the network log as a HAR.

“Sanitized” removes only three kinds of headers

In current versions of Chrome, the HAR you save by default is “sanitized” (with sensitive information removed). The description of the “Allow to generate HAR with sensitive data” option in the developer tools settings says that the default HAR does not include the Cookie, Set-Cookie and Authorization headers, and that turning the option on adds a choice to save with sensitive data. Once it is on, the menu shows two items side by side: “Export HAR (sanitized)…” and “Export HAR (with sensitive data)…”.

If you leave the setting alone, the HAR is saved sanitized, so you only need to include sensitive data when the other party asks for it and you have decided it is fine to share. What you should keep in mind, though, is that only those three headers are removed. Tokens in URLs such as ?token=..., the contents of forms you submitted and personal information returned by APIs are not covered by that description. Before you hand over a HAR, recall which pages and which actions you recorded, and check that nothing you would not want others to see went over the wire.

Uploading the file to an online analysis service to do that check would defeat the purpose. The HAR Viewer parses the loaded HAR only inside the browser, so you can open even a file you do not want to leave your machine. The “Path” column of the request list includes the query string, and if you type token or key into the search box described later, you can pull out just the requests whose URLs contain those words. The tool does not show headers, submitted data or response bodies, though, so for those you have to look at the JSON directly in a text editor.

The HAR recorded for this example

From here on I use a test page that imitates the product page of a fictional online shop. Besides HTML, CSS and JavaScript, the page loads one large product image, three thumbnails, an ad tag, and APIs that fetch product information, stock and reviews. I deliberately made some of these slow or return errors.

Host Role Planted problem
www.example-shop.test HTML and app.js None
cdn.example-shop.test CSS, images, fonts The product image hero.jpg is about 3.6 MB. The font returns 404
api.example-shop.test Product, stock and review APIs The product API takes about 1.65 s to respond. Stock is requested after the product info arrives. Reviews return 503
tags.example-ads.test Ad tag Takes about 0.35 s to respond

To record the HAR, I pointed these host names at a test server written in Node.js and opened the page in Chromium driven by Playwright. The result is the same HAR 1.2 format as a HAR saved from Chrome’s developer tools. I have put the same file online as a sample HAR (sample-product-page.har), so if you load it into the tool you can reproduce the screens in this article.

Loading the HAR into the viewer and looking at the overall numbers

Open the HAR Viewer and pick the .har file with the file selection button (Choose File). Dragging and dropping it onto the dashed box works too. If you copied it with “Copy all as HAR” in the developer tools, paste it into the “Paste HAR JSON” field and click “Parse”. The screenshots show the English UI.

Once the file is loaded, the “Summary” shows the overall numbers first.

The Summary section of the English UI. Four cards show Requests 12, Total transfer 4.04 MB, Overall load time 2768.1 ms and Domains 4, and below them is the line pages[0]: "Sample shop – product page", start: 11/27/2026, 3:58:24 AM, onLoad: 2774.0 ms.
12 requests transferred 4.04 MB, and 2768.1 ms passed between the first request and the last response.

“Requests” was 12, “Total transfer” 4.04 MB, “Overall load time” 2768.1 ms and “Domains” 4. The overall load time is the time from the start of the first request until the last response has been fully received. The onLoad: 2774.0 ms on the line below is the time to the page’s load event as recorded by the browser, and it is almost the same value.

Four megabytes for a single product page is heavy. The “Transfer by domain (KB)” chart under “Distribution charts” gives you an idea of which requests are heavy.

The Transfer by domain (KB) bar chart in the English UI. The domain names on the horizontal axis are long and truncated: cdn.example-shop… is 3861, www.example-shop… 181, tags.example-ads… 95 and api.example-shop… 1, with only the cdn bar sticking out.
Most of the transfer is concentrated on the CDN host.

cdn.example-shop.test alone accounts for 3861 KB, while the other three hosts together do not reach 300 KB. The CSS and thumbnails add up to just over 200 KB, so the rest must be the single product image.

Using the waterfall to find slow requests and what is waiting on what

After the numbers, look at how time passes in the “Timeline (waterfall)”. Each row is one request, showing from left to right the HTTP status, file name, duration and a bar. The left end of a bar is when the request started, and its length is how long it took to finish. Bars are blue for 2xx, green for 3xx, orange for 4xx and red for 5xx. Hovering over a file name shows the full URL.

The waterfall in the English UI. Below Range: 0 ms – 2768.1 ms (12 entries), www.example-shop.test takes 131.7 ms, style.css 71.1 ms, NotoSansJP.woff2 with 404 takes 45.4 ms and is orange, app.js 94.9 ms, tag.js 462.9 ms, hero.jpg 2624.1 ms as the longest bar reaching the right edge, thumb-1.webp to thumb-3.webp 56.5 to 157.4 ms, products/1024 a long bar at 1663.7 ms, and reviews?id=1024 with 503 a red bar at 255.5 ms.
The hero.jpg and products/1024 bars are far longer than the rest. Orange is 404, red is 503.

When the HTML at the top comes back after 131.7 ms, the browser starts fetching the CSS, fonts, JavaScript and images referenced in the HTML all at once. That is why the left ends of the bars in rows 2 to 9 are almost aligned. Among them, only hero.jpg takes 2624.1 ms, with its bar stretching to the right edge. Most of the page’s total 2768.1 ms was spent waiting for this one image.

products/1024 below it also takes 1663.7 ms. Unlike the image, its transfer is only 0.2 KB, so the problem is not large data; the server is apparently taking a long time to send its response.

Besides these, the 404 on NotoSansJP.woff2 and the 503 on reviews?id=1024 stand out by color. For the font’s 404, suspect the file’s location or a typo in the path. A 503 means the server was temporarily unable to respond, and in this example the review section does not appear.

Narrowing to the APIs with search to see sequential waiting

To look more closely at the order of the API calls, narrow things down with “Filter & search”. “Search” matches part of the URL, MIME type, method or domain. Here I entered api.example-shop and clicked “Apply”. Selecting api.example-shop.test from the “Domain” list gives the same result.

The Filter & search section of the English UI. api.example-shop is entered in Search, and Domain, Status and MIME (top-level) are all left at (All). Below are the Apply, Reset and Export CSV buttons.
Enter the API host name in the search box and click Apply.

After filtering, the waterfall and the request list show only the three API requests.

The waterfall filtered to the APIs only. Range: 0 ms – 2768.1 ms (3 entries). products/1024 is a long bar at 1663.7 ms, reviews?id=1024 with 503 is a red bar at 255.5 ms, and stock?id=1024 is a short bar at 111.7 ms that starts where the products bar ends.
stock?id=1024 starts exactly where the products/1024 bar ends.
The Request list in the English UI filtered to the APIs only. Row 1 is GET, 200, application/json, api.example-shop.test, /v1/products/1024, Start 249.0 ms, Time 1663.7 ms, Transfer 0.2. Row 2 is /v1/reviews?id=1024 with 503, Start 249.0 ms, Time 255.5 ms. Row 3 is /v1/stock?id=1024 with 200, Start 1911.0 ms, Time 111.7 ms.
The Start column shows that fetching the stock does not begin until 1911.0 ms.

The product info and the reviews both start at 249.0 ms. The stock request stock?id=1024, on the other hand, starts at 1911.0 ms, which roughly equals the product request’s start of 249.0 ms plus its duration of 1663.7 ms. Fetching the stock is a fast API that finishes in 111.7 ms, but because it is called only after the product response arrives, the stock appears on screen almost two seconds late.

The code on this page was written to fetch the stock after receiving the product info. When the end of one bar lines up with the start of the next in the waterfall, suspect sequential calls like this. If the stock can be fetched without using the product result, simply calling the two at the same time would make the stock appear about 1.6 seconds sooner.

The “Time (ms)” and “Transfer (KB)” columns in the request list also help you tell whether something is slow because of the amount of data or because of server-side processing. hero.jpg has a large transfer of about 3633 KB, so the first step is to shrink the image and compress it with WebP or similar. products/1024 takes 1.6 seconds for only 0.2 KB, so what needs investigating is the processing on the server and whatever it queries.

The “Status” list shows only the statuses that appear in the loaded HAR. In this example there are three, 200, 404 and 503, and selecting 503 lists only the failed requests. “Export CSV” saves the rows currently displayed as har_view.csv. If you capture a HAR before and after a fix and put the CSVs side by side, it is easy to show which requests got faster and by how much.

What the tool cannot tell you: check the HAR JSON or the developer tools

The HAR Viewer is a tool for getting an overview of the requests and of time and transfer size. It does not show request headers, cookie values or response bodies. For duration, it uses only the HAR’s time (the total milliseconds the request took), and does not show the breakdown.

Earlier I guessed from the transfer size that “products/1024 is waiting on the server”, and the HAR also records that breakdown as timings. Open the file in a text editor and find the entry for the URL, and you will see something like this:

"timings": {"dns": 0.021, "connect": 2.044, "ssl": 3.168, "send": 0, "wait": 1651.197, "receive": 7.221}

wait is the time from sending the request until the first byte arrives, and receive is the time to finish receiving the response. For products/1024, wait is 1651 ms, so almost all of it was waiting for the server to respond. Looking at hero.jpg the same way, wait is 82 ms and receive is 2540 ms, so most of the time went into the download. If the HAR’s JSON is crammed onto one line and hard to read, running it through the JSON Formatter makes it easier to search. You can also see the same breakdown by selecting the request in the developer tools’ Network tab and opening the “Timing” tab.

For “Total transfer” and “Transfer (KB)”, the tool prefers the HAR’s _transferSize (recorded by Chrome: the amount actually transferred, including headers and compression). In a HAR without this value, it falls back to bodySize and then content.size, so depending on the browser the figure may be the uncompressed size. Failed requests with no recorded value, like the font in this example, are counted as 0 KB.

Articles and tools that help after reading a HAR

If a request that should be an API call has the MIME type text/html, or the status is 200 but the page shows an error, I explain how to narrow down why HTML comes back in “fetch fails with Unexpected token ‘<’, “<!DOCTYPE “… is not valid JSON”.

If you want to call a slow API again and again yourself to check it, right-click the request in the developer tools, choose “Copy as cURL”, and turn the copied command into Python or JavaScript code with the curl Command Converter. I have written up the steps in “Converting curl commands to Python requests or JavaScript fetch”. If the Authorization token in a HAR saved with sensitive data is a JWT, the JWT Decoder lets you read its expiry and issuer.

Test environment

  • HAR Viewer (operated in the English UI), Chromium 158 (via Playwright 1.63)
  • The four host names in the table were pointed at 127.0.0.1 with Chromium’s --host-resolver-rules, and responses came from a server written with the http module of Node.js 22. Response delays were made with setTimeout, and the product image transfer by sending 64 KB chunks at 45 ms intervals
  • The HAR was recorded with Playwright’s recordHar, without response bodies (sample-product-page.har)
  • The developer tools menu names and the description of sanitized were checked against the English display strings of the DevTools included in Chrome for Testing 153