Using JSON Formatter: practical guide
Fixing the errors people hit most
JSON is stricter than JavaScript object syntax. If validation fails, check these first:
- A trailing comma after the last item in an object or array.
- Single quotes instead of double quotes around keys or strings.
- Unquoted keys such as {name: "A"}.
- Comments, which JSON does not allow.
- A missing or extra closing bracket, usually near where the error is reported.
Format for reading, minify for sending
Pretty-printing with indentation makes nested data readable for reviews and debugging. Minifying removes the whitespace, which makes payloads smaller when you embed JSON in a config value or send it over a network. The tool validates the JSON before minifying, so a successful minify also tells you the input was valid.
Watch out for large numbers
JavaScript represents numbers as 64-bit floats, so integers above 9,007,199,254,740,991 can lose precision when parsed. If you work with long IDs, send them as strings. Your data stays in your browser the whole time.