JSON Formatter & Beautifier
Paste your JSON and get it formatted instantly. Validates syntax in real time. Everything runs in your browser — nothing is sent to any server.
Frequently Asked Questions
Why does my JSON fail validation even though it works fine as a JavaScript object?▾
JavaScript object syntax is a superset of JSON — it allows things JSON strictly forbids: single-quoted strings, unquoted keys, trailing commas, comments, undefined values, and NaN/Infinity numbers. JSON (per RFC 8259) requires double-quoted keys and string values, no trailing commas anywhere, and only finite decimal numbers. When you copy a JS object literal directly into a JSON context (API body, config file), these differences cause parse failures.
What happens when a JSON object contains duplicate keys?▾
The JSON spec technically permits duplicate keys but defines no required behavior for handling them — it's left to the parser. In practice, most parsers silently use the last occurrence, but some use the first, and others throw an error. This means duplicate keys produce inconsistent results across languages and runtimes — a real portability bug even if the JSON technically parses locally.
Can JSON represent numbers larger than Number.MAX_SAFE_INTEGER (2⁵³)?▾
The JSON spec has no numeric precision limits, but most parsers parse numbers into IEEE 754 doubles, which cannot exactly represent integers above 2⁵³ − 1 (9,007,199,254,740,991). If you parse a JSON payload containing a 64-bit integer ID (common in Twitter/X APIs or database row IDs), the value will silently lose precision. The correct fix is to transmit large integers as strings in the JSON, or use a parser with BigInt support.
When should I minify JSON, and how much space does it actually save?▾
Minifying removes all non-significant whitespace and newlines to produce the smallest possible valid JSON string. You would minify for production API responses or embedding in HTML/JS bundles where every byte matters — a 10 KB prettified JSON config can shrink to ~6 KB minified (roughly 40% reduction). For config files committed to source control, formatted JSON is far preferable for readability and diff clarity.
Why does my formatter change Unicode escape sequences like \u00e9 to é?▾
Both forms are valid — \u00e9 is a JSON Unicode escape and é is its literal UTF-8 representation. Formatters that normalize these are making a safe transformation, since modern systems handle UTF-8 directly. However, if your output must pass through a transport layer that isn't UTF-8 safe (some legacy SMTP gateways, certain XML parsers), keeping the \uXXXX escape form is the safer choice.