JSON formatter
Pretty-print, minify, and validate JSON with precise error locations.
How it works
JSON.parse validates your input. Pretty output uses JSON.stringify with your chosen indent (2 spaces, 4 spaces, or tab). Minify removes whitespace. Parse errors report line and column from the character offset. Input stays in page memory; practical limit about 5 MB of text.
Runs in your browser; nothing is uploaded.
FAQ
Does this fix invalid JSON automatically?
No. It reports where parsing failed so you can edit the source. Trailing commas, single quotes and comments are not valid JSON and are not auto-corrected.
Will number precision change?
Formatting round-trips through JSON.parse and JSON.stringify. Very large integers may lose precision because JSON numbers are IEEE doubles in JavaScript.
Can I format JSON with non-ASCII text?
Yes. UTF-8 text is preserved as written; the output is not converted to \u escapes.
Related developer tools
Bookmark this page for next time, or copy its link. Shared links contain no working input.
Link to this tool: https://www.toolpick.dev/free-tools/json-formatter