JSON Formatter

Beautify, minify and validate JSON with error locations.

Your JSON is parsed and formatted locally in your browser, and nothing is uploaded to a server.

Want to explore JSON as a tree? Try the JSON Tree Viewer.

About JSON Formatter

This json formatter lets you paste raw JSON and instantly beautify, minify, or validate it without leaving the page. As a json beautifier it pretty prints with 2-space, 4-space, or tab indentation, and as a json minifier it collapses everything to a single compact line. The built-in json validator flags invalid input with the exact line and column of the first problem, so trailing commas, single quotes, and missing brackets are easy to spot. It is built for developers, QA engineers, and anyone debugging API responses, config files, or log payloads. The formatted output is syntax-highlighted and ready to copy or download. Everything runs locally in your browser, so your data never leaves your device and nothing is uploaded to a server.

Features

How to use the JSON Formatter

  1. Paste or type your JSON into the input box.
  2. Choose Prettify and pick 2-space, 4-space, or tab indentation, or choose Minify.
  3. Optionally enable Sort keys to alphabetize object keys.
  4. Review the syntax-highlighted output, or read the line and column shown for any error.
  5. Click Copy or Download to save the formatted JSON.

Example

Input

{"name":"Ada","langs":["sql","js"],"active":true}

Output

{
  "name": "Ada",
  "langs": [
    "sql",
    "js"
  ],
  "active": true
}

Beautified with 2-space indentation.

Common errors & troubleshooting

Frequently asked questions

What is the JSON Formatter and what does it do?
The JSON Formatter beautifies, minifies, and validates JSON in one place. Paste raw JSON to pretty print it with your chosen indentation, collapse it to one line, or catch syntax errors with their exact line and column.
How do I fix "Unexpected token" errors in the JSON Formatter?
The validator shows the line and column of the first problem. Common causes are trailing commas, single quotes instead of double quotes, unquoted keys, or a missing bracket.
Can the JSON Formatter sort object keys?
Yes. Turn on Sort keys in Prettify mode to alphabetically order keys at every level of the object.
How do I minify JSON with the JSON Formatter?
Choose Minify mode and the formatter collapses your JSON to a single compact line, ready to copy or download.
What indentation options does the JSON Formatter support?
You can beautify with 2-space, 4-space, or tab indentation, and the output is syntax-highlighted for readability.
Is my JSON sent anywhere when I use the JSON Formatter?
No. The JSON Formatter runs entirely in your browser, so your data never leaves your device and nothing is uploaded to a server.

Related tools

All ArrayKit tools