How to use the JSON Formatter
- Pick one or more .json files.
- Set the indentation (2 spaces, 4 spaces or tabs) and tick Sort keys if you want alphabetical order.
- Run it and save the formatted files; they keep their original names.
A strict check comes with it
Before anything is rewritten, the file is checked against the JSON standard. Common hand-editing slips, such as a comma after the last item, single quotes, comments or a missing closing bracket, are reported as "line 14, column 3: trailing comma before ]" or similar, so you can go straight to the spot.
Nothing is guessed or repaired automatically. A file that passes is valid for any program that reads JSON.
Reference numbers are left alone
Many formatters quietly round integers above 9,007,199,254,740,991, which corrupts long order or account references. In current Chrome, Edge and Firefox this page writes every number with its original digits, and amounts like 10.50 keep their trailing zero.
The exception is key sorting: sorting rebuilds every object, so very long integers may then lose precision. Keep sorting off for files with such numbers.
Sorting to compare two versions
Exports from the same system can list fields in a different order each time. Sorting keys alphabetically at every level lines two versions up, so a compare tool shows only real changes. Lists keep their order.
The file is processed in the tab and never uploaded.
Questions
Can it repair my file?
No. It points to the first error; correct it and run the formatter again.
Which indentation is best?
Two spaces is the most common; tabs suit editors set to show them wide.
Does the formatted file get a new name?
No. It keeps the original file name, so save it in another folder if you want to keep the compact version as well.
Can I format a JSON Lines file?
No. A .jsonl file holds one document per line, so the second line is reported as an error. JSON to CSV and JSON to YAML read JSON Lines.