JSON VALIDATOR AND FORMATTER

Validate, format,
and minify JSON.

Check syntax, add indentation, create a one-line version, and inspect the root type, keys, array items, depth, and UTF-8 size.

Enter any standard JSON value, including an object, array, string, number, boolean, or null.

Formatted result
Root type
Total keys
Array items
Maximum depth
UTF-8 size

HOW TO USE

Format in three steps

  1. Paste a JSON value into the input.
  2. Choose two or four spaces for indentation.
  3. Format, minify, or copy the result.

EXAMPLES

Syntax and output checks

Valid sample summary

The sample reports root object, five keys, three array items, depth two, and 88 UTF-8 bytes after compact serialization.

Trailing comma error

{"a":1,} is not standard JSON. Remove the comma before the closing brace.

Format versus minify

Two-space, four-space, and compact output preserve parsed values while changing whitespace only.

Local processing

No external API is needed to parse or format the input.

Standard browser JavaScript performs all operations on this device.

How validation works

The tool parses standard JSON in browser memory and serializes the same data structure again.

Only standard JSON is accepted

Keys and strings require double quotes. Comments, single quotes, trailing commas, JSON5, and JavaScript object syntax are not supported.

Formatting does not change values

Prettifying and minifying only change whitespace around a successfully parsed structure.

Protect sensitive and large data

Input is not sent by this page, but screen sharing and extensions are separate risks. Very large JSON can be slow on limited devices.

Scope and limitations

Only standard JSON is accepted. Comments, single quotes, trailing commas, JSON5, schema validation, and file upload are unsupported. Large or deeply nested values depend on browser memory and recursion depth, and duplicate keys receive no separate warning.

JSON formatter FAQ

Is syntax validation the same as schema validation?

No. This tool checks grammar, not required fields or semantic rules.

Why can the byte count differ from the source?

The summary measures the compact reserialized JSON, without source whitespace.

Are duplicate keys reported?

No. They follow browser JSON.parse behavior without a separate warning.

Can I upload a JSON file?

No. Paste text into the editor.