Format and validate JSON
JSON represents structured data with objects, arrays, strings, numbers, booleans, and null. Compact JSON is useful for transfer but harder to read. Indentation makes nesting clear when reviewing or debugging a response. This tool uses the browser JSON parser to validate syntax; it reports invalid input but does not repair missing quotes, trailing commas, comments, or other non-JSON syntax. Minifying removes unnecessary whitespace without changing values or field order.
Common uses
- Read or review nested JSON returned by an API.
- Check a configuration or log snippet before sharing it.
- Remove indentation and line breaks to create compact JSON.
How to format JSON
- 1
Paste JSON
Enter a complete JSON object, array, or any other valid JSON value.
- 2
Choose a format
Select two- or four-space indentation, or switch to minified mode.
- 3
Copy or download
Copy the result or download it as a .json file.
Formatting example
Input
{"name":"Ada","role":"developer","active":true}Result
{
"name": "Ada",
"role": "developer",
"active": true
}Formatting adds line breaks and indentation. Strings, numbers, booleans, and field values stay the same.
Frequently asked questions
Why does JSON with comments fail?
Standard JSON does not allow comments, single-quoted strings, or trailing commas. Remove those extensions before formatting.
Does formatting change my data?
It does not change the parsed values. Field order is retained, though numbers and escaped characters may be serialized according to standard JSON rules.
What is the difference between formatting and minifying?
Formatting adds indentation and line breaks for people to read. Minifying removes extra whitespace for transfer or embedding. Both represent the same data.