Format, beautify, validate, or minify JSON in your browser. Choose indentation, optionally sort object keys, and copy or download the result. Your JSON stays on your device.
Formatting and validation run locally in your browser. Nothing is uploaded.
The JSON Formatter turns compact or inconsistently spaced JSON into readable, consistently indented text. It also minifies JSON for compact output, validates syntax, and can sort object keys. Unlike a JSON viewer, this tool produces clean JSON text that you can copy, save, or use in another application.
Use Ctrl + Enter to format, or Ctrl + Shift + Enter to minify. On Mac, use the Command key instead of Ctrl.
Before:
{"user":{"name":"Ada","active":true},"scores":[98,87,92]}
After formatting with two spaces:
{
"user": {
"name": "Ada",
"active": true
},
"scores": [
98,
87,
92
]
}
Enable Sort object keys to sort keys alphabetically in every object, including nested objects. Arrays keep their original order. Sorting changes the order of object properties in the output, so leave the option off when you need to preserve the input order.
Formatting changes whitespace, not the underlying JSON values. Minified output keeps the same data while removing spaces and line breaks that are not needed by JSON.
JSON requires double quotes around property names and string values. Check for missing commas, unmatched braces or brackets, comments, and trailing commas. Standard JSON does not allow comments or trailing commas. The formatter only produces output after the input parses as valid JSON.
JSON formatting, validation, sorting, and minification happen locally in your browser. The JSON Formatter does not upload or store your input. Files up to 50 MB can be opened in the tool; very large or deeply nested documents may use significant browser memory.