gizmobench
BrowseDaily

JSON Formatter

Paste one JSON value to beautify it, check its syntax or copy a compact version. The formatter keeps number literals and object key order as written, including long IDs and integer-like keys. Choose Formatted, Minified or Verdict; the Copy button uses the output you selected. Enable Sort keys for alphabetical object keys, or choose Minified for a compact result.

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.
How do I minify JSON into one line?
Choose Minified under Show, fix any syntax errors, then use Copy minified. The preview and copied text remove whitespace outside strings and keep spaces inside strings, original number text and the selected key order. Your input is left in the editor so you can return to Formatted. This reduces formatting bytes; it does not ZIP or gzip the payload.
Can I format an array, an API response or a JSON log?
Yes, when the pasted text is one complete JSON value. Objects, nested arrays and even a bare string, number, boolean or null are accepted. An API response body or one JSON log event can be formatted directly. HTTP headers, line-delimited JSON with several records, and text mixed with log prefixes must be separated first; the page does not fetch a URL or read a stream.
Is this a JSON schema validator or JSON-LD checker?
This checks JSON syntax, not business rules, schema.org types or rich-result eligibility. Use the related JSON Schema Validator to check a document against supported Draft 2020-12 constraints. A syntactically valid JSON-LD block can still describe the wrong thing.
Can it unescape a JSON string or fix invalid JSON automatically?
It preserves string escapes instead of decoding an embedded document or repairing it. A quoted string containing JSON is still a string here. Invalid escapes, incomplete Unicode escapes, raw control characters, comments and trailing commas are reported; edit the input before copying a result. It is a browser page, with no native application, editor plugin, collapsible tree or JSONL processor.

Formatting and minification preserve original string and number tokens. Object keys stay as written unless sorting is enabled; sorted keys are compared by decoded name, without case, while array order stays unchanged. Syntax checking is separate from schema validation.