Online JSON Beautifier
Turn minified, one-line JSON into neatly indented code you can actually read. The JSON beautifier pretty prints your data in an editable code view, so you can tidy it up, sort the keys and compact it again when you are done. Errors are flagged by line before you waste time on broken input.
How to beautify JSON
- Paste minified or messy JSON into the left editor, or open or drop a .json file.
- The beautified JSON appears in the right editor, indented and highlighted. Press Format or Ctrl+Enter if Live is off.
- Edit the beautified JSON directly in the right editor if you need to. It is a full code editor, not a read-only preview.
- Copy it, download it, or press the left arrow between the editors to move it back to the input for another pass.
Beautify, pretty print, format: what is the difference?
Nothing important. "Beautify", "pretty print" and "format" all mean adding line breaks and indentation so JSON is readable. This page opens the result in an editable code view, which suits cleaning up a file you are about to commit. The JSON Formatter shows a fast preview, and the JSON Viewer opens a collapsible tree. Pick whichever view fits the job.
The opposite of beautifying is minifying: removing every optional space so the JSON is as small as possible. Press Compact to do that here, or use the JSON Minifier to see how many bytes you save.
When you need a JSON beautifier
- Reading API responses. Responses copied from the browser's Network tab, curl or Postman are usually one long line.
- Debugging logs. Payloads written to logs are compact to save space. Beautify them to find the field that went wrong.
- Tidying config files. Hand-edited files drift into inconsistent indentation. Beautifying gives them one style again.
- Code review. Beautified, consistently indented JSON produces small, readable diffs in Git.
- Documentation. Example payloads in docs and tickets are far easier to follow when they are indented.
Example
{"user":{"id":7,"name":"Grace Hopper","roles":["admin","editor"]},"active":true}
beautified with two-space indentation:
{
"user": {
"id": 7,
"name": "Grace Hopper",
"roles": [
"admin",
"editor"
]
},
"active": true
}
Tips for cleaner JSON
Sort keys
Choose Sort keys from the editor's ⋯ menu to put keys in alphabetical order. Two files with sorted keys are much easier to compare, by eye or with JSON Compare.
Choose the indentation
Set the Indent selector to match your project, usually 2 or 4 spaces. Indentation does not change the data, only how it looks.
Fix errors before you beautify
A beautifier needs valid JSON. If the status line reports an error, the JSON Validator shows exactly where it is, and JSON Repair can fix trailing commas, single quotes, comments and missing brackets automatically.
Make the editor comfortable
Open the settings dialog to pick a coding font, a larger size or a colour theme, and to turn on line wrapping for long strings.
Beautify JSON in your editor
If the JSON is already in a file, your editor can usually beautify it too: Shift+Alt+F in VS Code, Ctrl+Alt+L in IntelliJ IDEA and other JetBrains IDEs, or a "Pretty JSON" package in Sublime Text. On the command line, jq . file.json and python -m json.tool file.json do the same. The online JSON beautifier is the fastest option when the JSON is on your clipboard or you are not on your own computer.
Free, fast and private
This JSON beautifier is free, has no limits and needs no account. It runs in your browser, so the JSON you paste is never uploaded, and you can save your work in the browser or share it with a link when you choose to.