Paste JSON to pretty-print it, squeeze it onto one line, or find exactly where it breaks.
.json file from your device.The tool reads your text with its own strict parser that follows the JSON grammar in RFC 8259: objects in braces, arrays in brackets, strings in double quotes, numbers without leading zeros, and the literals true, false and null. Because the parser is ours rather than the browser's built-in one, it can say why something failed and where, in the same words on every browser. It also recognizes common slip-ups and names them: single-quoted strings, unquoted keys, trailing commas, comments, and values like NaN or undefined that JavaScript allows but JSON does not.
Formatting rewrites the same data with consistent spacing. Two details make this formatter safer than a quick JSON.stringify round trip: numbers are copied exactly as written, so a 19-digit ID such as 12345678901234567890 is not rounded, and keys stay in their original order (unless you ask for sorting), even keys that look like numbers. If an object repeats a key, you get a warning, because most programs silently keep only the last one.
Example: the input {"b":1,"a":[true,null]} with 2-space indent and sorted keys becomes {, "a": [, true,, null, ],, "b": 1, } on separate lines. Minify turns it back into a single line with no spaces. Files of several megabytes are fine; the tree view only builds the branches you open, so very large documents stay responsive.
Why does it say "trailing comma"?
JSON does not allow a comma after the last item in an object or array, such as [1, 2, ]. JavaScript and some config formats accept it, but strict JSON parsers do not. Delete the comma just before the closing bracket.
Can it fix my JSON automatically?
No. Guessing what was meant can quietly change your data, so the tool points to the exact line and column instead. Most fixes are one character: a missing comma, a missing quote, or a stray bracket.
Will formatting change my numbers or strings?
Numbers are copied character for character. Strings keep the same text, but escape sequences may be written differently; for example \u00e9 becomes é, which is the same character.
How big a file can I format?
Files of 5 MB or more work in a modern desktop browser. The limit is your device's memory, since everything happens locally. Phones handle smaller files more comfortably.
Does it support JSON with comments (JSONC) or JSON5?
No. Those are different formats. The validator reports comments as errors so you know the file is not plain JSON. Remove the comments first if the file needs to be read by a strict JSON parser.