HAR File Format: HTTP Archive Files Explained
A HAR (HTTP Archive) file is a JSON recording of everything a browser loaded for a page: every request and response, with headers, cookies, timings and often the response bodies. Support teams ask for HAR files to debug slow pages, failed logins and API errors.
The format began as a W3C draft that was never finalized, but every major browser and many tools such as Charles and Fiddler read and write it.
{
"log": {
"version": "1.2",
"creator": { "name": "WebInspector", "version": "537.36" },
"entries": [
{
"startedDateTime": "2024-03-01T10:15:30.123Z",
"time": 182.4,
"request": {
"method": "GET",
"url": "https://api.example.com/v1/orders?page=2",
"headers": [{ "name": "Accept", "value": "application/json" }]
},
"response": {
"status": 200,
"statusText": "OK",
"content": { "size": 5321, "mimeType": "application/json" }
},
"timings": { "blocked": 1.2, "dns": -1, "connect": -1, "send": 0.3, "wait": 170.8, "receive": 10.1 }
}
]
}
}Convert HAR files
- Convert HAR to CSV— Convert a Chrome/Firefox HAR network log to a CSV for analysis
- Convert HAR to Excel— Convert a Chrome/Firefox HAR network log to an Excel spreadsheet
- Convert HAR to JSON (simplified)— Flatten a HAR network log to a simple JSON array of requests
- Convert HAR to curl commands— Convert each request in a HAR network log to a shell curl one-liner
What a HAR file contains
Everything sits under log.entries, one entry per request:
- request: method, URL, HTTP version, headers, cookies, query string and posted form data
- response: status code, headers, cookies, MIME type, size and often the body text
- timings: time spent in each phase in milliseconds: blocked, dns, connect, ssl, send, wait (time to first byte) and receive. A value of -1 means the phase did not apply, for example a reused connection
- startedDateTime and time: when the request started and how long it took in total
How to export a HAR file
Tick "Preserve log" (Chrome) or "Persist Logs" (Firefox) if the problem happens across a redirect or a login.
- Chrome and Edge: open DevTools (F12) → Network, reload the page, then click the download arrow (Export HAR)
- Firefox: DevTools → Network, reload, right-click any request → Save All As HAR
- Safari: enable the Develop menu, open Web Inspector → Network, reload, click Export
HAR files and sensitive data
A HAR file can contain session cookies, Authorization headers, API tokens and anything typed into forms, including passwords. Anyone who has the file may be able to take over your session. Recent Chrome versions export a sanitized HAR by default that leaves out cookies and authorization headers, but check before you share a file, or share a CSV summary instead.
How to open a HAR file
- Drag it into the Network tab of Chrome or Edge DevTools, or use Import HAR in Firefox
- Google's HAR Analyzer in the Admin Toolbox
- Charles Proxy or Fiddler
- Any JSON viewer or text editor
- Excel or Google Sheets, after converting it to CSV or XLSX
Frequently Asked Questions
- Is it safe to share a HAR file?
- Only after checking it. HAR files can include cookies, authorization headers and form data. Converting it to CSV keeps the URLs, status codes and timings but leaves out headers, cookies and bodies.
- How do I find slow requests in a HAR file?
- Convert it to CSV or Excel and sort by total time. A high wait time means the server was slow to respond; a high receive time means a large or slow download.