Developer tool

JSON formatter and validator

Pretty-print or minify JSON and catch parse errors without sending the text to a server.

What validation checks

The browser parses the text using the JSON grammar. Valid JSON requires double-quoted property names and strings, supported escape sequences, commas only between items, and no comments. Values may be objects, arrays, strings, numbers, true, false, or null.

Formatting does not change the data model

Pretty-printing adds line breaks and indentation after parsing. Minifying removes insignificant whitespace. Both operations serialize the parsed value again, so original whitespace and escape choices are not preserved. Duplicate object keys are especially risky because parsers commonly retain only the last value.

JSON is not JavaScript source

Single quotes, undefined, NaN, Infinity, functions, trailing commas, and unquoted keys may appear in JavaScript but are not valid JSON. Dates and large integers also have no special JSON type. A large integer can lose precision when parsed as a JavaScript number, so identifiers and exact high-precision values may need to remain strings.

Privacy and sensitive data

This tool runs entirely in the current browser tab and does not intentionally upload the entered JSON. Even so, avoid pasting secrets into any environment you do not control, and clear the field when working on a shared device.

Validate syntax, then validate meaning

Try a small object such as {"item":"pen","quantity":2}. Formatting should place its members on readable lines, while minifying should return the same object without unnecessary spaces. Now remove the closing brace: the parser should report an error instead of producing output. Restoring the brace proves only that the text follows JSON syntax.

Next compare the parsed fields with the receiving system’s contract. It may require quantity to be a positive integer, reject an unknown item, or require another field even though the JSON is valid. When editing an important configuration, retain the last working version, compare the formatted result before replacing it, and test it in a non-production environment. Do not use formatting as evidence that credentials are absent, values are trustworthy, or an API will accept the document.

Formatting proves only that the text is syntactically valid JSON. It does not verify a schema, required fields, value ranges, security, or suitability for a particular API.