JSON Formatter

Format, minify and validate JSON for easier reading.

Paste valid JSON, format it for reading or compact it for copying. If parsing fails, correct the source and try again; the tool does not guess missing data.

Up to 100,000 UTF-16 units; some emoji use multiple units

Enable JavaScript to process content locally in your browser.

How to use

What does JSON formatting validate?

This formatter checks JSON syntax and changes whitespace outside strings. It preserves the original numeric tokens, key order and duplicate keys rather than rebuilding the result from JavaScript numbers. It does not validate an API schema or decide whether a duplicated key is acceptable.

Step by step

  1. Paste the complete JSON value, including its opening and closing braces or brackets when needed.
  2. Choose Format for readable indentation or Minify for a compact representation. Review the result before copying it into another application.
  3. On syntax errors, fix the source rather than expecting missing commas, quotes or data to be invented.

Choosing the settings

OptionWhat changes
FormatUses two-space indentation. String contents remain unchanged, including escaped spaces and line breaks.
MinifyRemoves whitespace between tokens. It is text compaction, not gzip compression or semantic deduplication.
Duplicate keys / large integersThey are retained in the output. A receiving parser may choose the last duplicate value or round a large number; check that parser separately.

Example and expected result

Format {"id":9007199254740993,"count":2,"count":3}. Expected: the integer 9007199254740993 is unchanged, both count keys remain in their original order, and only indentation and token spacing change. The duplicate count keys are valid syntax here but may be a mistake in your data contract.

If it is not working

  • The shared input limit is 100,000 UTF-16 code units. Some emoji use more than one unit. Reduce the input if it exceeds the limit; indented formatting rejects nesting deeper than 100 levels.
  • Comments, trailing commas and single-quoted strings are not JSON. Export valid JSON from the source system rather than deleting meaningful text blindly.
  • Processing runs locally and does not execute the input. Copying still places the result on your device's clipboard.

How to use

Paste valid JSON, then format or minify and copy the result. Original number precision, key order and duplicate keys are preserved. Only whitespace outside strings changes; content is never executed. Supports up to 100 nesting levels.