JSON Formatter & Beautifier
Paste JSON to check that it parses, then reprint it with the indent you choose. Invalid JSON stays on the page as an error.
About this tool
Formatting parses with JSON.parse and reprints with JSON.stringify. Beautify and pretty-print mean that same reprint: the value is unchanged, and the indent is the one you chose. Key order follows the parsed object, which for a normal object is the order the keys appeared.
People use it to read a minified response, to line up a config file before committing it, or to confirm a payload is actually JSON. Load sample fills the box with an example. The result stays JSON, so the text counters are not the next step. The minifier is the reverse step. Other JSON tools appear only when they accept JSON.
The page does not upload the source, the file name, or the reprint, and analytics does not receive them.
How to use it
- Paste a JSON value into the box. Objects, arrays, strings, numbers, true, false, and null are all valid JSON. A local file is read on this page and is not uploaded.
- Choose an indent, then Format JSON. Ctrl+Enter or Cmd+Enter does the same thing from the box.
- Copy or download the reprint. A syntax error names the problem and does not pretend the value was formatted.
Limitations
- Comments, trailing commas, and single-quoted strings are not JSON, so they fail on purpose.
- Tabs use one tab per level. The size applies when the style is spaces. A source longer than 1 MB is refused.
Spacing chosen after a successful parse
The printer starts from the parsed value
Spacing is the only decision this formatter adds. The paste is read with JSON.parse. When that succeeds, JSON.stringify writes the value again with an indent of two spaces, four spaces, or a single tab at each nesting level. Line breaks you typed, the gap after a colon, and a trailing newline are not copied. What comes back is a fresh listing of the value. Object keys stay in the order the parser recorded them. They are not sorted into alphabetical order. If the same key is written twice, the parser keeps one value for that name, and the listing shows that pair once.
A number is printed from its numeric value. A fraction written with a trailing zero is not promised back with that zero. The tokens 1.0 and 1 are the same value, and the printer has one spelling for it. Characters inside a string stay characters. A brace inside a quoted note is still a brace in the output, because quotes made it text. A brace outside quotes is structure. A missing partner is a syntax error, not a puzzle the page will finish for you.
Syntax failures stop the run
A comment, a trailing comma, a single-quoted string, and an empty box produce no pretty listing. The parser message is what you see. No missing bracket is invented, and no damaged line is skipped so the rest can print. NaN and Infinity are not JSON numbers, so a paste that contains those tokens fails even though a JavaScript file would accept them. Undefined is not a JSON value either. Text that happens to look like a calendar date stays text. This page does not turn that text into a timestamp.
A readable listing is not a schema verdict
No schema document is consulted. A key this page has never heard of is still printed when the text is legal JSON. Required properties, enums, and formats are questions for the schema validator, which reads a schema and a separate data document. Inferring a schema from one sample is a different page. Compact output with no indent is the minifier. Comparing two documents line by line is the diff. Use this page when a single document already parses and you want it readable.
Privacy
Your JSON is processed in your browser and is not uploaded to UtilChain. The text is not included in analytics.

