JSON Formatter & Beautifier
Pretty-print or minify JSON instantly — 100% local, nothing uploaded.
JSON Formatting Reference
Beautifying (pretty-printing) JSON adds indentation and newlines to make it readable — useful when inspecting API responses, debugging, or reviewing code. Minifying removes all insignificant whitespace outside string values, reducing payload size. For a typical real-world JSON response, minification saves 15–30% of bytes before any compression.
Compact JSON → Pretty-printed
Input
{"user":{"id":1,"name":"Alice","email":"[email protected]"},"active":true,"tags":["admin","editor"]}Output
{
"user": {
"id": 1,
"name": "Alice",
"email": "[email protected]"
},
"active": true,
"tags": [
"admin",
"editor"
]
}Valid JSON Syntax
| Type | Example | Notes |
|---|---|---|
| String | "Hello, world" | Must use double quotes — single quotes are not valid JSON |
| Number | 42 or 3.14 or -7 | No hex (0xFF), no leading zeros (07), no NaN, no Infinity |
| Boolean | true or false | Lowercase only — True and False are not valid |
| Null | null | Lowercase only — undefined is not a JSON value |
| Array | ["a", 1, true] | Ordered; no trailing comma after the last element |
| Object | {"key": "value"} | Keys must be double-quoted strings; no trailing comma |
Warning: JSON does not support comments. Remove
// ... or /* ... */ before pasting.Common Formatting Errors
| Error | Cause | Fix |
|---|---|---|
| Trailing comma | Comma after the last element in an array or object | Remove the final , |
| Comment | // or /* */ annotation inside JSON | Strip all comments — JSON has no comment syntax |
| Single-quoted string | Used ' instead of " | Replace all single quotes with double quotes |
| undefined value | JavaScript undefined used as a value | Replace with null — JSON has no undefined |
| NaN / Infinity | Non-finite JavaScript number used as a value | Replace with null or a string representation |
| Unquoted key | Object key written without double quotes | Wrap the key in double quotes: "key": value |
Frequently Asked Questions
Your files stay on your computer. Dad promised.