How to use the JSON Formatter
- 1
Paste minified or messy JSON into the editor, or drop a .json file onto it.
- 2
Press the Format button in the menu bar (or Ctrl+I) to pretty print with two-space indentation. Press Compact (Ctrl+Shift+I) to undo it.
- 3
Use Sort in the menu bar to order object keys alphabetically at any level for cleaner diffs.
- 4
Use Copy to put the formatted or compact JSON on your clipboard, or Save to download it as a file.
Features
- One-click Format and Compact with keyboard shortcuts
- Switch to tree or table view to read the structure
- Optional alphabetical key sorting at every nesting level
- Pinpoints syntax errors by line and column if the input is not valid
- Handles files up to 25 MB entirely in your browser
- Copy or download the output with one click
- Works offline after the first load
Why format JSON
Minified JSON is perfect for machines and useless for people. A single 40 KB line from an API response is impossible to scan for the field you need. Formatting adds line breaks and indentation so the structure becomes visible: which keys belong to which object, how deep the nesting goes, where an array starts and ends.
This formatter does it live. Paste on the left, read on the right. There is no submit button and no page reload.
Formatting and version control
Teams that commit JSON files (package manifests, translations, fixtures, infrastructure config) benefit from a consistent style. A formatter with key sorting produces the same output for the same data every time, so a diff shows only the real change instead of a reshuffled file. Many teams run a formatter as a pre-commit hook for exactly this reason.
Related tasks
If you only need to check whether a document is valid, the JSON Validator gives a clearer error report. To go the other way and shrink JSON for production, use the JSON Minifier. For editing values in place with folding and search, open the full JSON Editor.
Frequently asked questions
What is the difference between a JSON formatter and a JSON beautifier?
Will formatting change my data?
Why does Format do nothing?
Which indentation should I use?
Is my JSON sent to a server?
Last updated .