Start Submit a site

JSON Formatter, Validator and Minifier

Developer Tools

Paste JSON to pretty-print it, check it for syntax errors or strip every space, with byte counts before and after.

Your inputs

Browse all tools

Paste the whole document, including the outer braces.

Result

Result —
  • Input bytes — B
  • Output bytes — B
  • Size change — %
  • Keys —
  • Max nesting depth —

Change any input and the result updates instantly.

Formula and rules

  • Formatting re-serialises the parsed value with a fixed indent, so key order is kept and whitespace is normalised.
  • Minifying removes every space, tab and newline between tokens; the data itself does not change.
  • Validation parses the text and stops at the first syntax error, which is shown as an error message.
  • Keys are counted by walking objects and arrays, and the depth is the deepest object or array level.
  • Bytes are counted as UTF-8, so non-ASCII text takes more bytes than characters.

Worked examples

Format a nested object

Input {"name":"Ada","limits":{"seats":5}}

Result Two-space output spreads the object over several lines, and the same data counts 3 keys at depth 2.

Minify a formatted file

Input A pretty-printed 4 KB config.

Result Minifying usually removes 20 to 40 percent of the bytes, depending on how deep the indentation was.

A trailing comma

Input {"a":1,}

Result Validation fails with an error, because standard JSON does not allow a comma before the closing brace.

FAQ

Why does my JSON fail to parse?

The usual causes are a trailing comma, single quotes instead of double quotes, an unquoted key, or a comment. Standard JSON allows none of these.

Is minified JSON still valid?

Yes. Minifying only removes whitespace between tokens, so parsers read exactly the same value. Keep the original if you need readable diffs.

Is my JSON uploaded anywhere?

No. Parsing, formatting and minifying all run in JavaScript on your device, so keys and any secrets inside stay local.

Does formatting change key order?

No. Formatting keeps insertion order, which is what JavaScript preserves for string keys. It does change whitespace, so the first diff looks large.

Disclaimer: Results follow the formula shown on this page and are for reference only. Real-world quantities vary with materials, technique and conditions, so allow a margin before ordering.