JSON Formatter & Validator
Free JSON formatter and validator. Pretty-print or minify JSON and get clear error locations for invalid input, entirely in your browser.
What this tool does
JSON (JavaScript Object Notation) is a plain-text format for structured data, widely used by APIs, config files, and logs. This tool parses whatever you paste in using the browser's built-in JSON parser, so it flags exactly the same problems a real application would hit when reading that data β then lets you either pretty-print it with consistent indentation for readability, or minify it to strip whitespace for a smaller payload.
Worked example
Minified input like {"name":"Ada","active":true,"roles":["admin","editor"]} becomes, once
formatted with a 2-space indent, a multi-line, indented structure with each key and nested array entry on its
own line β identical data, just laid out for a human to scan.
Frequently asked questions
What is the difference between formatting and minifying JSON?
Formatting (pretty-printing) adds line breaks and indentation so nested objects and arrays are easy to read. Minifying strips all unnecessary whitespace to produce the smallest possible output β the same data, just not meant for humans to read. Both represent identical data; only the whitespace differs.
Why does it say my JSON is invalid?
Common causes are a trailing comma after the last item in an object or array (valid in JavaScript object literals, but not in JSON), using single quotes instead of double quotes around keys and strings, missing a closing brace or bracket, or an unquoted key. The error location shown points to roughly where the parser gave up, which is usually at or just after the actual mistake.
Is my JSON data sent to a server?
No. Formatting, minifying, and validation all run in your browser using the JavaScript JSON object built into every browser β nothing you paste here is transmitted anywhere, which makes it safe to use with sensitive data like API responses or config files.
Does JSON support comments or trailing commas?
No β the JSON specification doesn't allow comments or trailing commas, even though some JSON-like formats (JSON5, JSONC, and JavaScript object literals) do. If your input has either, this tool will report it as invalid, which is exactly what any JSON.parse() call elsewhere would also do.