100% local — your data never leaves your browser

JSON Formatter — Read a Minified Payload

Indent JSON with the numbers left exactly as written. A twenty-digit ID keeps its digits and 1.0 stays 1.0, so you read the response, not a copy.

Instant Private Zero cookies
Indentation

JSON input

JSON output

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:

writtenafter a parse/print round trip
1234567890123456789012345678901234567000
1.01
1e400null

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.

Frequently asked questions

Why do other formatters change my numbers?
Because they parse to a JavaScript value and print it back, and a JavaScript number is a double-precision float. `12345678901234567890` becomes `12345678901234567000`, `1.0` becomes `1`, and `1e400` — beyond the largest double — becomes `null`. This one keeps each number’s literal text, so formatting changes the layout and nothing else.
Why is a duplicate key an error?
Because there is no right answer. RFC 8259 says names in an object *should* be unique, and leaves the behaviour undefined when they are not: some parsers keep the first, most keep the last, some reject. Silently picking one would produce a document that means something different from the one you pasted. The position of the second key is in the message.
Can it read JSON with comments or trailing commas?
No. Those belong to JSON5 and JSONC, which are different languages with the same name on the file. Accepting them here would mean producing output that half the world’s parsers reject. The error names the position of the offending character.

Related converters