How to use it
- Paste JSON into the box, drop a file on it, or select “Open a file”.
- Choose the action: format, minify or check only; for formatting also the indentation.
- Turn on “Sort keys A–Z” or “JSON Lines” if you need them; the result updates by itself.
- Copy the result or download it as a .json file. For an error, select “Show in the text” to go to it.
Rules and limits
How the JSON is written
- Only the white space between values changes: every number, string,
true,falseandnullis copied as written, so1.0,1e400,-0,12345678901234567890and escapes such as\u00e9stay as they are. - Format puts each value on its own line, indented by 2 or 4 spaces or a tab, as
"key": value, the layout ofJSON.stringify(value, null, 2); empty objects and arrays stay{}and[]. Minify removes all white space. - “Sort keys A–Z” orders the keys of every object at every level by Unicode code point; a key that appears twice keeps its place among its copies, so the last one still counts. Arrays keep their order.
- A byte order mark at the start is left out; the download is UTF-8 without one.
What is checked
- The JSON standard (RFC 8259) exactly: no comments, no single quotes, no trailing commas, no
NaNorInfinity, no leading zeros, control characters in strings only escaped. - The first error is shown with its line and column (an emoji counts as one character) and the same message as on the other JSON pages of this site.
- Valid, but reported: keys that appear twice in one object, and numbers that JavaScript would read as another value (integers beyond 9,007,199,254,740,991, numbers too large or too small for a 64-bit float).
- JSON Lines: every line holds one complete value; blank lines are skipped and counted.
Limits
- Tested in Chrome on a laptop with a 50 MB JSON file (393,188 records): formatted in 5.2 s, minified in 2.8 s, checked in 2.1 s, with sorted keys in 11.8 s. Inputs over 50 MB are refused with a message.
- The result box shows the first 200,000 characters; Copy and Download give everything. Files over 1 MB are read without filling the text box.
- Up to 5,001 levels of nesting.
Questions and answers
Why does my number 12345678901234567890 stay unchanged here?
Because this page never turns numbers into JavaScript numbers: it copies them character by character. Browsers, Node.js and many other programs keep only about 16 significant digits, so the page also tells you which of your numbers they would change.
Is a duplicate key an error?
Not by the standard: RFC 8259 only says that names should be unique, so the JSON is still valid. Most programs then keep just the last value, which is why the page warns you and leaves every copy in the result for you to decide.
Can it read JSON with comments or a comma before the closing bracket?
No: comments, single quotes and trailing commas belong to JavaScript and JSON5, not to JSON, and most programs refuse them. The page shows where the first one is, so you can remove it.
What is JSON Lines?
A file with one JSON value on each line, common for logs and data exports (.jsonl, .ndjson). With the switch on, each line is checked on its own; “Minify” then writes one record per line, “Format” writes the records one after another in readable form.