What this tool does
It re-indents. The characters that make up each value stay exactly as you typed them.
{"id":12345678901234567890,"ratio":1.0,"huge":1e400}
{
"id": 12345678901234567890,
"ratio": 1.0,
"huge": 1e400
}
The obvious way changes your numbers
Run the same input through the obvious implementation — JSON.parse then JSON.stringify — and all three values change:
| written | after a parse/print round trip |
|---|---|
12345678901234567890 | 12345678901234567000 |
1.0 | 1 |
1e400 | null |
A JavaScript number is a double-precision float. It holds about fifteen digits, it does not remember that you wrote a decimal point, and beyond roughly 1.8 × 10³⁰⁸ it becomes Infinity — which JSON cannot represent, so it prints as null.
None of that is a rounding curiosity. 12345678901234567890 is what a Twitter snowflake, a PostgreSQL bigint or a payment reference looks like, and a formatter that changes it hands you a file that no longer points at the same row.
This tool reads each number as the text it is and writes that text back.
Duplicate keys are refused, not resolved
{ "port": 8080, "host": "example.com", "port": 3000 }
RFC 8259 says object names should be unique — a SHOULD, not a MUST — and says nothing about what to do when they are not. In practice parsers disagree: most keep the last, some keep the first, some reject the document.
Choosing for you would produce a file that means something different from the one you pasted, and nothing would say so. The tool stops and gives the position of the second key.
Strict JSON only
No comments, no trailing commas, no single-quoted strings. Those are JSON5 and JSONC — different languages that happen to live in files called .json.
Accepting them would mean producing output that half the world’s parsers reject, which is the opposite of what a formatter is for. The error message names the position of the character that broke it.
The two settings
Indentation — two spaces by default. Zero produces the minified form.
Sort keys — alphabetical, recursively, arrays left in their order. Handy before comparing two files; leave it off when the key order is meaningful.
Private by design
Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.