ledger365

JSON formatter & validator

Paste JSON to pretty-print it with your choice of indentation, or minify it for transport. Invalid JSON gets an error message with the line number rather than a silent failure.

How to use the json formatter & validator

  1. Paste your JSON into the input.
  2. Pick an indent size — two spaces, four, or tabs.
  3. Format or minify, then copy or download the result.

How it works

Validation uses the browser's own JSON parser, so the rules are exactly those of the specification: double-quoted keys, no trailing commas, no comments, and no single quotes. When parsing fails, the character position is converted to a line number so you can go straight to the problem.

Minifying strips every space and newline outside strings. On a large API payload that routinely removes 20–30% of the bytes, which matters on mobile connections.

Common questions

Why does my JSON fail to validate?

Almost always a trailing comma, a single quote instead of a double, an unquoted key, or a comment. JSON allows none of them.

Is my data uploaded?

No. Parsing and formatting happen entirely in your browser, which makes this safe for payloads you would not want to paste into a server-side tool.

What indentation should I use?

Two spaces is the most common convention for JSON and the default here.

Related tools