How to use it
Paste your JSON into the input box and the result appears. Choose “Format” to apply indentation (2 spaces, 4 spaces, or a tab) so the structure is easy to scan, or “Minify” to strip all the unnecessary whitespace and line breaks and shrink the size. “Validate” checks the syntax without changing anything. Turn on “Sort keys” to recursively sort every object’s keys in alphabetical (strictly, Unicode code unit) order, and “Escape non-ASCII” to turn characters like emoji or non-Latin text into \uXXXX escapes. If the JSON you pasted isn’t valid, you’ll see an error instead of a result, with the exact line and column of the problem and a small snippet of the surrounding text.
Format, minify, and validate are three different jobs
All three modes work on the same JSON, but for different purposes. “Format” (pretty-printing) adds indentation and line breaks to make the document easy for a person to read; “Minify” does the opposite, stripping that whitespace to shrink the file size. Neither one changes the actual values — except for the cases described in “Big numbers can lose precision” below (an out-of-range number becoming null, a duplicate key keeping only its last value), and one more: a -0 in the input becomes 0 in the output. “Validate” isn’t about displaying anything — it just checks whether the JSON is syntactically correct. All three go through the same parser internally, so a successful format or minify is itself proof that the JSON was valid.
Common JSON syntax mistakes
JSON’s grammar is simple, but it’s strict about small things. The usual culprits are a trailing comma left after the last item in an array or object ([1, 2, 3,]), strings or keys wrapped in single quotes instead of double quotes (JSON only allows double quotes), object keys without quotes at all ({name: "a"}), // or /* */ comments left in from editing, a leading zero on a number (01), and mistaking a JavaScript object literal — which can have undefined values or trailing commas — for JSON. Turning on “Allow comments & trailing commas” cleans up comments and trailing commas automatically before parsing, but other syntax problems like single-quoted strings or unquoted keys still need to be fixed by hand.
JSON vs. JSON5 vs. JSONC
“JSON” is the strict standard defined by RFC 8259 and ECMA-404: no comments, no trailing commas, and strings must use double quotes. “JSON5” and “JSONC” (JSON with Comments, familiar from editor config files like VS Code’s settings.json) are more permissive dialects meant to be friendlier to write by hand, allowing comments, trailing commas, and sometimes unquoted keys. This tool checks standard JSON by default, but turning on “Allow comments & trailing commas” lets it accept the most common JSON5/JSONC habits — comments and trailing commas — by stripping them before parsing. That option is built to leave // and commas inside string values alone.
Big numbers can lose precision
JavaScript has a single number type, an IEEE 754 double-precision float, which can only represent integers exactly up to 2^53 - 1 (9007199254740991, 16 digits). If a JSON document contains a longer integer literal — a 64-bit snowflake ID used by some systems, for example — JSON.parse will round it to the nearest value it can represent, silently changing the last few digits with no error raised. This tool scans the raw text for integer literals of 16 digits or more before parsing and shows a warning, without altering the value (rewriting it, say to a string, would change the shape of your document). If you need the exact value preserved, store it as a string at the source, or use a tool built specifically to handle big integers.
Two other cases also change values without raising an error, and the tool warns about both. A number too large for a double at all, such as 1e400, is read as Infinity and becomes null in the output. And if the same key appears more than once in one object, JSON.parse keeps only the last value and silently drops the earlier ones.
Privacy
The JSON you paste is processed entirely in this browser tab and is never stored or transmitted anywhere. Closing the page discards it.