JSON prettify and format
Prettify your JSON string into a friendly, human-readable format.
About JSON prettify and format
Formats a JSON string into an indented, readable layout. It also accepts relaxed JSON5 input (comments, trailing commas, unquoted keys) and always outputs standard JSON.
When you would use it
- Reading a minified API response or log line that arrives as a single long line.
- Cleaning up a config file before committing it, so the diff shows only real changes.
- Finding out where a JSON document is broken, since invalid input is flagged with an error message.
How to use it
- Paste or type your JSON into the left field; the formatted result appears below right away.
- Choose the indent size (0 to 10 spaces).
- Turn "Sort keys" on or off, then copy the result with the copy button.
Things worth knowing
- "Sort keys" is on by default and reorders every object alphabetically. That is good for diffing but changes the order of your data, so turn it off if key order matters to you.
- Because JSON5 is accepted, input with comments or trailing commas is formatted successfully, but the output drops the comments and is plain JSON.
- Numbers beyond JavaScript's safe integer range (about 9 quadrillion) can lose precision when parsed, so long IDs may change. Keep such values as strings.
- Your last input and settings are remembered in this browser only, never sent to a server.
Frequently asked questions
- Why does the output not appear?
- When the input is not valid JSON or JSON5, the validation message under the input shows the problem and the output stays empty. Typical causes are a missing comma, an unmatched bracket, or text pasted before or after the JSON.
- Does it validate against a schema?
- No. It only checks that the text is syntactically valid and then reformats it. It does not check types or required fields.