JSON formatter
Turn minified or inconsistently indented JSON into something you can read. Formatting also validates, so if it comes out formatted, it parsed.
Conversion happens in this browser tab. Nothing is uploaded, logged, or stored.
Formatting and what it tells you
Paste minified or badly indented JSON and get it back with consistent indentation, one key per line, and structure you can actually scan. The document is parsed first, so formatting doubles as a validity check — if it formats, it is valid JSON.
Indentation is not cosmetic when you are debugging. A missing closing brace is invisible in a single-line document and obvious the moment the nesting is laid out, because the indentation runs off in a direction it should not.
Before and after
{"order":{"id":"SO-4471","lines":
[{"sku":"A-1001","qty":2}],"paid":true}}{
"order": {
"id": "SO-4471",
"lines": [
{
"sku": "A-1001",
"qty": 2
}
],
"paid": true
}
}Choosing an indent width
| Width | Where it is the convention |
|---|---|
| 2 spaces | package.json, most JavaScript tooling, the default nearly everywhere |
| 4 spaces | Python's json.tool, .NET tooling, deeply nested documents that need the extra separation |
| Tabs | Rare in JSON, but valid — teams that want reviewers to control display width |
| None (minified) | Anything sent over the wire. See the minifier. |
Pick one and enforce it with a formatter in CI. Mixed indentation produces diffs full of whitespace noise that hide the real change.
Sorting keys
The sort option alphabetises every object. It is useful for comparing two documents that hold the same data in different orders — sort both and the diff collapses to the genuine differences.
Do not sort files that humans read. In a package.json or a config file,
key order carries meaning: name and version belong at the top. Sorting scatters related
fields and makes the file harder to navigate.
Formatting from the command line
# jq, the standard tool
jq '.' input.json > formatted.json
jq --indent 4 '.' input.json # 4-space
jq -S '.' input.json # sorted keys
# Python, already installed
python -m json.tool input.json formatted.json
# Prettier, if it is already in your project
npx prettier --write '**/*.json'
Formatting happens locally
A response you are formatting because you cannot read it is, almost by definition, a response you have not inspected yet. Bearer tokens, session identifiers, internal IDs, and personal data all routinely pass through this box on their way to being legible.
They go no further. Formatting is a parse and a re-serialise, both performed by JavaScript in this tab. Nothing is sent anywhere, and closing the tab is all the cleanup required.