Tidy up JSON
Paste it in; make it readable, validate it, minify it. If it is broken, the tool tells you which line broke it.
How to use it
Paste the JSON
Drop it into the box on the left.
Format, minify, sort
Choose 2 spaces, 4 spaces or a tab. Minifying puts it on one line; sorting arranges the keys alphabetically.
Copy or download
On broken JSON you get the line and column of the error, and the offending line is marked underneath.
Common mistakes
[1, 2, 3,]
JSON does not accept a comma after the last element. JavaScript does; JSON does not.
{'name': 'Ada'}
JSON only uses double quotes.
{name: "Ada"}
Keys have to be in quotes as well.
// note
There are no comments in JSON. This is what trips people up most often when copying out of configuration files.
\" and \\
A quote or backslash inside a string has to be escaped.
Common questions
Does my data go to a server?
No. Both the parsing and the formatting happen inside your browser; the text you paste never leaves the page. That is exactly what matters when you are working with production data.
Does sorting the keys change the data?
It does not. Key order carries no meaning in JSON objects; sorting only makes it easier to read and to compare two files. Array order is left alone.
What happens with a very large file?
Your browser's memory sets the limit. Files of a few megabytes open without trouble; much larger ones may make the tab unresponsive for a while.