A HAR file is an archive saved in the HTTP Archive (HAR) format, which is a JSON-formatted format used to save collected HTTP performance data. It contains information about webpages a web browser has loaded, which includes the tracked webpages, response times, and web browser version. HAR files also store metadata, such as the HAR format version and the creator of the file.
HAR file open in Microsoft Visual Studio Code 1
The purpose of the HAR format is to log the performance of web browsers, which allows developers to analyze how well the browsers are loading webpages. HAR files may be exported by various HTTP-related tools, such as Electron HAR, HttpWatch, HTTP Toolkit, but are typically exported by web browsers. Most browsers support the format, including Google Chrome, Mozilla Firefox, Apple Safari, and Microsoft Edge and Internet Explorer.
You can open HAR files with various programs, including the online HAR Viewer tool and the open source, cross-platform HTTP Toolkit. Since HAR files are saved in JSON format, you can also open them using a JSON editor or a plain text editor, such as Microsoft Notepad or Apple TextEdit.
If you open a HAR file in a text editor, you will see the contents in the JSON format organized into the following object types:
- log - Includes information about the HAR format version, log creator, browser version, and list of tracked webpages.
- creator - Includes information about the creator of the log.
- browser - Includes information about the browser.
- pages - Includes information about the list of exported webpages.
- pageTimings - Includes information about the events fired during the page load in milliseconds.
- entries - Includes information about all the HTTP requests.
- request - Includes information about performed requests, including the request method, cookie and header objects, and query parameter objects.
- response - Includes information about the response status, status description, HTTP version, and cookie and header objects.
- cookies - Includes information about all the cookies in the request and response objects.
- headers - Includes information about all the headers in the request and response objects.
- queryString - Includes information about the parameters and values parsed from a query string.
- postData - Includes information about any posted data in the request object.
- params - Includes information about any posted parameters in the postData object.
- content - Includes information about response content in the response object.
- cache - Includes information about a request from the browser cache.
- timings - Includes information about the request and response timings in milliseconds.
NOTE: The HAR format is developed by the Web Performance Working Group of the World Wide Web Consortium (W3C).