JSON Formatter and Validator
Format, validate, minify and sort JSON — errors point to line and column.
About this tool
Paste any JSON document to pretty-print it with 2 spaces, 4 spaces or tabs. If the input is not valid JSON, the error names the exact line and column, and calls out common mistakes such as single-quoted strings or a trailing comma.
Minify removes every space and line break, which is the smallest form for sending over the network or storing in a config value. Sort keys reorders the properties of every object alphabetically, at every depth, so two documents with the same data produce the same text and diff cleanly.
Very large integers beyond 2^53 cannot be kept exactly by JavaScript, so the formatter warns you when re-formatting would change a number.
How to use it
- Paste your JSON into the input box.
- Pick an indent of 2 spaces, 4 spaces or a tab, or turn on Minify or Sort keys.
- Format it and copy the result. If the JSON is invalid, fix the line and column the error names.
Example
Input:
{"name":"Ada","tags":["math","code"],"active":true}Formatted with 2 spaces:
{
"name": "Ada",
"tags": [
"math",
"code"
],
"active": true
}