Introduction
A HAR file records what a web browser fetched while loading pages: every request and response, with headers, cookies, bodies and timings. Browsers’ developer tools save one from their Network panel, and support teams often ask for a HAR file to see why a site misbehaves.
A HAR file is JSON. Because it holds cookies, sign-in tokens and form data as they were sent, it should be treated as secret and cleaned before it is shared.
Structure
The top-level object has one member, log.
It holds the format version (usually 1.2), a creator naming
the program that wrote it, an optional browser, a list of
pages with their titles and load timings, and a list of
entries, one per request.
Each entry gives the time the request started, its total time, the
request (method, URL, HTTP version, headers, cookies, query string and any
posted data), the response (status, headers, cookies, and the body under
content, as text or base64), cache details, and timings broken
into blocked, DNS, connect, SSL, send, wait and receive, in milliseconds.
{
"log": {
"version": "1.2",
"creator": { "name": "…", "version": "…" },
"pages": [ … ],
"entries": [
{ "startedDateTime": "…", "time": 120,
"request": { … }, "response": { … },
"cache": { }, "timings": { … } }
]
}
}
Not described
These pages follow the HAR 1.2 specification draft. A HAR file is JSON, so the explorer shows it as JSON; it has no HAR-specific viewer.
Known, not yet covered
- Reference: the original specification page by Jan Odvarko was not read; the draft is the only source used.
- Viewer: there is no HAR plugin: pages, entries, timings and bodies are not shown as such.
Unknown
- Reference: where the draft contradicts itself, for example whether a log without pages
leaves the field out or holds an empty array, and whether
cacheis required but may be omitted.
Links
Software
- Chrome and Edge DevTools – export and import HAR files in the Network panel (Windows, macOS, Linux)
- Firefox Developer Tools – save and import HAR files in the Network panel (Windows, macOS, Linux)
- Safari Web Inspector – exports HAR files from the Network tab (macOS)
- Charles Proxy – web debugging proxy that imports and exports HAR files (Windows, macOS, Linux)
- Fiddler – web debugging proxy that imports and exports HAR files (Windows, macOS, Linux)
Developers
- Playwright – browser automation that records and replays HAR files (JavaScript, Python, Java, .NET)
Reference
- HTTP Archive (HAR) format – the W3C draft specification