JSON Formatter & Beautifier

Paste minified or messy JSON and get clean, indented output. If the JSON is invalid you get the exact line and column of the problem.

Formatted JSON
Ctrl + Enter to run

Runs 100% in your browser — your data is never uploaded to our server.

Make JSON readable in one click

APIs, log files and configuration exports often deliver JSON on a single line. A JSON formatter (also called a JSON beautifier or pretty printer) adds line breaks and indentation so you can see the structure: which objects are nested inside which, how long arrays are, and where a value lives. The data itself is not changed — only whitespace is added.

Formatting also validates the document. If a comma is missing, a string uses single quotes, or there is a trailing comma, the formatter stops and shows a precise message such as Expected ',' or '}' after property value (line 4, column 12) with a caret under the problem character.

Options

  • 2 spaces – the most common style (used by npm, Prettier and most APIs).
  • 4 spaces – common in Python and Java projects.
  • Tabs – lets each editor decide the visual width.
  • Minify – removes all optional whitespace for the smallest payload.
  • Sort keys A→Z – sorts object keys recursively, which makes two documents much easier to compare or review in a diff.

Example

Input

{"name":"Asha","roles":["admin","dev"],"active":true}

Formatted

{
  "name": "Asha",
  "roles": [
    "admin",
    "dev"
  ],
  "active": true
}

Common JSON syntax errors

ProblemWrongRight
Trailing comma[1, 2,][1, 2]
Single quotes{'a': 1}{"a": 1}
Unquoted key{a: 1}{"a": 1}
Comments{"a": 1 // note}JSON does not allow comments
Special numbersNaN, Infinity, undefineduse null or a string

Frequently asked questions

Does formatting change my data?

No. Only whitespace is added or removed. Key order is preserved unless you enable “Sort keys”.

What is the difference between the formatter and the validator?

Both parse the JSON. The formatter focuses on producing readable output; the validator focuses on the result of the check and shows statistics such as depth and key count.

Can I format very large JSON files?

Yes. Everything runs locally, so multi-megabyte files work. For inputs over about 2 MB, live formatting pauses and you press Format manually.

Is my data private?

Yes. The JSON never leaves your browser.