JSON Lens JSON formatter and validator
Paste JSON to check it is valid, format or minify it, and browse its structure as a tree. Free, no sign-up, and nothing you paste leaves your browser.
Paste JSON on the left, or .
Checked as you type. Nothing is sent anywhere.
What it checks
The text is checked against the JSON standard as you type, using your browser’s own parser. Standard JSON is stricter than the object syntax in JavaScript: keys and strings need double quotes, a trailing comma after the last item is an error, and comments are not allowed.
When the text is not valid, the message says what the parser expected and, in most browsers, the line and column where it stopped. “Show in text” puts the cursor there. The real mistake is often just before that point, such as a missing comma on the line above.
Format and minify
Format rewrites the JSON with one value per line, indented with two spaces, four spaces or tabs. Minify removes every space and line break that is not inside a string, which is the smallest form to send or store. Neither changes the data.
Two things to know
Whole numbers above 9,007,199,254,740,991 cannot be held exactly by a browser, so a very long numeric ID may come back with its last digits changed after formatting. Keep such values as strings. And if an object repeats a key, only the last value is kept.
Your data stays with you
Everything happens in the page. The JSON you paste is not uploaded, logged or stored, so it is safe to use with API responses and configuration files.