JSON Validator & Formatter
Validate, format and minify JSON in your browser with detailed error locations.
Loading JSON Validator & Formatter… If nothing happens, please enable JavaScript.
Frequently asked questions
Is my JSON sent to a server?
What are the exact rules that make JSON valid?
What is the difference between pretty-printing and minifying JSON?
How is JSON different from JavaScript object literal syntax?
What size of JSON can I validate and format?
Does the validator support JSON5 or JSONC (JSON with comments)?
Can I use this to format JSON inside a string (escaped JSON)?
Is JSON the same as BSON or MessagePack?
Why does the error message only show the first error?
What is a common mistake that makes JSON invalid?
About JSON Validator & Formatter
JSON (JavaScript Object Notation) is a lightweight, human-readable data interchange format based on a subset of JavaScript syntax. It was popularised by Douglas Crockford in the early 2000s as a simpler alternative to XML for exchanging data between web clients and servers. Standardised as RFC 4627 in 2006 and later ECMA-404 and RFC 8259, JSON has become the universal language of web APIs, configuration files, and data storage. Its six value types — string, number, boolean, null, array, and object — map cleanly onto the data structures of virtually every programming language.
JSON is unavoidable in modern development. REST APIs return JSON responses. Configuration files for tools like ESLint, TypeScript, and npm use JSON. NoSQL databases like MongoDB store documents as BSON (binary JSON). Serverless function event payloads are JSON objects. Developers routinely need to inspect, format, or validate JSON from API responses, database exports, log files, webhook payloads, and configuration templates. A single misplaced comma or unmatched bracket makes the entire document invalid, and raw minified JSON from a production API is nearly impossible to read without formatting.
This JSON validator and formatter parses your input locally in the browser using the native JSON.parse function — the same parser used by every JavaScript runtime. It highlights the exact line and column of any syntax error so you can find and fix problems immediately. Once valid, the tool pretty-prints the JSON with configurable indentation for readability, or minifies it by stripping all unnecessary whitespace to reduce payload size. Because everything runs in your browser, your JSON data — which may contain API keys, user records, or confidential business data — is never sent to any server.
Common JSON mistakes include trailing commas after the last item in an array or object (valid in JavaScript but forbidden in JSON), single-quoted strings (JSON requires double quotes), and comments (JSON has no comment syntax, unlike JSONC or JSON5). Numbers with leading zeros (like 007) are also invalid. If you are working with a format that extends JSON with these features, a JSONC or JSON5 parser is needed instead — standard JSON.parse will reject them.
How JSON conquered the web
JSON was created and popularised by Douglas Crockford, who registered the domain json.org in 2001 and began advocating for JSON as a lightweight alternative to XML for AJAX data exchange. Crockford's key insight was that JavaScript's object and array literal syntax was already a valid data format — it just needed to be documented, restricted to safe types, and promoted. He famously claimed he 'discovered' rather than invented JSON, noting that the syntax was already latent in JavaScript itself.
Despite its simplicity, JSON's path to standardisation was surprisingly contentious. Crockford initially published it under a licence that included the phrase 'The Software shall be used for Good, not Evil', which caused it to be classified as non-free by some open-source organisations. When ECMA formalised JSON as ECMA-404 in 2013 and the IETF published RFC 8259 in 2017, they used a clean licence — but Crockford kept the 'Good, not Evil' clause in the original json.org specification, creating a persistent (and somewhat humorous) licensing footnote in web standards history.
Today, JSON is arguably the most widely parsed data format in existence. Every major programming language ships a JSON parser in its standard library. REST APIs, GraphQL responses, NoSQL databases, configuration files, log aggregation systems, and serverless event buses all use JSON as their native format. The irony is that JSON, which was designed to be simpler than XML, has itself become so ubiquitous that entire ecosystems of JSON-adjacent formats — JSON5, JSONC, NDJSON, JSON Schema, JSON Pointer, JSON Patch — have grown up around it to address its limitations.