How to format, validate and compare JSON
Paste or load JSON in the JSON workspace to format, minify or validate it, browse a collapsible tree, compare a second document or redact selected field names. Each operation runs in your browser, and input history is not saved by the tool. Use the result as a debugging aid and review it before sharing: field-name redaction is not a guarantee that every secret has been removed.
Load and validate before changing data
Use the file input for a JSON document or paste text into Input JSON. Validate checks syntax using the native parser and applies the tool's numeric safety checks. A success message means the input parsed under those rules. It does not mean an API will accept the document, that required business fields exist, or that values conform to a JSON Schema.
If parsing fails, inspect commas, quotation marks and matching brackets. The reported message comes from parsing or the tool's checks; there is no automatic repair control. Correct the original input and validate again. Very deeply nested data can fail during recursive inspection even when its syntax is otherwise valid. Keep the original text available if you need an untouched reference.
Format, minify and explore
Format produces readable JSON with two-space indentation. Minify removes optional formatting whitespace from the serialized result. Neither action changes the original file saved on your computer. Tree view provides expandable object and array nodes so you can inspect structure without scrolling through every line. It does not offer an editable tree or a query language in this release.
Output can be copied or downloaded as JSON. Clipboard access depends on browser permissions and context. If copying fails, select the output text and copy it manually. The Clear all button removes the visible inputs, output and tree from the workspace. Files already downloaded remain wherever you saved them.
Worked example: compare two responses
Put the first object below in Input JSON and the second in Second JSON, then choose Compare. The result reports the changed active value, but does not treat the different placement of id as a change. Object key order is ignored. Added and removed properties receive their own change records, with paths identifying where each difference occurred.
First: {"id":"001","active":true}
Second: {"active":false,"id":"001"}Arrays compare by position, not by an identifier inside each item. Changing ["red","blue"] to ["blue","red"] therefore reports changed positions. This is useful when order matters, but do not interpret a positional diff as a record-matching report. For tabular exports with unique record keys, the CSV comparison workflow may be more appropriate.
Worked example: redact nested fields
Suppose you need to share an example response containing an email and token. Enter email,token in the comma-separated field list, then choose Redact fields. Matching is exact by property name, without case sensitivity, and traverses nested objects and arrays. The output below shows the intended replacement rather than a deletion of the property itself.
Input: {"user":{"email":"[email protected]","TOKEN":"example"}}
Output: {"user":{"email":"[REDACTED]","TOKEN":"[REDACTED]"}}A field named access_token does not match token automatically. A secret inside a notes string is not found just because the value looks sensitive. Review unexpected field names, URLs, free-text values and nested content before sending output to another person. Redaction reads the first input; it does not automatically continue from a previous comparison or formatted output.
Keep numeric and structural limits in mind
Use quoted strings for large IDs, such as "9007199254740993". The tool rejects unsafe parsed integer values and numbers outside the finite JavaScript range. Parsing still uses JavaScript numbers, so decimal fractions may round. If duplicate property names occur in one object, the native parser keeps the last value. Neither formatting nor validation can recover an earlier duplicate after parsing.
Limits to know
- Validation checks native JSON parsing and the numeric guards, not JSON Schema or application-specific requirements.
- Repeated keys keep their final value, and decimal values follow JavaScript number precision.
- Extremely deep nesting can exceed recursion limits; large documents also depend on browser memory.
- Exact-name redaction does not identify secrets inside values. No cloud history, automatic repair or guaranteed anonymization is included.
Frequently asked questions
Does it validate against a JSON Schema?
No. It checks that the text is valid JSON using the browser's own parser. It does not apply a JSON Schema.
Does the diff care about key order?
No. Two objects with the same keys and values in a different order are treated as equal. Array order still matters.
How does redaction work?
It replaces the value of every field with a name you list by [REDACTED], at any depth. It matches exact property names, so it will not find a secret that is hidden inside a value.
What about very large numbers?
Unsafe parsed integer values are rejected. Quote large IDs as strings; native parsing still follows JavaScript precision.