null. To fix a broken file, paste it below and check the exact line and column of the first syntax error. To make it readable, choose an indent and click Beautify. To shrink it for an API request, click Minify. Keys must use double quotes, trailing commas and comments are not allowed.
What Is JSON?
JSON stands for JavaScript Object Notation. It is a lightweight, language-independent text format for representing structured data, standardised in RFC 8259 and ECMA-404. Despite its name, JSON is used by virtually every programming language and is the dominant format for web APIs, configuration files, NoSQL documents and data exports.
A JSON document is built from six value types. Objects are unordered collections of key-value pairs wrapped in braces, arrays are ordered lists wrapped in brackets, and the remaining types are strings, numbers, booleans and null. Because the grammar is small and strict, parsers are fast and unambiguous.
JSON Syntax at a Glance
| Element | Syntax | Rules to remember |
|---|---|---|
| Object | {"key": "value"} | Keys must be strings in double quotes. Key order is not significant. |
| Array | [1, 2, 3] | Elements are ordered and may be of mixed types. |
| String | "hello\nworld" | Double quotes only. Escape quotes, backslashes and control characters. |
| Number | -12.5e3 | No leading plus, no leading zeros, no NaN or Infinity, no hexadecimal. |
| Boolean | true / false | Lowercase only. |
| Null | null | Lowercase only. Undefined is not a JSON value. |
| Separator | , and : | No trailing comma before a closing brace or bracket. |
| Whitespace | space, tab, LF, CR | Allowed between tokens only, not inside the grammar of a number. |
Common JSON Errors and How to Fix Them
| Mistake | Why it fails | Fix |
|---|---|---|
Trailing comma: {"a":1,} | A comma must be followed by another member. | Delete the last comma. |
Single quotes: {'a': 1} | Only double quotes are valid for strings and keys. | Replace with double quotes. |
Unquoted keys: {a: 1} | Object keys must be JSON strings. | Wrap every key in double quotes. |
Comments: // note | Standard JSON has no comment syntax. | Remove comments or use a JSONC/JSON5 parser. |
undefined, NaN, Infinity | These are not JSON value types. | Use null or a string such as "NaN". |
| Unescaped newline inside a string | Control characters are forbidden in string literals. | Use \n or close and reopen the string. |
| Mismatched braces | Every opening brace or bracket needs a matching closer. | Check nesting, then beautify to see the structure. |
| Duplicate keys | Syntactically valid, but the last value wins in most parsers. | Remove duplicates to avoid silent data loss. |
Formatting vs. Minifying
Both operations produce documents that parse to exactly the same data. Beautifying inserts indentation and line breaks so that a human can read nested structures; minifying strips all optional whitespace to reduce payload size for network transfer. A minified response is usually 15 to 40 percent smaller, while a formatted one is far easier to review in a code editor or to paste into documentation. Never minify by hand, because deleting whitespace inside a string changes the data.
How the JSON to CSV Converter Handles Nested Data
CSV is a flat, two-dimensional format, while JSON can be deeply nested. This tool flattens nested objects into dot-notation headers. For example:
{"id": 1, "user": {"name": "Ada", "city": "London"}}
becomes columns: id, user.name, user.city
The converter takes the union of all keys across every record, so records with missing fields simply get empty cells. Arrays are kept as JSON text inside a single cell rather than being silently discarded. Values containing commas, quotes or line breaks are quoted according to RFC 4180, with internal quotes doubled. The result opens cleanly in Excel, Google Sheets, LibreOffice and most databases.
JSON vs. CSV: Which Should You Use?
| Criterion | JSON | CSV |
|---|---|---|
| Nested data | Native support for objects and arrays | Requires flattening |
| Data types | String, number, boolean, null, array, object | Everything is text; types are inferred |
| Human readability | Good when formatted | Excellent for table-shaped data |
| File size | Larger because of repeated keys | Smaller for uniform rows |
| Best for | APIs, configs, documents, logs | Spreadsheets, analytics imports, bulk tables |
Key Takeaways
- Valid JSON uses double quotes, has no comments and never ends a list with a comma.
- Beautifying and minifying change only whitespace, never the underlying data.
- Sorting object keys is safe because key order has no meaning in JSON; array order does.
- Converting nested JSON to CSV requires flattening, and arrays must be preserved explicitly.
- Client-side processing means sensitive payloads never leave your device.
Last updated: December 1, 2026 · Reference: RFC 8259 (The JavaScript Object Notation Data Interchange Format).
JSON Formatter FAQ
JSON stands for JavaScript Object Notation. It is a language-independent text format for structured data built from objects, arrays, strings, numbers, booleans and null. It is defined by RFC 8259 and ECMA-404.
Parse it with a JSON parser. A valid document has double-quoted keys and string values, no trailing commas, no comments, no single quotes, and no undefined or NaN values. A validator reports the exact position of the first syntax error.
The JSON specification does not allow a comma after the final element of an object or array. Remove the last comma before the closing brace or bracket.
No. Standard JSON has no comment syntax. Formats such as JSONC and JSON5 allow comments, but a strict JSON parser will reject them.
Formatting adds indentation and line breaks to make JSON readable for humans. Minifying removes all optional whitespace to reduce file size for transmission. Both preserve exactly the same data.
Flatten nested objects into dot-notation column names such as address.city, collect the union of all keys across records, and write one row per object. Arrays are preserved as JSON text inside a single cell.
No. All parsing, formatting and conversion happen locally in your browser using JavaScript. Nothing is sent to a server, stored, or logged.
No. Object key order is not significant in JSON, so sorting keys alphabetically produces an equivalent document. Array element order is significant and is never changed.