JSON requires precise syntax
Property names and strings need double quotes. Comments, trailing commas, undefined and single-quoted strings are not allowed.
A valid example is {"name":"Bivonio","local":true}. Formatting adds indentation and line breaks; minification removes formatting without removing spaces inside a string.
Read a validation error
On failure, inspect the reported position, line or column when available. A missing comma can cause an error at the following element.
Formatting does not automatically repair an invalid document. Correct the input and validate again.
- Paste JSON without Markdown wrappers.
- Choose 2 or 4 spaces for formatting.
- Validate and inspect the output structure.
- Minify only after confirming the data is correct.
Precision and duplicate keys
The browser’s JSON.parse and JSON.stringify are used. Integers beyond JavaScript precision may change, and the last duplicate key is retained.
To preserve very large numbers, store them as strings or use a specialized workflow. The tool is local; formatting does not encrypt or anonymize data.