JSON (JavaScript Object Notation) is a lightweight data interchange format defined in RFC 8259 and ECMA-404. It uses human-readable text to represent structured data as key-value pairs (objects) and ordered lists (arrays). JSON has become the dominant format for REST APIs, configuration files, and data storage — over 70% of public APIs use JSON as their primary response format.
What is JSON?
JSON (JavaScript Object Notation) is the dominant data interchange format on the web. Defined by RFC 8259, it uses a simple syntax of key-value pairs and ordered lists to represent structured data. JSON is natively supported by every major programming language and is the standard format for REST APIs, configuration files (package.json, tsconfig.json), NoSQL databases (MongoDB, CouchDB), and data pipelines.
A JSON value can be a string (double-quoted), number, boolean (true/false), null, an object ({}), or an array ([]). Objects and arrays can be nested to any depth.
How do you format and beautify JSON?
Formatting (or "beautifying") JSON means adding indentation and line breaks to make the structure human-readable. This tool offers three indentation options:
- 2 spaces — the most common convention (used by npm, ESLint, Prettier defaults)
- 4 spaces — common in Python and Java ecosystems
- Tab — preferred by some developers for accessibility (adjustable width)
To minify JSON, click the Minify button. This removes all whitespace, producing the smallest possible output — useful for API payloads, configuration deployments, and reducing network bandwidth.
What are the most common JSON syntax errors?
When JSON is invalid, this tool shows the exact line and position of the error. Here are the most frequent mistakes:
| Error | Invalid | Valid |
|---|---|---|
| Trailing comma | {"a": 1,} | {"a": 1} |
| Single quotes | {'a': 'b'} | {"a": "b"} |
| Unquoted keys | {a: 1} | {"a": 1} |
| Missing comma | {"a": 1 "b": 2} | {"a": 1, "b": 2} |
| Unclosed brace | {"a": 1 | {"a": 1} |
| Comments | {"a": 1} // note | {"a": 1} |
Need to convert your JSON to another format? Try our JSON to YAML converter for configuration files, or decode API tokens with the JWT decoder.