JSON Formatter
Pretty-print or minify JSON, sort keys, and find errors with the exact line and column.
How to use the JSON Formatter
- Paste your JSONPaste it into the input box, or press Sample to try it.
- Format or minifyChoose indentation and whether to sort keys alphabetically.
- Copy or downloadCopy the result or save it as a .json file.
Example
Input: {"name":"Ada","langs":["en","fr"]}
Formatted with 2 spaces: { "name": "Ada", "langs": [ "en", "fr" ] } on separate lines
Frequently asked questions
Is my JSON sent to a server?
No. Formatting happens entirely in your browser, so it is safe to use with private data such as API responses.
Why does it say my JSON is invalid?
Common causes are trailing commas, single quotes instead of double quotes, comments, or unquoted keys. The error shows the line and column so you can fix it.
What does “Sort keys” do?
It orders object keys alphabetically at every level. This makes it easier to compare two JSON files or keep config files tidy.