JSON formatter and beautifier
Paste JSON, press ⌘⇧F, and read it. Formatting happens in your browser — the document is never uploaded — and it will not quietly change your numbers.
Open the editor →Most formatters corrupt large numbers
The usual way to format JSON is JSON.stringify(JSON.parse(text), null, 2).
That parses every number into a JavaScript double, and doubles cannot represent integers
beyond 253. Feed a snowflake ID or a database bigint through such a formatter and
it comes back wrong:
{ "id": 12345678901234567890 } // before formatting
{ "id": 12345678901234567000 } // after a stringify/parse formatter
Those last three digits are gone, silently, in data that still looks plausible. JsonBro formats by editing the concrete syntax tree instead: whitespace between tokens changes, and the tokens themselves are copied through untouched. The same protection applies to high-precision decimals and exponent notation.
What formatting does
- Indent with 2 or 4 spaces, or tabs — your choice, remembered between visits.
- Minify to a single line when you need the smallest payload (⌘⌥M).
- Sort keys alphabetically, at every level, without reordering array items (⌘⌥S).
- Format on paste, if you would rather not press anything.
All three transforms preserve the exact text of every value. Sorting keys on a document with duplicate keys keeps both, and flags them, rather than dropping one.
When the document will not format
Formatting needs a parseable document. If yours is invalid, the editor explains the problem in plain language, points at the line, and offers a one-click repair for the common causes: trailing commas, single-quoted strings, unquoted keys, comments and smart quotes pasted from a document editor. See the JSON validator for what each message means.
Questions
Does formatting change my data?
No. Only whitespace between tokens changes. Numbers, strings and key order are preserved byte-for-byte, including integers too large for JavaScript to represent exactly.
Is my JSON uploaded anywhere?
No. Parsing and formatting run in your browser. There is no backend to send data to, and no analytics.
How large a document can it format?
Documents of a few megabytes format comfortably. Past 3 MB some conveniences switch off to keep typing responsive, and the automatic-repair check is skipped above 2 MB.
Can I format JSON with comments or trailing commas?
Yes — repair those first. The editor detects comments, trailing commas, single quotes and unquoted keys and can strip or correct them in one action, after which the document formats normally.