How to Format JSON Online

JSON returned by an API or saved from a config file is often a single dense line. Formatting it adds indentation and line breaks so you can actually read the structure.

Steps to format JSON

  1. Paste the JSON into the JSON formatter.
  2. Click Format to add indentation, or Minify to remove it again.
  3. Click Validate to check the syntax without changing anything.
  4. Copy the result or download it as a file.

Common JSON mistakes

When the formatter finds a problem, it points to the line and column where parsing failed, which is usually right at or just after the actual mistake.

Format vs. minify

Formatting is for reading and editing. Minifying strips all the extra whitespace back out, producing the smallest version of the same data, useful when you're sending it over the network or storing it in a database field.

Related articles

← All guides