LocalUtils field note · Validate, format, minify, and scrub JSON deliberately
Validate, format, minify, and scrub JSON deliberately
JSON is strict about quotes, commas, brackets, and value types. Formatting can make a document readable, while minification removes insignificant whitespace. Neither operation changes whether the data is sensitive.
The scrubber applies user-selected field-name rules after parsing valid JSON. It is a convenience for predictable structures, not a semantic privacy detector, and nested values can still reveal the same information under another key or inside free text.
Quick start
- Paste or type a copy of the JSON and validate it before making assumptions about the structure.
- Use formatting for review and minification only when a compact representation is actually required.
- Configure scrub rules for exact field names used in the document, then inspect every replacement in context.
- Copy or download the result and validate it again in the destination system.
device → browser engine → result
What the browser does
The browser parses the input with JavaScript JSON handling, recursively applies configured key rules, and serializes the result with or without indentation.
Current input and scrub preferences are stored in localStorage for convenience. That persistence is useful on a personal device but inappropriate for confidential data on a shared browser profile.
Inputs and outputs
- Input: one valid JSON value, including an object, array, string, number, boolean, or null.
- Output: formatted, minified, or scrubbed JSON text.
- Comments, trailing commas, NaN, Infinity, and JavaScript object syntax are not standard JSON.
Limits to know before you start
- A valid document can still have the wrong schema or misleading values.
- Key-based scrubbing misses secrets stored under unexpected names or embedded in text.
- Large pasted documents can make the editor and browser storage slow.
- Formatting does not encrypt, anonymize, or validate business rules.
Troubleshooting
- Use the reported position near a parse error and inspect the preceding comma, quote, or bracket.
- If a rule changes too much, narrow the field-name match and rerun from the original.
- If the editor becomes slow, use a file-oriented or streaming workflow rather than pasting multi-megabyte data.
Verification checklist
- Parse the final output in a second JSON parser.
- Search for every original sensitive value, not only the expected key name.
- Compare counts and required fields with the source schema before using the result.
Questions people ask
Does formatting change values?
It should only change insignificant whitespace, but always validate and compare data when exact serialization matters.
Is scrubbing anonymization?
No. Removing selected keys does not address indirect identifiers, free text, correlations, or external copies.
Why is my JavaScript object rejected?
JSON requires double-quoted keys and strings and does not support comments, functions, undefined, or trailing commas.
