Tekno101
Guides

Format JSON without losing sight of the data

Use formatting to understand structure, then check the values before importing a generated file.

Validate before formatting

JSON consists of objects, arrays, strings, numbers, booleans and null. Object keys and strings need double quotes. Comments, single-quoted strings and a comma after the final item are not part of JSON.

Paste your input or select a UTF-8 file, then process it. The formatter parses the whole input before creating either output. A syntax error leaves you on the input page with a retryable error.

{"person":{"name":"Ada","active":true},"scores":[12,18]}

Readable and minified outputs

The formatted file uses two-space indentation and ends with a newline. The minified file removes formatting whitespace without removing spaces inside strings. Both outputs are available on the same result page as separate downloadable cards.

Download the version suited to your task. Indentation helps reviews; minification reduces bytes for transport. A smaller file is not evidence that the data has become safer or more accurate.

Know what parsing changes

This tool uses JSON.parse and JSON.stringify in your browser. Duplicate object keys retain the last value. Numbers use JavaScript precision, so identifiers and integers above 9,007,199,254,740,991 should be strings. Negative zero is serialized as zero.

A syntactically valid JSON document can still violate the schema expected by an API. Check required fields, types, units and allowed values separately. This tool does not claim to validate an application schema.

Repeatable final check

Open the downloaded JSON in your editor and compare meaningful values against the input. For a fixture, use a small object containing a string, boolean, array and null, then verify each value after formatting.

Results stay in the current browser for one hour. Refreshing keeps the result available until expiry; another browser or device cannot access the file from its result URL.

Open tool