JSON Validator & Formatter
Validate, format, and minify JSON instantly. See errors highlighted with line numbers.
About this calculator
Validate JSON and see errors with line numbers, then format or minify it. A Validate Only button checks without changing the text.
Developers use it to read API responses, fix config files and clean data. The check runs in your browser, so private payloads stay private.
How to use it
- Paste your JSON.
- Press Format, Minify or Validate.
- Copy the result.
Rules of JSON
JSON has six value types: object {}, array [], string, number, true/false and null. Keys and strings need double quotes, there are no trailing commas, no comments and no single quotes. The formatter parses your text; if it parses, it re-prints it with indentation (or with all whitespace removed when minifying). If not, the error shows where the problem is.
Worked example
Input {"name":"Asha","age":30,"skills":["js","sql"]}
| Formatted | Each key on its own line, indented two spaces |
| Minified | {"name":"Asha","age":30,"skills":["js","sql"]} |
Runs entirely in your browser. Nothing you paste is uploaded.
Tips and common mistakes
- Most JSON errors are trailing commas, single quotes or unquoted keys.
- Minify JSON for production payloads and format it for reading.
- Large numbers beyond 2⁵³ lose precision in JavaScript.
- JSON has no comments; use a separate field if you need notes.
- Validate API responses before parsing in code.
Frequently asked questions
What is JSON?
A text format for structured data, based on JavaScript object syntax.
Why does my JSON fail to parse?
Usually a trailing comma, single quotes or missing quote marks.
What does minify do?
Removes all unneeded whitespace.
Can JSON have comments?
No.
What is the difference between JSON and a JavaScript object?
JSON is stricter: double quotes only, no functions or undefined.
Is my data sent to a server?
No.