Tools

JSON formatter and validator

Pretty-print, minify and validate JSON, with the depth and node count.

Runs in your browserData formats7.2K
Free

Input

0 BFree up to 50.0 KB

Result

The result will appear here.

Your runs

Only runs that cost points are saved.

Sign in to keep a history of your runs.

Paste JSON and get it back indented, minified, or simply confirmed as valid. When it is not valid you get the parser's own message with the offending position, which is usually enough to find the trailing comma or unquoted key that caused it. The structure is measured as it is parsed, so you also see how deeply the document nests and how many nodes it holds — the two numbers that tell you whether a payload has grown a shape nobody intended.

How it works

  • Parsing and formatting happen in your browser; the document is never sent to a server.
  • Indentation is two spaces, four spaces or a tab, and minifying removes every byte that is not meaningful.
  • Depth and node counts are computed from the parsed value, not estimated from the text.

Where your data goes

Nowhere. This tool runs entirely in your browser: the text you paste is processed by the page and is never transmitted to a server or written to a log.

When a run costs points, a one-line summary is saved to your own history so you can find it again. The summary records the shape of the run — sizes, counts, the values you looked up — never the content you pasted.

What it costs

Free up to 50.0 KB per run without an account. Past that, a run costs 1 points and is saved to your history.

Points come from signing up, checking in daily, commenting and completing your profile.

See how points work

Common questions

Why does my JSON fail to parse when it looks fine?
The usual causes are a trailing comma after the last element, single quotes instead of double quotes, an unquoted key, or a stray byte-order mark at the very start. The error message names the character offset where the parser gave up, which points at the line above the real mistake more often than not.
Is my data uploaded anywhere?
No. This tool runs entirely in the page. Nothing is transmitted, and nothing is stored unless you are signed in and the run is saved to your own history, which keeps only the size and shape of the document — never its contents.
What does the depth number mean?
It is the longest chain of nested objects and arrays in the document. A configuration file that suddenly reports a depth of 12 usually means something is being serialised that was meant to stay a reference.

The open-source behind it

This tool is a self-contained implementation. json5/json5 (MIT) does the same job as a library — if you need this behaviour inside your own program, start there rather than calling a web page.

json5/json5

Also known as

  • json formatter
  • json validator
  • json beautifier
  • json minify
  • format json online
  • json parser