JSON Formatter

This JSON formatter indents your JSON neatly, optionally with keys sorted A–Z, so it is easy to read and diff. Only whitespace changes: every key, string and number stays exactly as you wrote it.

JSON

JSON

Waiting for input

What you get

How each result is checked

  1. Your JSON is parsed strictly (RFC 8259); errors show the position.
  2. The formatted output is compared with your input token by token: apart from whitespace (and key order, when sorting), it must be identical, character for character.

What can't convert exactly

  • Numbers keep their exact text: 1.0 stays 1.0 and a 64-bit ID like 9007199254740993 is not rounded, as it would be by tools that read the JSON into JavaScript first.
  • Key order is kept as written, including keys like "2" that JavaScript objects move to the front.
  • Duplicate keys are kept as written and reported: most JSON parsers keep only the last value.

Questions

Does formatting change numbers?

No. Numbers, strings (including escapes like \u00e9) and keys are copied exactly as written; only the whitespace between them changes. That includes integers above 9,007,199,254,740,991, which tools that parse JSON in JavaScript would round.

Is my data uploaded?

No. Everything runs in your browser, in a background worker. Nothing is sent to a server.

What is the difference between a JSON formatter and a JSON validator?

A formatter lays JSON out to be readable; a validator says whether it is valid and where it is not. This formatter also validates: invalid JSON is not formatted, and the error is shown with its line.

How big a JSON file can I format?

Files of several megabytes work. As a guide, a 7 MB JSON array of 50,000 records converts and is checked in a few seconds on a laptop. The limit is your browser’s memory, since nothing is uploaded.

How do I use the JSON Formatter online?

Paste your input or open a file on the left. The result appears on the right as you type, already checked; copy or download it. Nothing is uploaded: the JSON Formatter runs in your browser.