Developer & Data tool

JSON Formatter & Validator

Expand compact JSON with indentation or see why an input cannot be parsed as JSON.

The tool parses and rewrites JSON; it is not a lossless editor for the original number text or key order.

Indentation
1 lines

Check the values before copying

  1. Use standard JSON

    Property names and strings need double quotes. JavaScript objects with comments or trailing commas are not valid JSON.

  2. Choose two or four spaces

    Select the indentation and run Format. Valid input is displayed with its nested structure expanded.

  3. Review the rewritten values

    Check that the properties and values you need remain intact. Long numeric identifiers are safer as strings.

Format a small object

Start with
{"name":"Alex","count":2} · two-space indentation
Check the result
The name and count properties appear on separate lines indented by two spaces.

The input is parsed and serialized. Four-space indentation changes spacing without changing these values.