JSON Beautifier & Formatter Online

Pretty-print, validate and minify JSON in one click. Invalid JSON gets a clear error message.

Input —
Drop file to load
0 lines · 0 chars
Output —
0 lines · 0 chars
Ready. Paste something and press Beautify.

About this JSON Beautifier & Formatter

Use this JSON beautifier to turn compact or one-line JSON (API responses, config files, logs) into neatly indented, readable JSON. It also works as a JSON validator: if your JSON is broken, you see what went wrong instead of a silent failure.

Need the opposite? Minify JSON to strip all whitespace before sending it over the network or storing it.

Features

How to use

  1. Paste JSON into the Input box.
  2. Press Beautify to format, or Validate to only check it.
  3. Press Minify to get compact single-line JSON.
  4. Copy the result.

Example

Before

{"id":7,"name":"Asha","roles":["admin","editor"],"active":true}

After

{
  "id": 7,
  "name": "Asha",
  "roles": ["admin", "editor"],
  "active": true
}

Frequently asked questions

How do I format JSON online?

Paste your JSON above and press Beautify. The JSON formatter indents nested objects and arrays and puts each key on its own line.

Why is my JSON invalid?

Common causes are trailing commas, single quotes instead of double quotes, unquoted keys and comments. JSON doesn't allow any of these. The error message tells you where the problem is.

What's the difference between a JSON beautifier and a JSON minifier?

A beautifier adds indentation and line breaks for humans to read. A minifier removes them to make the file as small as possible.

More free formatters