JSON formatter
Make JSON easier to read. Check syntax, apply indentation, or produce compact output.
Input is processed in your browser and is not sent to the server.
Quick start
- Paste the original JSON.
- Choose Format or Minify.
- Compare large integers and duplicate keys with the original.
What formatting does
The tool uses JSON.parse and JSON.stringify in your browser. It formats the parsed value; it does not validate JSON Schema or business rules.
{"name":"PPORT","ports":[80,443],"enabled":true}Common syntax errors
| Input | Problem |
|---|---|
| {'name':'PPORT'} | Keys and strings require double quotes. |
| {"port":80,} | Trailing commas are not allowed. |
| Comments, undefined, NaN | These are not standard JSON values. |
Values that may change
When a key occurs more than once, earlier values may be lost during parsing. Integers greater than 2^53−1 may exceed JavaScript Number’s exact integer range. Keep identifiers as strings when required by your data model.
Keep a copy of the original. The tool allows at most 100 nesting levels and enforces size limits. Input is not sent to the server.
Format JSON without changing API identifiers
Try formatting {"id":9007199254740993,"amount":1.2300,"id":2}. This tool changes whitespace only, preserving numeric notation, string escapes, key order and duplicate keys. Receivers may interpret duplicate keys differently, so resolve them before sending an API request. Statistics describe the browser-parsed object and count duplicate keys once. Input is not sent to the server.
Checking whether a large integer changes
The same JSON can yield a different large integer depending on the language that reads it. JavaScript reads numbers as double-precision floating point, so integers above 2⁵³ are rounded, while Python keeps the integer as it is.
$ node -e "console.log(JSON.stringify(JSON.parse('{\"id\":9007199254740993}')))"
{"id":9007199254740992}
$ python -c "import json; print(json.dumps(json.loads('{\"id\":9007199254740993}')))"
{"id": 9007199254740993}If an ID from an API differs only in its last digits like this, it is a number-precision problem, not a JSON syntax error. The most reliable fix is to send the ID as a string.
Formatting and minifying from the command line
python -m json.tool data.json
jq . data.json
jq -c . data.json
Get-Content data.json -Raw | ConvertFrom-Json | ConvertTo-Json -Depth 20python -m json.tool and jq . indent the document, and jq -c . compacts it onto one line. PowerShell’s ConvertTo-Json expands only two levels when -Depth is omitted and turns deeper values into strings, so set -Depth high enough for deeply nested JSON.