Pretty print JSON
JSON Formatter & Beautifier
Turn a single line of minified JSON into neatly indented, syntax-highlighted text. Choose your indentation, sort keys alphabetically, then copy or download the result.
Select a node to see its pathThe beautified JSON and tree appear here as soon as your input is valid.
Drop to open
.json, .txt and other text files
How it works
How to use the JSON Formatter
- 01
Paste your JSON or open a file.
- 02
Pick 2 spaces, 4 spaces or tabs, and turn on “Sort keys” if you want stable, diff-friendly output.
- 03
Press Format, then Copy or Download the beautified JSON.
FAQ
Frequently asked questions
What does a JSON formatter do?
It re-writes JSON with consistent line breaks and indentation without changing the data. The output is easier to read, review and diff.
Should I indent with 2 spaces, 4 spaces or tabs?
Two spaces is the most common choice for JSON on the web and in JavaScript projects. Four spaces suits Python and Java teams. Tabs let each reader choose their own width. All three produce valid JSON.
Why sort keys?
JSON objects have no defined key order. Sorting keys alphabetically gives the same output for the same data, which makes diffs and code reviews much cleaner.
Is my JSON uploaded to a server?
No. All parsing, formatting and validation happens in your browser with JavaScript. Nothing you paste or open is sent to us or stored on a server. Share links keep the JSON inside the URL fragment (after the #), which browsers never send to servers.
Tools
More JSON tools
JSON Viewer
Free online JSON viewer, formatter and validator. Paste or upload JSON to beautify it, explore it as a tree and find syntax errors by line. 100% private.
JSON Validator
Validate JSON as you type. Errors are flagged on the exact line and column with a plain-English explanation and a one-click fix. Free and private.
JSON Tree Viewer
Explore JSON as a collapsible tree with type badges, item counts, search and click-to-copy JSONPath. Handles large files smoothly. Free online tool.
JSON Minifier
Minify JSON by stripping whitespace and line breaks to shrink payloads. See the size saved instantly. Free, private online JSON compressor.
JSON Repair
Repair invalid JSON automatically: trailing commas, single quotes, comments, unquoted keys, missing brackets, Python True/None and more. Free and private.