JSON Formatter
Beautify, minify and validate JSON, with the exact line and column of any error.
Paste or type JSON to validate it.
Features
- Pretty print with 2-space, 4-space or tab indentation
- Minify to a single line and see the bytes saved
- Exact line and column for every syntax error
- Optional alphabetical key sorting
- Handles deeply nested structures and large payloads
How to use it
- Paste your JSON into the input box.
- Pick an indentation style.
- Press Beautify to format, or Minify to compress.
- Copy the result or download it as a .json file.
Common JSON errors
Four mistakes account for most parse failures. A trailing comma after the last item in an object or array is valid in JavaScript but not in JSON. Single quotes are not permitted, JSON strings require double quotes. Keys must always be quoted, even when they look like plain identifiers. And unescaped control characters, particularly literal newlines inside a string, will stop the parser cold.
When this tool reports an error it gives you the line and column, which is usually enough to spot the problem immediately. Note that the reported position is where the parser gave up, which is sometimes just after the actual mistake, a missing comma on line 8 often surfaces as an error at the start of line 9.
Frequently asked questions
Related tools
Further reading
Read the full guide on the 123MiniApps blog.