Redact a JSON file
Runs locally in your browser. Your file never leaves your device.
By processing a file or pasted text here, you agree to the Terms.
Drop a .json file here — or
API responses, exports, nested payloads — strict JSON, up to 20 MB. A large file can pause this tab for a few seconds while it is scanned; everything stays local.
…or paste JSON instead
Review these — possibly secret
Random-looking strings that match no known secret format, with the JSON path where each lives. They were not masked, because a high-entropy string can be a key or just a checksum — only you can tell.
Original (formatted)
Redacted
Deep JSON is where secrets hide
The JSON files people share when something breaks — an API response, a
webhook payload, a support export, a database dump — are nested. The
Authorization header sits four levels down inside
entries[3].request.headers, the same session token appears
once in a response body and again in the next request, and a
credentials object hides in a corner of a config export
nobody remembers is there. Eyeballing that before pasting it into a
ticket, a GitHub issue, or an AI chat means mentally walking a tree —
and the deeper the tree, the more likely the one value you miss is the
one that mattered. Find-and-replace does not save you either: it fixes
the copy you found and leaves the copy you didn’t.
How this redactor works
It parses your JSON and walks the whole tree — objects, arrays, any
nesting depth. Values under credential-shaped keys
(password, secret, token,
auth, api_key and relatives) are masked whole,
even when the value looks harmless, and even when it is not a string: a
numeric auth code becomes "[SECRET-1]", and an entire
nested credentials object collapses to a single
placeholder — the key survives, the shape of what was under it does
not, and the copy says so rather than pretending otherwise. Every other
string value is scanned by the same pattern engine that powers this
site’s log file redactor: emails,
IPv4/IPv6 addresses, JWTs, AWS keys, Bearer tokens, and key=value
credentials embedded inside strings (a form-encoded body like
password=…&grant_type=password gets the credential
masked and the harmless grant_type left alone). Long
random-looking strings that match neither pass are flagged for review
with their JSON path — never silently changed.
Masked values become deterministic placeholder tokens, and the same
value always becomes the same token: an API key that appears in
config.api_key and again in a request header three levels
deep shows up as the same [SECRET-1] in both places, so
“these two fields held the same value” — often the whole diagnosis —
survives redaction. The output is valid JSON at the indentation you
choose (two spaces by default, four, or minified), keys and structure
stay put, and redacting an already-redacted file changes nothing.
What generic JSON tools don’t do
The web is full of excellent JSON formatters, validators, viewers, and
converter toolkits — and none of them ship a redaction recipe. They will
pretty-print your API response beautifully, secrets included. The gap is
not formatting skill; it is curation: knowing that password,
client_secret, and x-api-key are
credential-shaped names, that a three-segment eyJ… string
is a JWT, and that the same token must be masked consistently everywhere
it appears. That curated knowledge is this page’s entire job — and doing
it in a tab that provably cannot phone home is the other half, because
an online tool you upload secrets to for cleaning is the problem wearing
a different hat.
This page or the config scrubber?
This site’s .env & config scrubber also handles JSON — flat, config-style JSON, which it edits line by line so everything outside the masked values stays byte-identical. This page is for the other kind: deeply nested JSON — API responses, exports, payloads — where line-based editing cannot follow the structure, at the honest price that the file is parsed and re-serialized rather than preserved byte for byte. For the other shape of structured data — a tabular CSV export with PII in columns — the CSV sample anonymizer is the sibling tool, masking whole columns instead of walking a tree.
What it can miss — read this before you share
Detection is pattern-based and best-effort — expand for what can slip through.
Detection is pattern-based and incomplete by construction; any tool
claiming otherwise is overpromising. The specific gaps: a secret under a
bland key — endpoint, dsn, a vendor-specific
name the heuristic doesn’t know — is only caught if the value matches a
pattern or is long and random enough for the suspicious-string flagger
(random strings under about 20 characters slip beneath its statistical
floor). Prose-shaped passwords are invisible to it. Booleans and
null are deliberately never masked, even under sensitive
keys — they carry at most one bit — so "auth": true stays.
And it can over-mask: a vault placeholder under a password
key gets masked like any other value, because masking too much is the
safer failure. Strict JSON only — JSONC, JSON5, comments, and trailing
commas are rejected with a positioned error, never silently repaired.
Re-serialization normalizes formatting: escape sequences become literal
characters, number spellings are canonicalized (integers beyond 2^53
lose precision), and duplicate keys keep only their last value. The
side-by-side preview highlights every change so the final human review
takes minutes, not an afternoon of scrolling JSON.
Practical limits
Files are processed entirely in this tab’s memory with a 20 MB ceiling. Scanning runs on the page’s main thread, so a large file can pause this tab for a few seconds — nothing is being uploaded during that pause; there is no network activity at all, which you can verify in DevTools. Documents nested thousands of levels deep are refused with a clear error rather than crashing the tab. The page works offline once loaded, and nothing persists after the tab closes.
Frequently asked questions
What gets redacted, exactly?
Two passes, at every nesting depth. First, any value whose KEY is credential-shaped — password, secret, token, auth, api_key and relatives — is masked whole, even when the value looks harmless, and even when it is not a string: a numeric auth code or an entire credentials object each collapse to a single placeholder like "[SECRET-1]". Second, every remaining string value is scanned for known secret shapes: emails, IPv4/IPv6 addresses, JWTs, AWS keys, Bearer tokens, and key=value credentials embedded inside strings. On top of that, long random-looking strings that match neither pass are flagged for your review — not changed — with the JSON path where they live.
Does this page upload my JSON anywhere?
No. This is a static page with no server behind it, and its Content-Security-Policy is set to connect-src ‘none’ — the browser itself refuses to let this page make any network request, to us or to anyone. You can verify that: open DevTools, watch the Network tab, and load your file — no request carries your data. Everything runs in this tab’s memory and nothing persists after you close it.
Why doesn’t the output match my file byte for byte?
Because this tool parses your JSON and re-serializes it — that is what makes structure-aware redaction at any depth possible. The values and structure are preserved, but formatting details are normalized: whitespace follows the indentation you choose, \u escape sequences become literal characters, number spellings are canonicalized (1e3 becomes 1000, and integers beyond 2^53 lose precision), and if a file illegally repeats a key, only the last copy survives, matching how JSON.parse reads it. If you need the file kept byte-identical outside the masked values, a flat config-style JSON is better served by the config scrubber on this site, which edits line by line instead of re-serializing.
Can I keep the file minified?
Yes. Pretty-printing at two spaces is the default because the point of sharing a redacted file is usually that a human reads it, but the indentation control also offers four spaces or “minified (one line)” for payloads that go back into a pipeline. The side-by-side preview always shows both versions formatted, whatever you pick — the download honors your choice.
Does it accept JSONC, JSON5, or trailing commas?
No — strict JSON only, deliberately. Comments, single quotes, unquoted keys, and trailing commas are rejected with an error that names the line and column, and nothing is output: a redactor that silently “repairs” input on the way through would be quietly rewriting parts of your file it never showed you. Strip the file back to standard JSON (most editors and linters can) and retry.
Can it miss secrets?
Yes. Detection is pattern-based and incomplete by construction. A secret under a bland key — endpoint, dsn, a vendor-specific name — is only caught if the value itself matches a known pattern or looks random enough for the entropy flagger (random strings under about 20 characters stay below its statistical floor). Prose-shaped passwords are invisible to it, and booleans and nulls are deliberately left alone. It can also over-mask: a vault placeholder under a password key gets masked anyway, because masking too much is the safer failure. The side-by-side preview highlights every change and flags what merely looks suspicious, so the final human review — the step no tool can replace — is fast. Never treat any automated redactor, this one included, as guaranteed.