HARScopeChrome extension · Free · 0 permissions · v1.1.0Add to Chrome

How to sanitize a HAR file before you share it

Updated 23 October 2026 · 6 min read

Short answer: Export the HAR with Chrome's Export HAR (sanitized)…, which leaves out the Cookie, Set-Cookie and Authorization headers. Then check the file for what that export keeps: tokens in URLs, form data, other credential headers and response bodies. You can replace those values by hand in a text editor, or open the file in HARScope and use Clean & save…. It saves a new copy with secret values replaced by REDACTED and leaves your original untouched. No tool catches everything, so skim the result before you send it.

Why a HAR file needs cleaning

A HAR file records everything your browser sent and received while DevTools was recording. That can include session cookies, Authorization headers, API keys, one-time codes in URLs, passwords typed into forms and personal data in server answers. A live session cookie or token can let whoever holds the file act as you on that site until it expires. Support teams ask for HAR files because they show exactly what went wrong. Before you send one, remove what lets someone sign in as you. If you are new to the format, start with what a HAR file is.

Step 1: export the sanitized version in Chrome

In Chrome DevTools, the Network panel's default HAR export is Export HAR (sanitized)…. Google documents it as leaving out sensitive data such as the Cookie, Set-Cookie and Authorization headers. A full export that keeps them exists, but only after you turn on Allow to generate HAR with sensitive data in DevTools settings. Send the sanitized one unless the person asking explains why they need more. Step-by-step instructions for Chrome, Edge, Firefox and Safari are in how to create a HAR file.

The sanitized export is a good start, not a full clean-up. It can still contain:

Step 2, option A: clean it by hand

  1. Make a copy of the file and open the copy in a text editor.
  2. Search for words such as cookie, authorization, token, password, key, session and your email address.
  3. Replace each value, not the name, with something like REDACTED.
  4. Keep the quotes and commas, so the file is still valid JSON.
  5. Open the edited file in a HAR viewer to make sure it still loads.
Pros
  • No tool needed.
  • You decide about every value.
Cons
  • Slow on large files.
  • Easy to miss a token in a long URL or body.
  • One stray character breaks the JSON.
HARScopeOpen, analyze and clean HAR files offline
Add to Chrome — free

Step 2, option B: Clean & save in HARScope

HARScope is a free Chrome extension that opens HAR files on your own computer. It has no permissions and makes no network requests. The same viewer also runs on the web as the HAR analyzer. Clean & save arrived in version 1.1.0.

  1. Open the HAR file: drop it on the page, or click Open HAR file….
  2. Look at the summary bar. It shows Contains secrets: … — clean before sharing with counts per kind, or No cookies or auth headers found.
  3. Click Clean & save… (or that summary chip). The dialog Clean this HAR before you share it opens.
  4. Tick what to replace. Each option shows how many values it found. Options with nothing to replace are greyed out.
  5. Click Save cleaned copy. Your browser saves a new file, and the dialog says Saved … — … values replaced. Your original file is unchanged.

The new file has the original name with .cleaned.har instead of .har. A note in the file's comment field says it was cleaned with HARScope.

The six options

Option in the dialogWhat it replacesTicked by default
CookiesValues in Cookie and Set-Cookie headers and in the file's cookie listsYes
Authorization, token and API-key headersHeaders whose names contain words such as auth, authorization, token, key, secret, session, password, signature, csrf or bearer. Also token-shaped values under any other header nameYes
Tokens and keys in URLsSecret-named parameters in query strings and #fragments, OAuth code and state, passwords in user:password@, ;jsessionid=-style parameters. Covers request URLs, redirect targets, Referer, Location and Origin headers, script initiator URLs and page addressesYes
Request bodies and WebSocket messagesThe whole body of every request (form fields, passwords, JSON) and every WebSocket messageYes
Response bodiesThe whole body of every responseNo: support often needs to see what the server returned
Tokens inside the bodies you keepIn bodies that stay: secret-named JSON fields and form fields, and token shapes such as JWTs and API keysYes

The token shapes HARScope recognises anywhere in a value are JWTs, AWS access key IDs, GitHub tokens, Slack tokens, Stripe secret keys and Google API keys.

A few headers are kept on purpose because they carry what a sign-in or cross-origin investigation needs: the Access-Control-… headers, WWW-Authenticate and Authentication-Info, and the WebSocket handshake keys. In JSON bodies, fields named code or state are left alone, because there they are usually ordinary data.

What sanitizing does not remove

Both Chrome's export and HARScope work by names and patterns. Neither understands what your data means. After cleaning, these can still be in the file:

Clean & save writes a new file. The file open in HARScope stays as it was, so Copy as cURL and Copy response still copy the original values, cookies included. Copy report replaces secret-looking URL parameters, but only in the report text.

Chrome, by hand or HARScope

Chrome sanitized exportBy handHARScope Clean & save
Cookie, Set-Cookie, AuthorizationLeft outIf you find themValues replaced
Other credential headersNot documented as removedIf you find themReplaced when the name matches
Tokens in URLsNot documented as removedIf you find themReplaced when the name or shape matches
Request bodiesNot documented as removedIf you find themReplaced whole, or only their tokens
Response bodiesNot documented as removedIf you find themOptional
Original fileNot applicableEdit a copyNever changed

Before you send it

  1. Record only what support needs, ideally with a test account and without signing in during the recording.
  2. Export the sanitized version.
  3. Clean it with HARScope or by hand.
  4. Open the cleaned file and search it for your email address, your name and the word token.
  5. Send it only through the support team's own channel, not a public forum.
  6. If you think a live session was in the file, sign out of that site afterwards.
HARScopeOpen, analyze and clean HAR files offline
Add to Chrome — free

Questions

Does Chrome's "Export HAR (sanitized)" remove everything sensitive?

No. Google documents it as leaving out sensitive headers such as Cookie, Set-Cookie and Authorization. Tokens in URLs, form data, other credential headers and response bodies can still be in the file.

Does HARScope change my original HAR file?

No. Clean & save writes a new copy with ".cleaned.har" at the end of the name. The file you opened is not changed.

What does HARScope replace secrets with?

The word REDACTED. Cookie, header and parameter names stay, so the person you send the file to can still see what was sent.

Should I remove response bodies?

Only if they hold data you must not share. Support often needs to see what the server answered, so HARScope leaves the Response bodies box unticked by default.

Does HARScope upload the file to clean it?

No. The extension has no permissions and its page cannot make network requests. The web analyzer runs the same code inside a frame that cannot make network requests either.

RelatedHow to create a HAR fileWhat is a HAR fileHow to open a HAR file