gizmobench

JSON Formatter

Paste JSON and get it back indented, validated and explained. Errors name the actual mistake with a line and column, whether a trailing comma, a Python True or a single-quoted string, and your key order and big numbers come through exactly as written, which most formatters silently break.

Formatted

Formatted JSON appears here.

Errors say line + causeKey order keptBig numbers intactNothing uploaded
Show
Indent
Keys

Common questions

Why do other formatters reorder my keys?
Because they parse your JSON into a JavaScript object and print that object back out, and JavaScript reorders integer-like keys, so an object written as {"2": …, "1": …} comes back as 1, 2. This tool re-emits your own tokens instead of a parsed copy, so keys stay exactly where you wrote them.
What happens to very large numbers?
They keep every digit. A parse-and-print formatter turns 12345678901234567890 into 12345678901234567000, because JavaScript numbers hold about 16 significant digits. That is a silent corruption if the value is a database ID. Working from tokens means the literal is copied, never converted.
What makes an error message here different?
It names the cause, not just the position. A trailing comma says so. True with a capital T is recognised as Python. undefined and NaN are named as JavaScript that JSON does not have. Single quotes, missing colons, unclosed strings and leading zeros all get their own explanation, each with a line and column.
Are duplicate keys an error?
No. The JSON standard permits them, and nearly every parser silently keeps only the last value. That combination makes them a bug you cannot see, so this tool flags them as a warning with the line number while still formatting the document.
Can it handle JSON with comments?
It will tell you precisely that comments are the problem. Comments are JSONC, an extension used by editors like VS Code for config files: valid there, invalid in JSON itself. The error points at the first comment so you know what to strip.
Is my JSON uploaded anywhere?
No. Parsing, validation and formatting all run in your browser. That matters for JSON more than most formats, because payloads routinely contain API responses, tokens and customer records that should not be pasted into someone else's server.

Exact. Key order, big integers and precision are preserved. Nothing is rounded or reordered behind your back.