About this tool
Formatting (also called beautifying or pretty-printing) adds line breaks and indentation so the structure of JSON is easy to read. It only changes whitespace; keys, values and their order stay the same unless you choose Sort keys.
What does a JSON formatter do?
A JSON formatter, also called a beautifier or pretty printer, adds line breaks and indentation so the structure of the data is easy to read. Only whitespace changes. Keys, values and their order stay the same, unless you choose Sort keys.
Before: {"name":"Asha","tags":["dev","api"]}
After:
{
"name": "Asha",
"tags": [
"dev",
"api"
]
}Which indentation should I use?
Two spaces is the most common choice in JavaScript and web projects. Four spaces is common in Python and Java projects. Tabs let each reader pick their own display width. Use whatever your project or team already uses so file diffs stay clean.
Format and validate in one step
The formatter only produces output when the JSON is valid. If something is wrong you get the exact line and column of the error instead, so formatting doubles as a quick validity check.
How to use it
- Paste your JSON into the input box.
- Choose 2 spaces, 4 spaces or tabs.
- Copy the result or download it as a .json file.
Frequently asked questions
Why format JSON?
Minified JSON is hard to read. Formatting makes API responses and config files easy to review and debug.
Does formatting change my data?
No. Only whitespace changes.
Can I sort the keys?
Yes. Use Sort keys to order every object alphabetically, which is handy for comparing files.