Paste minified JSON and instantly beautify it with proper indentation and syntax highlighting. Free JSON pretty printer — no signup, no data sent to servers.
Beautify JSON Now →Minified (hard to read):
{"user":{"id":101,"name":"Alice Johnson","email":"alice@example.com","roles":["admin","editor"],"active":true,"address":{"city":"New York","zip":"10001"}}}
Beautified (2-space indent):
{
"user": {
"id": 101,
"name": "Alice Johnson",
"email": "alice@example.com",
"roles": [
"admin",
"editor"
],
"active": true,
"address": {
"city": "New York",
"zip": "10001"
}
}
}
// 2-space indent (most common)
JSON.stringify(JSON.parse(minifiedJson), null, 2);
// 4-space indent
JSON.stringify(JSON.parse(minifiedJson), null, 4);
// Tab indent
JSON.stringify(JSON.parse(minifiedJson), null, '\t');
// Sort keys alphabetically while beautifying
const sorted = (k, v) => v instanceof Object && !Array.isArray(v)
? Object.keys(v).sort().reduce((acc, key) => ({ ...acc, [key]: v[key] }), {})
: v;
JSON.stringify(JSON.parse(minifiedJson), sorted, 2);
import json
minified = '{"name":"Alice","age":30,"city":"NYC"}'
# Beautify with 2-space indent
beautified = json.dumps(json.loads(minified), indent=2)
print(beautified)
# Sort keys + 4-space indent
beautified_sorted = json.dumps(json.loads(minified), indent=4, sort_keys=True)
# Beautify a file
with open('data.json') as f:
data = json.load(f)
with open('data-pretty.json', 'w') as f:
json.dump(data, f, indent=2, ensure_ascii=False)
# Using Python (available on any system) cat data.json | python3 -m json.tool # Using jq (must be installed) cat data.json | jq . # With 4-space indent in jq cat data.json | jq --indent 4 . # Pretty print an API response curl https://api.example.com/users | python3 -m json.tool
| Style | Standard | Used By |
|---|---|---|
| 2 spaces | Most common | JavaScript, Node.js, most web APIs |
| 4 spaces | PEP 8 | Python, Java, C# ecosystems |
| Tabs | Adjustable | Teams that prefer tabs (width is editor-defined) |
JSON.stringify(data, null, 2) in JavaScript.Free, instant, private. Your JSON never leaves your browser.
Open JSON Beautifier →Also useful: JSON Formatter | JSON Minifier | JSON Diff | Validate JSON