JSON Formatter
Format and validate JSON.
PASTE YOUR DATA
OUTPUT:
// What the output controls do
- >[compress] — Switches the result to one line of compact JSON.
- >[to xml] — Writes the same data as XML. Array items are named item, and keys that are not valid XML names are cleaned up.
- >[line no] — Adds line numbers to the current output view.
- >[fullscreen] — Expands the result pane; press Escape to leave it.
- >[Download] — Saves the current view as result.json or result.xml.
- >[copy] — Copies that same text to the clipboard.
// A formatted example
IN
{"name":"Tom","age":30}
OUT
{ "name": "Tom", "age": 30 }
The same indent choice is used for the tree, [copy] and [Download].
// Questions about this tool
What happens when the JSON is invalid?
The result pane shows the parser message and a short excerpt of the input near the reported position, instead of a partial tree.
Will formatting round my numbers?
No. Parsing uses lossless-json, which keeps the original text of each number, so integers larger than JavaScript can represent exactly stay as written.
Does an edit change the input too?
Yes. Saving a key or value rewrites the INPUT pane with the edited JSON, so formatting again keeps your changes.