Format, minify and validate JSON with custom indentation.
The JSON Formatter pretty-prints, minifies or validates JSON in a two-pane layout: input on the left, result on the right. Pick 2 spaces, 4 spaces or a tab for indentation and the output updates as you type. It is aimed at developers inspecting API responses, logs and config snippets who want readable or compact JSON fast.
JSON formatting, or pretty-printing, rewrites a JSON document with consistent line breaks and indentation without changing its meaning. Minifying does the opposite and removes every optional space and newline to make the payload smaller. Both operations work on the parsed data, so they also act as a validity check: text that is not valid JSON cannot be formatted. Indentation style is a matter of convention; two spaces is common in JavaScript projects, four in many other ecosystems, and tabs let each reader choose their own visual width.
Yes. The tool parses the JSON and writes it back, so values and key order are the same. Only whitespace changes. Numbers go through the JavaScript parser, so very large integers beyond 2^53 may lose precision.
Yes. It parses the input first, so invalid JSON produces an error instead of minified output.
No. Comments and trailing commas are not part of the JSON standard and are reported as errors. Strip them first.
Two spaces, four spaces and a tab character. The choice applies to Format; Minify and Validate ignore it.
You can load a file with the file button and everything is processed in the page, so the practical limit is your device memory and how long the browser takes to render the output.