What this tool does
Checks JSON syntax, indents or removes insignificant whitespace, exports the result, and optionally displays a small parsed tree.
How to use it
- Paste JSON, including an object, array, or standalone JSON value.
- Choose two or four spaces and Format, Minify, or Validate.
- Download the result; open the tree for small inputs if helpful.
Worked example
{"items":[1,2],"active":true} can be indented without changing its literals. An input containing {"items":[1,]} fails validation because trailing commas are not JSON.
Processing and explanation
JSON.parse checks syntax, but the formatter writes original lexical tokens rather than serializing JavaScript numbers. This preserves large integer literals, exponent notation, escape sequences, duplicate keys, and key order in text exports.
Limits and common mistakes
1 MB UTF-8 input and at most 100 nested levels for formatted output. Comments, single-quoted strings, trailing commas, NaN, and Infinity are invalid JSON. Syntax validity does not prove your API schema is correct. The optional parsed tree can round large numbers and keeps only the last duplicate key; the exported text does not.
Privacy and your input
Text is read in this tab. This tool does not upload your text or include it in analytics; clearing the field removes the working input.
Frequently asked questions
- Does formatting validate an API request?
- It validates JSON grammar only. Required fields, allowed values, and server rules need a separate schema check.
- Can I use this on JavaScript objects?
- Only if they follow JSON syntax: quote property names, use double-quoted strings, and remove comments.
Material content update: