DevTools Logo

JSON Redactor

JSON Redactor

Mask sensitive keys, tokens and PII in JSON before you share it. Findings included.

Runs in your browser
Try an example

JSON to redact

Redacted JSON

No redacted JSON yet

Paste a payload or load an example.

JSON Redactor walks a parsed JSON tree and applies key-name rules and value-pattern detection before you share a payload. Built-in rules catch password, token, secret, session and similar keys; patterns cover emails, JWTs, UUIDs, Luhn-valid card numbers, phone numbers and IBANs. Choose fixed masks, partial keep-last-4, deterministic hashes, domain-preserving email masks or key removal. Every change is recorded with a masked sample so the report itself does not leak the original value.

Examples

Bug-report payload

Input
{"user":"ada","email":"ada@example.com","password":"hunter2"}
Output
{"user":"ada","email":"***","password":"***"}

Sensitive keys and the email pattern are masked; the username is untouched.

Luhn-verified card

Input
{"card":"4111 1111 1111 1111","bad":"4111 1111 1111 1112"}
Output
{"card":"***","bad":"4111 1111 1111 1112"}

Only the card number that passes the checksum is masked.

Email inside a note

Input
{"note":"Mail bob@example.org now"} with deep scan
Output
{"note":"Mail *** now"}

Segment replacement preserves the surrounding text outside the match.

Deterministic hash

Input
{"password":"s3cr3t-value"} with hash strategy
Output
{"password":"hash:9d7e4a12"}

The same input always produces the same short digest, useful for correlating records without revealing values.

About this tool

JSON Redactor prepares payloads for sharing. It parses your JSON, walks every object and array, and masks values whose key name looks sensitive or whose content matches a PII pattern. The built-in key list covers password, token, secret, api_key, authorization, session, cookie and similar names, matched case-insensitively.

Value patterns detect emails, JWTs, UUIDs, Luhn-verified card numbers, E.164-style phone numbers, IBANs and an optional custom regex. Card detection runs a real Luhn checksum, so a numeric string that merely looks like a card is not masked by mistake. Deep-scan mode additionally inspects the text inside string values, catching tokens embedded in log messages.

Masking strategies include a fixed ***, partial keep-last-4, a deterministic short hash, a domain-preserving email mask and key removal. The findings table records path, rule, action and a masked sample — never the raw secret. Everything runs locally in the browser, so payloads never leave your machine.

What this tool does not do

  • Detection is heuristic: unusual key names or bespoke token formats need a custom regex.
  • The findings report shows masked samples only; it cannot show the original value for verification.
  • Input is capped at 20 MB and the findings table displays at most 50 rows with a total count.
  • Non-string scalars are untouched by value patterns, although key rules still apply to them.
  • A short deterministic hash is not a secure replacement for a salted cryptographic digest.

How to use this tool

  1. Paste a payload

    Paste any JSON document into the input pane or load one of the example chips.

  2. Choose a mask

    Select the global strategy. Use keep-domain for emails, partial for card-like identifiers, or remove to drop the key entirely.

  3. Enable patterns

    Toggle the value patterns you need and supply a custom regex for project-specific formats.

  4. Review findings

    Check the findings table for paths and masked samples, then copy or download the sanitized JSON.

Use cases

Share a bug report

Sanitize a captured API payload before pasting it into a public issue.

Support handoff

Strip customer emails and tokens from a log excerpt before sending it to a colleague.

Teaching demos

Replace real credentials in sample data with deterministic masks.

Fixture preparation

Remove sensitive keys from production-shaped data before using it in tests.

Mask strategies

StrategyResult for 4111111111111111
fixed***
partial************1111 — keeps the last four Unicode characters
hashhash:9f2c1a0b — deterministic FNV-1a digest, stable across runs
keep-domainKeeps the domain for emails; falls back to a fixed mask otherwise
removeDeletes the key from the output object

Key rules take precedence over value patterns on the same leaf; a matched key is masked once.

Common mistakes

Mistake:Assuming masking is reversible.

Fix:Fixed masks and hashes discard the original value. Keep the source locally if you need to restore it.

Mistake:Relying on key names alone.

Fix:Enable value patterns and deep scan: secrets are often stored in fields like note or message.

Mistake:Using a short hash as a secure credential.

Fix:The digest is a correlation aid, not cryptographic protection; it is intentionally short and unsalted.

Mistake:Expecting every digit string to be treated as a card.

Fix:Card detection requires a valid Luhn checksum; adjust the pattern set if you need to mask other identifiers.

Mistake:Pasting a regex with nested quantifiers.

Fix:The tool rejects patterns like (.+)+ because they can freeze the browser; simplify the expression.

Frequently asked questions

Which key names are redacted by default?

Case-insensitive matches for password, passwd, secret, token, api_key, apikey, authorization, auth, private_key, session, cookie, credit_card and ssn. A key rule matches anywhere in the name by default, and you can switch to exact or regex modes.

How are credit cards detected?

Candidate sequences of 13 to 19 digits, optionally separated by spaces or dashes, are checked with the Luhn checksum. Only sequences that pass are masked, which avoids treating ordinary phone numbers or IDs as cards.

Can I add my own patterns?

Yes. Enter a custom regex and enable the custom pattern. Patterns longer than 200 characters, invalid expressions and nested-quantifier shapes are rejected with an inline explanation to protect the browser from catastrophic backtracking.

Is masking reversible?

No. Fixed masks replace the value entirely, partial masks keep only the last four characters, and the hash is a short unsalted digest meant for correlation, not recovery. Keep an unredacted copy locally if you need the original.

Does my data leave the browser?

No. Parsing, pattern matching, masking and report generation all happen in your browser. Neither the payload nor the findings are uploaded or persisted.

Will the findings report leak the secrets it found?

No. Each finding stores a masked sample — the first and last character with a length indicator — plus the masked result. The raw matched value is never included in the report.

References & standards