JSON formatter and validator
Paste some JSON to pretty-print it, check whether it is valid or minify it. If there are errors, we show you the line and column. Everything runs in your browser.
What is JSON?
JSON (JavaScript Object Notation) is a text format for exchanging structured data. It is the most widely used format for web APIs, configuration files and many NoSQL databases. It is built on two structures: objects ("key": value pairs inside curly braces) and arrays (lists of values inside square brackets).
Values can be double-quoted strings, numbers, true, false, null, objects or arrays.
Most common JSON errors
Almost every syntax error comes down to a few causes: trailing commas after the last element ([1, 2,]), keys or strings in single quotes instead of double quotes, unquoted keys, comments (JSON does not allow them) or unescaped control characters inside a string, such as a line break.
This validator uses your browser's JSON parser, the same one behind JSON.parse() in JavaScript, so whatever is valid here will also be valid in your code.
Format or minify?
Formatted JSON (with indentation and line breaks) is easier to read and to review in version control. Minified JSON removes all unnecessary whitespace and is smaller, so it is better for sending over the network or storing.