๐
JSON Formatter
Developer
Free JSON formatter to beautify with two or four spaces, or minify whitespace - invalid JSON shows a parser error so you can fix an API response or config before copying it back.
0
0
JSON
Formatted
{
"name": "John",
"age": 30,
"city": "New York"
}Beautify JSON with 2 or 4 spaces, or minify it, in the browser. Caps: 100,000 characters, 10,000 values, 64 nesting levels.
See moreSee less about the JSON Formatter
Parser errors are shown as text; for a tree view use JSON Tree View.
Examples
Beautify a compressed payload
Input: {"ok":true,"items":[1,2]}
Format (2 spaces):
{
"ok": true,
"items": [1, 2]
}Use double-quoted keys and strings. Comments and trailing commas are invalid JSON. For a collapsible tree, open JSON Tree View after formatting.
Minify before shipping
Input: { "ok": true, "items": [1, 2] }
Minify: {"ok":true,"items":[1,2]}Limits: 100,000 characters, 10,000 values and 64 nesting levels. Unsafe integers are rejected; quote large IDs as strings.
Key features
- Beautify with 2 or 4 spaces
- Minify for compact payloads
- Parser errors without uploading
Related Developer tools
Related Blog Posts
Quick answers for JSON Formatter
Does it fix invalid JSON?
No. It shows the parser error. Correct invalid input before formatting; comments and trailing commas are rejected.
What changes between Format and Minify?
Format (beautify) adds two or four spaces of indentation. Minify removes insignificant whitespace, keeping spaces inside strings.
What limits apply?
Input is limited to 100,000 characters, 10,000 values and 64 nesting levels. Unsafe integers are rejected; quote large identifiers to preserve their digits.
Does my JSON leave the browser?
No. Formatting and minifying run locally. For a collapsible tree after you fix the JSON, use JSON Tree View.