JSON Formatter & Beautifier
Turn a one-line API response into readable, indented JSON. Pick your indent, optionally sort keys so two documents line up, and fold sections in the tree view.
How it works
The input is parsed into a value, then written back out with JSON.stringify and your chosen indent, so the output is guaranteed to be valid JSON.
Sorting keys reorders object members alphabetically at every depth. Arrays keep their order, because in JSON array order carries meaning and object order does not.
Numbers are re-serialised by JavaScript, so integers beyond 2^53 (9007199254740992) lose precision. If you handle 64-bit IDs, keep them as strings.
Everything above runs in JavaScript inside this tab. Your data is not uploaded. Inputs are remembered in this browser only so they survive a reload; you can switch that off on the privacy page.
Questions
Does formatting change my data?
No values change. Whitespace does, and if you enable "sort keys" object members are reordered. Very large integers above 2^53 are the one exception, since JavaScript numbers are 64-bit floats.
Is a JSON beautifier the same as a JSON formatter?
Yes. "Beautify", "pretty print" and "format" all mean adding indentation and line breaks. The reverse is minifying.
2 spaces, 4 spaces or tabs?
Any is valid. 2 spaces is the default of Prettier and most JavaScript projects; 4 spaces is common in Python (json.dumps(indent=4)). Tabs let each reader choose their own width.