What Is JSON?
JSON (JavaScript Object Notation) is a lightweight data-interchange format that is easy for both humans and machines to read and write. It has become the standard format for APIs, configuration files, and data storage across virtually every programming language and platform. A valid JSON document is built from two structures: objects (key-value pairs wrapped in curly braces) and arrays (ordered lists wrapped in square brackets).
Formatting matters because raw or minified JSON can be nearly impossible to read when it contains deeply nested objects or long arrays. Pretty-printing adds indentation and line breaks that reveal the structure at a glance, making it far easier to spot missing values, incorrect nesting, or misplaced commas during code reviews and debugging sessions.
Common validation errors include trailing commas, single-quoted strings, unquoted property names, and comments, none of which are permitted by the JSON specification. Even a single misplaced character can cause a parser to reject an entire payload, which is why running your data through a validator before deploying or transmitting it can save significant debugging time.
Frequently Asked Questions
What makes JSON invalid?
The most common causes of invalid JSON are trailing commas after the last item in an array or object, single quotes instead of double quotes around keys and string values, unquoted keys, comments (JSON does not support them), and missing or extra brackets or braces. The validator in this tool pinpoints the exact line and character position of the first error so you can fix it quickly.
What is the difference between formatting and minifying?
Formatting (also called pretty-printing) adds line breaks and indentation so the JSON is easy for humans to read and edit. Minifying removes all unnecessary whitespace, producing the most compact representation possible. Minified JSON is ideal for network transmission and storage because it reduces file size, while formatted JSON is better for debugging and code reviews.
Does this tool fix broken JSON?
No. This tool validates and formats valid JSON, but it does not attempt to auto-correct syntax errors. If your JSON is invalid, the status bar will display the error type and its position in the text so you can fix it manually. Automatically repairing JSON could silently alter your data, so the tool leaves corrections in your hands.
What is JSON used for?
JSON is used as the primary data-interchange format for web APIs, configuration files, and data storage. Most REST and GraphQL APIs return responses in JSON, and popular tools like package.json (Node.js), tsconfig.json (TypeScript), and settings files across many editors all use JSON. Its human-readable structure and broad language support make it the default choice for transmitting structured data between a server and a client.
What is the maximum size of a JSON file?
The JSON specification does not define a maximum file size. In practice, the limit depends on the parser and the environment. Most browsers can handle JSON files up to several hundred megabytes, though performance degrades with very large documents. Server-side parsers in languages like Python, Java, and Node.js can process multi-gigabyte files when using streaming parsers. For this browser-based tool, files under 10 MB will format and validate smoothly.
What is the difference between JSON and JavaScript objects?
Although JSON syntax was inspired by JavaScript object literals, they are not the same. JSON requires all keys to be double-quoted strings, does not allow trailing commas, does not support comments, and only permits strings, numbers, booleans, null, arrays, and objects as values. JavaScript objects can have unquoted keys, single-quoted strings, functions as values, and trailing commas. JSON is a strict, language-independent data format, while JavaScript objects are a language-specific construct.