Skip to content
UniKit

JSON Formatter & Validator

Validate and format JSON in the browser: paste to parse, re-indent with two spaces, get a clear error for malformed input, and see the top-level key count. Nothing leaves your device.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

JSON text

The textarea is the editing area: paste and it is validated and re-indented instantly. Parsing uses standard JSON.parse, so comments, single quotes, trailing commas and BOM are rejected.

Formatted JSON

Once valid, the text is re-indented with two spaces; numbers are normalised per JSON rules (1.0→1, 1e3→1000).

Paste JSON to see the formatted result

What this tool does

  • Re-indent a minified API response so the structure is readable again
  • Validate a config file before committing: trailing commas, single quotes and comments fail immediately

Example

Input

{"a":1,"b":[1,2]}

Output

{
  "a": 1,
  "b": [
    1,
    2
  ]
}

The output is JSON.parse followed by serialisation with two-space indentation.

Frequently asked questions

Is there syntax highlighting?

No. The input is a plain monospace textarea; the tool validates the text and re-indents it, without colouring keys or strings.

Will the output be byte-identical to my input?

No. Numbers are normalised (1.0 becomes 1, 1e3 becomes 1000), escape sequences become characters, duplicate keys collapse to the last one, and integer-like keys are moved to the front of the object.

Can large integers lose precision?

Yes. JSON.parse stores numbers as IEEE-754 doubles, so integers above 2^53-1 (9007199254740993 for example) are already rounded during parsing. Use strings when exact values matter.

Is JSON5 or commented config supported?

No. Comments, single quotes, trailing commas and a leading BOM all raise a parse error.

Keywords:json formatterjson validator

Related tools