JSON Viewer & Formatter

Paste JSON to pretty print it, check that it is valid, or explore it as a collapsible tree. Errors point to the exact line and column.

Format & validate JSON

Pretty print, minify or browse JSON as a tree.

Formatted JSON

Options

How to use it

  1. Paste JSON into the Input panel, open a .json file, or click Sample JSON.
  2. Click Format JSON to pretty print it with your chosen indentation, or Minify to remove all whitespace.
  3. Switch the output to Tree to expand and collapse objects and arrays, and search for any key or value.
  4. If the JSON is invalid, the message tells you what is wrong and the line is highlighted in the input.

Good to know

Large numbers stay exact
Numbers are copied exactly as written, so IDs like 12345678901234567890 are not rounded the way JavaScript would normally round them.
Strict JSON only
Comments, trailing commas, single quotes and values like NaN are not part of JSON. The validator reports them instead of silently fixing them, so you know the file will also fail in your code.
Duplicate keys
JSON allows the same key twice in one object, but most parsers keep only the last value. The formatter keeps both and warns you.

Frequently asked questions

What is a JSON formatter?

A JSON formatter (or pretty printer) adds line breaks and indentation to JSON so it is easy to read. It does not change the data — only the whitespace between values.

How do I find the error in invalid JSON?

Paste it here. The tool reports what is wrong (for example a missing comma or a trailing comma) with the line and column, and highlights that line in the editor.

What does Sort keys do?

It orders the properties of every object alphabetically. This is handy when comparing two JSON files. Array order is never changed.

Is there a size limit?

The tool handles files of several megabytes. Very large input (over 20 MB) is refused because the browser would become slow. Syntax colours switch off above about 250 KB to keep typing smooth.

Say hello

Let’s connect.

Have an idea, a project, a collaboration — or just want to say hello? I read every message.

Write to me