JSON Formatter

Format or minify JSON without changing number or string spellings. Find syntax errors by line and column, or download the result.

JSON Formatter

How to format JSON

Choose an indentation width, then select Format. Select Minify when you need a single line. Use Download JSON to save either result.

Example: Expand delivery options

Input:

{ "delivery": {"city":"Boston","options":["front door","mail room"]} }

Formatted result:

{
  "delivery": {
    "city": "Boston",
    "options": [
      "front door",
      "mail room"
    ]
  }
}

Minified result:

{"delivery":{"city":"Boston","options":["front door","mail room"]}}

When formatting fails or the result looks unexpected

A trailing comma before a closing brace, as in {"city":"Boston",}, is invalid. Check the reported line and column, remove any trailing comma, and use double quotes for keys and strings. Paste one JSON value at a time, without comments.

Values and key order stay the same. Spaces inside strings, such as in front door, are kept. This tool does not remove duplicate keys or check fields against an API schema.