HAR Fixer
Free · Open source · Runs in your browser

Fix HAR files so Google HAR Analyzer opens them

A customer sent a HAR and Google's analyzer won't open it? HAR Fixer repairs broken, sanitized and truncated HAR files: redacted base64 bodies, bad JSON, missing requests, invalid dates. Your file never leaves this tab.

Drop a .har file here

or click to choose. JSON exports work too. Processed locally, never uploaded.

    Open Google HAR Analyzer ↗

    Google HAR Analyzer errors this fixes

    We traced these messages to the exact lines in the analyzer's JavaScript. One bad request is enough for it to reject the whole file, even when the HAR is otherwise valid.

    Unknown base64 encoding at char: [

    The most common one, and it comes from sanitized HARs. Sentry, HAR sanitizer tools and redaction scripts swap a large body for a placeholder such as [text/javascript redacted], but leave "encoding": "base64" and the original size (e.g. 3,533,145). The analyzer base64-decodes every non-image body while loading, reaches [ and gives up on the whole file.

    Fix: drop the base64 flag only where the text isn't valid base64, and set size to the placeholder's length. Real images and fonts keep their encoding.

    Unable to process the HAR file: SyntaxError…

    The file isn't valid JSON. Usually there's a UTF-8 byte-order mark at the start, trailing commas from a hand-edited or scripted export, or the file was cut off because the browser or a size limit stopped it partway through.

    Fix: strip the BOM, remove trailing commas and cut a truncated file back to the last complete request, then close the JSON properly.

    URIError: URI malformed

    A response labelled application/x-www-form-urlencoded contains a stray % (like 100%) or a truncated escape. The analyzer runs decodeURIComponent() on it and throws.

    Fix: relabel just that body as text/plain. The text itself is untouched.

    No log entries found in the file.

    Google needs log.entries with at least one request. Some tools write a bare array, wrap the HAR in {"har": …} or put entries at the top level.

    Fix: move the entries back under log. If the recording really has zero requests, record it again (see below).

    Silent failures: blank page or a frozen spinner

    A null entry, a numeric mimeType or method, a header whose name is a number, or "timings": "fast" all throw deep inside the loader without a readable message.

    Fix: drop null entries, convert these fields to strings or numbers, and add missing request, response, content, timings and cache objects.

    Invalid dates and non-numeric timings

    A startedDateTime of "bad" or an epoch number, or time: "n/a", breaks the waterfall and sorting, and trips up other HAR viewers too.

    Fix: epoch values become ISO 8601 and invalid ones get a valid timestamp. Timings and sizes are converted to numbers, with -1 meaning "not available" as the HAR 1.2 spec says.

    How it works

    HAR Fixer checks the file the same way Google's loader does, then changes only what would crash it. A normal HAR from Chrome, Edge, Firefox or Safari comes out unchanged.

    1

    Diagnose

    The file is parsed locally and run through a replica of the analyzer's load path. You see exactly which request would crash it and why, before anything is changed.

    2

    Repair

    JSON is recovered, the HAR 1.2 structure is normalized, and the three sanitizer bugs (stale base64 flags, inflated placeholder sizes, malformed urlencoded bodies) are fixed. Each kind of change gets one summary line.

    3

    Verify & download

    The fixed HAR goes through the Google check again before you download name.fixed.har. You can also redact secrets before you share it.

    How to record a HAR file

    If you're asking a customer for a HAR, send them this. Open the Network panel before reproducing the problem, or the file will be empty.

    BrowserSteps
    Chrome / EdgePress F12 (Mac: ⌥⌘I) → Network tab → tick Preserve log → reproduce the issue → click the Export HAR (download arrow) button. Newer Chrome versions export a sanitized HAR (no cookies or auth headers) by default. That's fine for most support cases.
    FirefoxF12Network → gear icon → Persist Logs → reproduce → right-click any request → Save All As HAR.
    SafariSettings → Advanced → Show features for web developers⌥⌘INetworkPreserve Log → reproduce → Export.
    Charles / Fiddler / proxiesExport the session as HTTP Archive (.har). These exports often use loose dates and non-standard fields. Run them through HAR Fixer before opening them in Google's analyzer.

    Your HAR never leaves your browser

    HAR files carry session cookies, bearer tokens and personal data, so uploading them to a random website is risky. HAR Fixer is a static page: the file is read with the browser's FileReader, fixed in JavaScript and saved with a local download link. The server's Content-Security-Policy sets connect-src 'none', so the page can't send data anywhere. You can check this in DevTools, or read the source and run it offline.

    Command line & self-hosting

    The same fixer runs in Node.js with no dependencies. It's handy for support teams that process a lot of customer HARs.

    # fix a file
    git clone https://github.com/fsmaster/har-fixer && cd har-fixer
    node cli.js customer.har customer.fixed.har
    
    # only diagnose: exits 1 if Google HAR Analyzer would reject it
    node cli.js customer.har --check
    
    # redact cookies/tokens/bodies and drop Chrome's _fields before sharing
    node cli.js customer.har clean.har --sanitize --strip-custom
    
    # run the web UI locally
    python3 -m http.server 8080   # → http://127.0.0.1:8080

    FAQ

    Why does Google HAR Analyzer say “Unknown base64 encoding at char: [”?

    The HAR was sanitized. The tool replaced a response body with a placeholder such as [text/javascript redacted] but left content.encoding set to base64. Google tries to decode the placeholder, hits the [ character and rejects the whole file. HAR Fixer removes the stale flag only on bodies that aren't valid base64.

    What does “Unable to process the HAR file” mean?

    The file isn't valid JSON: a byte-order mark, trailing commas, or an export that was cut off. HAR Fixer repairs all three. A truncated file is recovered up to the last complete request.

    Why does it say “No log entries found in the file.”?

    The analyzer needs a log.entries array with at least one request. HAR Fixer rescues entries stored in the wrong place. If there really are none, the Network panel wasn't open while the issue happened. Record it again.

    Is my HAR file uploaded anywhere?

    No. Everything runs in your browser. The page's Content-Security-Policy blocks all outgoing requests, and the code is open source.

    Will HAR Fixer change a HAR that is already valid?

    No. Valid HARs from Chrome, Edge, Firefox and Safari pass through unchanged, and every change it does make is listed after the fix.

    Can I remove passwords and cookies from a HAR before sharing it?

    Yes. Tick Extra sanitize to empty cookies, redact Authorization, Cookie, Set-Cookie, API-key and x-*auth* headers, redact tokens in URLs and replace bodies with [REDACTED]. The result still loads in Google HAR Analyzer.

    My HAR is huge. Will it work?

    Files of a few hundred MB work in desktop Chrome and Firefox. The limit is your browser's memory, not a server. Tick Drop response bodies to shrink the output a lot while keeping the full request waterfall and timings.

    Does it work with HAR files from Charles, Fiddler, Postman or Playwright?

    Yes. HAR Fixer normalizes anything that is roughly HAR 1.2: header objects instead of arrays, epoch dates, string timings, missing creator or pages, and nested or bare entry arrays.

    Fixed HAR