Formatting JSON means converting compact, hard-to-read JSON into a structured, indented format where each key and value is on its own line. It makes JSON human-readable without changing its data.
What formatted JSON looks like
Minified JSON:
{"user":{"name":"Alice","age":29},"active":true}
Formatted (2-space indent):
{
"user": {
"name": "Alice",
"age": 29
},
"active": true
}
How to format JSON using FormatGenie
Go to the JSON Formatter tool. Paste your JSON. Choose an indent size (2 or 4 spaces). Click Format. The tool also validates your JSON and shows any syntax errors with a description of what went wrong.
Common JSON errors and how to fix them
Trailing comma: {"key": "value",} — Remove the comma after the last item. JSON does not allow trailing commas.
Single quotes: {"key": 'value'} — Replace single quotes with double quotes. JSON requires double quotes for all strings and keys.
Unquoted keys: {key: "value"} — Add double quotes around the key: {"key": "value"}.
Comments: {"key": "value" // comment} — Remove comments. JSON does not support comments.
Use the Repair & Format button in the FormatGenie JSON Formatter to automatically fix trailing commas, unquoted keys, and single-quoted strings.
When to minify JSON
Minified JSON removes all whitespace to reduce file size. Use it for production API responses, embedded JSON in HTML, and JSON files that are read by machines, not humans. Never minify JSON that developers need to read or debug.