Last updated: May 2026
Paste raw JSON to prettify, minify, or validate it. Clear error messages with descriptions. Nothing leaves your browser.
JSON (JavaScript Object Notation) is the lingua franca of data exchange on the modern web. Originally derived from JavaScript object syntax, it has become language-agnostic and is now supported natively by every major programming language and platform. At its core, JSON represents data as key-value pairs nested inside objects ({}) and ordered lists inside arrays ([]). Its strict syntax — double-quoted keys, no trailing commas, no comments — makes it easy to parse programmatically but frustrating to write by hand, which is exactly why formatters and validators like this one exist.
Prettifying JSON adds indentation and line breaks so humans can read the structure at a glance. Minifying does the opposite — it strips all unnecessary whitespace to reduce file size, which matters when sending JSON over a network millions of times per day. Validation catches structural errors before they reach your application code, where a single missing comma or mismatched bracket causes a cryptic parse error. Running JSON through a validator is especially important when the data comes from external sources like APIs or user input.
| Type | Syntax | Example |
|---|---|---|
| String | Double-quoted text | "Hello, world" |
| Number | Integer or decimal, no quotes | 42 or 3.14 |
| Boolean | Lowercase literal | true or false |
| Null | Lowercase literal | null |
| Object | Curly braces, key-value pairs | {"name": "Ada"} |
| Array | Square brackets, comma-separated | [1, 2, 3] |
{"user":{"id":1,"name":"Alice","roles":["admin","editor"]}} from an API. Paste it into the input panel and select 2-space indent. The formatter outputs a readable tree with each key on its own line, roles expanded as an array, and consistent indentation — making it easy to spot the structure and debug any missing fields.{"price": 9.99, "in_stock": true,}. The trailing comma after true is valid in JavaScript but illegal in strict JSON. The validator flags a "SyntaxError: Unexpected token }" and highlights the offending position. Remove the trailing comma and the JSON validates cleanly. This is the most common JSON mistake in hand-edited files.What is JSON?
JSON stands for JavaScript Object Notation. It is a lightweight text format for storing and transporting structured data. Despite its name, JSON is completely language-independent — parsers exist for Python, Java, Go, Ruby, PHP, and virtually every other language. It is the dominant format for REST API responses and configuration files.
What is the difference between prettify and minify?
Prettify (also called "beautify") adds indentation and newlines to make JSON human-readable. Minify removes all non-essential whitespace to produce the smallest possible string. A prettified file might be 4× larger than its minified equivalent. Use prettified JSON for debugging and configuration files; use minified JSON for network payloads where every byte counts.
Why should I validate JSON?
Invalid JSON causes parse errors that crash applications or silently fail, depending on the error handling. Validation catches problems — trailing commas, unquoted keys, single-quoted strings, mismatched brackets — before the data reaches your code. It is especially important when JSON is generated by templates, copy-pasted from documentation, or edited manually.
What causes a JSON parse error?
The most common causes are: trailing commas after the last item in an object or array (valid in JS5 but not JSON), single-quoted strings instead of double-quoted, unquoted property keys, comments (JSON does not support // comments), and using undefined or NaN as values (both are JavaScript-only concepts not present in the JSON spec).
When should I use JSON instead of CSV?
Use JSON when your data is hierarchical (objects inside objects, arrays of objects) or when field names vary between records. Use CSV when your data is a flat, uniform table — same columns for every row — especially if it needs to be opened in spreadsheet software. JSON is better for APIs; CSV is better for bulk data exports and data analysis pipelines.