JSON Formatter

Pretty-print JSON with indentation.

JSON Formatter parses JSON and prints it with indentation so nested objects and arrays are easy to inspect.

Input
Output

When to use JSON Formatter

  • Reading API responses
  • Cleaning config files for review
  • Comparing nested structures visually

Example

Input

{"ok":true,"items":[1,2]}

Output

{
  "ok": true,
  "items": [
    1,
    2
  ]
}

How to use

  1. Paste JSON. Invalid JSON will surface a parse error.
  2. Format. Run to pretty-print with indentation.
  3. Share readable JSON. Copy the formatted document.

Processing and limitations

Uses JSON.parse and two-space JSON.stringify output. Comments, trailing commas and single quotes are rejected. Duplicate keys retain the last value, and very large integers may lose precision; retain the original when those details matter.

Reference

Benefits

  • Free to use—no account required
  • Runs in your browser
  • Instant results with no software install
  • Basic processing does not upload your content to a server
  • Trailing commas and comments are not valid JSON and will fail parsing.

Not the same as

Only need a yes/no validity check? Use JSON Validator.

Related tools