JSON formatter
Pretty-print JSON with a fixed two-space indent. Strict parsing rejects comments and single quotes, and big integers lose precision past 15 or 16 digits.

Invalid input for this operation.
—
What to know
This page parses your text as JSON and prints it back with two-space indentation, one key or array element per line. The input {"b":1,"a":[1,2],"n":{"x":null}} comes back as a tall, indented block with b, a and n in their original order.
The parser is the strict one built into the browser. Single-quoted strings, comments, trailing commas, unquoted keys, NaN and an empty input all fail, and the Output panel shows Invalid input for this operation without saying where. When that happens, check the last comma before a closing bracket first, then the quotes around keys.
Three behaviours surprise people. Integers beyond 2 to the 53rd power lose precision, so 12345678901234567890 comes back as 12345678901234567000.
Keys that are plain whole numbers move to the front in ascending order, so a "2" key written first will print after a "1" key. And when a key repeats, the last value silently wins.
Numbers are rewritten in their shortest form, so 1.0 becomes 1 and 1e2 becomes 100, and escaped characters such as the sequence u00e9 come back as the literal letter é. The indent is fixed, with no tab, minify or sort-keys option, which makes the page best for reading and diffing rather than shrinking payloads.
Choose a specific task 2
Related tools 4
How to use JSON formatter
- Paste a one-line response such as {"id":12345678901234567890,"2":"x","1":"y"} into the Text input box.
- Read the Output panel, where the keys 1 and 2 appear first and the long id ends with 000 because of number precision.
- If you see an error, delete trailing commas and swap single quotes for double quotes, then check again.
- Copy the formatted JSON into your editor, or save it as chatcument-text-output.txt for a code review.
Quick answers
Why did my long number change?
JSON numbers are read as double-precision floats, which hold about 15 to 16 exact digits. A value like 12345678901234567890 prints as 12345678901234567000, so keep such IDs as strings.
Does it keep my key order?
Mostly. Keys that look like whole numbers are moved to the front in ascending order, while all other keys keep the order you wrote.
Can it fix single quotes or trailing commas?
No. It only formats valid JSON and reports Invalid input for this operation for anything else, so repair those spots yourself first.
Can I minify or change the indent?
No. The indent is fixed at two spaces, and there is no minify or key-sorting option on this page.
