Home › JSON Beautifier

JSON Beautifier Online

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 →

Before and After Beautification

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"
    }
  }
}

Beautify JSON in JavaScript

// 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);

Beautify JSON in Python

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)

Beautify JSON from Command Line

# 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

Indentation Style Guide

Style Standard Used By
2 spacesMost commonJavaScript, Node.js, most web APIs
4 spacesPEP 8Python, Java, C# ecosystems
TabsAdjustableTeams that prefer tabs (width is editor-defined)

Frequently Asked Questions

What is JSON beautification?+
JSON beautification (also called JSON formatting or JSON pretty-printing) takes compact or minified JSON and adds proper indentation, line breaks, and spacing to make it human-readable. The data itself is unchanged — only the presentation improves.
What is the difference between JSON beautifier and JSON formatter?+
They are the same thing — 'beautifier', 'formatter', 'pretty-printer', and 'prettifier' all refer to adding whitespace and indentation to JSON. JSON Web Tools uses these terms interchangeably. Both produce the same result.
What indentation options are available?+
The beautifier supports 2-space indent (most common in JavaScript projects), 4-space indent (common in Python and Java), and tab indent. The default is 2 spaces, matching JSON.stringify(data, null, 2) in JavaScript.
Can I beautify JSON in VS Code?+
Yes. Open the JSON file in VS Code, then press Shift+Alt+F (Windows/Linux) or Shift+Option+F (Mac) to auto-format. VS Code uses its built-in JSON formatter. Install Prettier for consistent formatting across all file types in a project.
Does beautifying JSON affect file size?+
Yes — beautified JSON is larger than minified JSON due to added whitespace (typically 15–30% larger). For APIs, always use minified JSON in production. For config files and version-controlled data, formatted JSON gives better readability and cleaner git diffs.
Why should I use a JSON beautifier instead of doing it manually?+
Manual formatting is error-prone and slow for complex nested JSON. A beautifier handles any depth of nesting consistently, normalizes indentation, and is instant even for large files. It also catches syntax errors during the beautification process.

Beautify your JSON now

Free, instant, private. Your JSON never leaves your browser.

Open JSON Beautifier →

Also useful: JSON Formatter | JSON Minifier | JSON Diff | Validate JSON