Format, Validate and Minify JSON
Paste your JSON: it's validated instantly, with the line and column of any error, then beautified or minified in one click. Everything stays in your browser, even confidential data.
- Free
- Errors by line and column
- Tree view
- Nothing uploaded
100% private — Everything is processed directly in your browser: your files, voice, and image are never sent to Chatzam's servers.
How to format and validate JSON?
-
Paste the JSON
Paste the content into the input box: it's validated instantly.
-
Fix or format
If there's an error, the line and column are shown. Otherwise, indent with 2 or 4 spaces or a tab, minify, or sort the keys.
-
Copy or download
Copy the result in one click or download it as a .json file. The tree view lets you explore the data branch by branch.
Everything you need to read and fix JSON
Precise validation
A clear message tells you what's wrong and where, with the line and column, so you can fix it in seconds.
Beautify or minify
Indent with 2 or 4 spaces or tabs for reading, or get a compact version with no whitespace for sending.
Sort keys
Keys are sorted alphabetically: handy for comparing two API responses or two config files.
Collapsible tree view
Expand only the objects and arrays you care about, even in a long JSON document.
The most common JSON errors
JSON is stricter than JavaScript. Keys and strings must use double quotes: {'name': 'Emma'} is invalid, {"name": "Emma"} is correct. A trailing comma after the last item, as in [1, 2, 3,], isn't allowed, and neither are // or /* */ comments. The values true, false and null are written in lowercase; undefined, NaN and Infinity don't exist in JSON. Another trap: a double quote or a backslash inside a string must be escaped (\" and \\), and a line break is written \n. When the validator flags an error, also look just before the position shown: it's often a missing comma at the end of the previous line.
Beautify or minify: which one to choose?
Indented JSON is easy to read: each nesting level is shifted by 2 spaces, 4 spaces or a tab, depending on your project's conventions. 2 spaces is the most common choice in web development, and 4 spaces is common in the Python ecosystem. Minifying does the opposite: it strips spaces, tabs and line breaks without changing the data, to get the most compact text possible for sending in a request, storing or pasting into an environment variable. Both versions are strictly equivalent to a program: only readability changes. Beautify to review and debug, minify to transmit.
Sort keys and explore JSON as a tree
According to the JSON standard (RFC 8259), an object is an unordered collection: {"a": 1, "b": 2} and {"b": 2, "a": 1} represent the same data. Sorting keys alphabetically lets you compare two API responses or two config files line by line, without a different order getting in the way. The tree view helps you explore large JSON: collapse big arrays, expand only the branch you need and quickly find a nested value. Since everything is processed in your browser, you can paste customer data, internal exports or sensitive API responses: nothing is sent to a server.
Frequently Asked Questions
How do I check if my JSON is valid?
Paste it into the tool: validation is instant. If it's invalid, the message shows the error with its line and column.
Why is my JSON invalid?
Most often: single quotes instead of double quotes, an unquoted key, a trailing comma after the last item, or a comment. Look at the position shown and at the end of the line just before it.
How do I minify JSON?
Paste it, then choose Minify: spaces and line breaks are removed and the data stays identical. Copy the result or download it as a .json file.
What indentation should I use for JSON?
2 spaces is the most widespread convention; 4 spaces or tabs work too. It's a matter of readability: the data doesn't change.
Is my JSON data sent to a server?
No. Validation and formatting happen in your browser: you can format confidential data without it ever leaving your device.