Skip to content

Protect Sensitive Data

How to Sanitize JSON Before Sharing It

Redact real credentials and personal data before posting a payload, log, or example. Automated detection helps review; it cannot guarantee that nothing sensitive remains.

Last updated: October 24, 2026

API responses and logs often contain values that should not appear in a bug report or public example: access tokens, API keys, passwords, email addresses, or internal connection strings. MyJSONPal's JSON Secret & Sensitive-Field Sanitizer scans and edits JSON locally in your browser, but the final review is still yours.

Start with a copy and define what must be removed

Keep the original private and work on a copy. Decide what the recipient actually needs to reproduce the issue. Replace credentials with obvious placeholders, and remove values that do not contribute to the example. A token should not be preserved just because its format looks useful; a fake, structurally similar value is safer.

{
  "user": { "email": "person@example.test" },
  "auth": { "accessToken": "demo-token-not-a-credential" },
  "service": { "host": "api.example.test" }
}

Use reserved example domains and invented values in documentation and tickets. Do not paste passwords, production bearer tokens, signing keys, or live API credentials into tools or services you do not trust.

What an automatic scan can—and cannot—find

The MyJSONPal sanitizer recognizes selected token and connection-string patterns, secret-like field names, email-shaped values, hashes, and high-entropy strings. Some categories such as phone numbers, card numbers, IP addresses, and postal addresses are mainly identified from the property name; their values are not reliably detected from content alone.

Pattern matching can miss a credential with an unfamiliar shape and can flag harmless text. Treat matches as review prompts, not proof that the output is clean. Search the final output for known values, field names, and any organization-specific secrets that the scanner could not know about.

Review and add your own redactions

The sanitizer lets you inspect matches in the Keys manager, force-redact additional fields, and add custom substring, wildcard, or regular-expression rules. Review every replacement: changing a value can affect the payload's format or schema. Validate the sanitized JSON and make sure placeholders remain useful without resembling usable credentials.

The tool can restore the raw pasted values in the current session. That is useful if you need to correct a redaction, but it also means you should verify that you are copying the sanitized output—not the original—before sharing.

Before sharing, check the complete result

  1. Confirm the JSON still parses and retains only the structure needed for the discussion.
  2. Search for credential values, personal identifiers, internal hostnames, and private business data.
  3. Check nested objects and array items, not only the top-level fields.
  4. Verify every sample token and key is fake and cannot authenticate to a real system.
  5. If a live credential was exposed, revoke or rotate it through its issuing system.

For an interactive review, open the JSON Sanitizer. For syntax errors in the cleaned document, use Fix JSON and then validate the final output.