How to use it
Paste or type JSON in the box. Pick Format to pretty-print it with 2 spaces, 4 spaces or tabs, Minify to squeeze it onto one line, or Validate only to just check it. The result appears straight away and you can copy it or download it as a file.
Fixing errors
When the JSON is not valid, the message names the problem and, where your browser reports it, the line and column. Look just before that spot, because a missing comma or quote is usually found at the next token. If you only need to compare two versions, try the text diff checker.
Related tools
Need to encode a value inside JSON? Use the Base64 encoder or the URL encoder. To shrink code, see the code minifier.
Frequently asked questions
What does a JSON formatter do?
It reads your JSON, checks that it is valid and writes it back with consistent indentation so people can read it. Minify does the opposite and removes every unnecessary space and line break.
Why does my JSON say it is invalid?
The most common causes are a trailing comma after the last item, single quotes instead of double quotes, unquoted property names, a missing comma between items, or comments. Standard JSON allows none of these.
Does sorting keys change my data?
Only the order of keys inside each object changes. Arrays keep their order, because the order of array items matters. Note that JavaScript always lists whole-number keys like 1 and 2 first.
Are very large numbers safe?
Numbers bigger than 9,007,199,254,740,991 lose precision when parsed in JavaScript, so a long ID such as 12345678901234567890 can change. Keep such values as strings in your JSON.
Is my JSON uploaded anywhere?
No. The formatter uses your browser's own JSON parser, so your data never leaves your device.