JSON Formatter
- 100% private — nothing is uploaded
- Instant, live results as you type
- Free forever, no sign-up needed
- Works even when you're offline
About JSON Formatter
The JSON formatter turns raw JSON into a clean, readable, indented layout (beautify) or strips every optional space and newline to make it as small as possible (minify). It first parses the text so it only ever outputs valid JSON.
Pretty-printing makes JSON easy to read and diff in code review; minifying shrinks payloads for APIs, config files and network transfer where whitespace is wasted bytes.
How to use the JSON Formatter
- Paste or type your JSON into the input box.
- Press Beautify to indent it, or Minify to collapse it onto one line.
- For beautify, choose 2 spaces, 4 spaces or a tab for indentation.
- Copy the formatted result with the copy button.
Good to know
- Beautifying and minifying never change the data — object key order, numbers and strings stay exactly the same, only whitespace differs.
- The tool parses with JSON.parse, so it rejects JSON5 extras like comments, trailing commas or single-quoted strings.
- Object keys keep their original order; JSON itself does not define key ordering, so tools are free to preserve insertion order as this one does.
Frequently asked questions about the JSON Formatter
Does formatting change my data?
No. Both actions parse the JSON and re-serialise it, so values, types and key order are preserved — only indentation and spacing change.
Why does it reject my JSON?
Common causes are trailing commas, comments, single quotes instead of double quotes, or unquoted keys. Strict JSON allows none of those; the JSON validator will point to the exact position.
Which indentation should I use?
Two spaces is the most common convention for JSON and web config; four spaces or a tab can be easier to read for deeply nested data. It is purely cosmetic.