How to use the JSON Formatter
- Paste your JSON into the input box.
- Click Format to pretty-print it with indentation, or Minify to compact it to one line.
- If the JSON is invalid, an error message will point to the problem so you can fix it.
How formatting and validation work
The tool parses your input using the standard JSON parser, which strictly enforces the JSON specification — double-quoted keys and strings, no trailing commas, and valid nesting of objects and arrays. If parsing fails, the browser's own error message (which includes the position where parsing broke) is shown to help you locate the issue. On success, the parsed structure is re-serialized either with indentation (format) or without any extra whitespace (minify).