JSON Formatter

Paste a JSON object, array or value to check its syntax and add indentation. Use the compact output when you need the same data on one line.

Workspace

Formatted JSON

Your result will appear here.

How to use it

  1. Paste the JSON itself, leaving out any Markdown fences or explanatory text.
  2. Choose an indentation style or select the compact format.
  3. Format the input. If you get an error, check the surrounding quotes, commas and brackets, then retry.

Worked example

Input
{"tea":"mint","cups":2}
Output
{
  "tea": "mint",
  "cups": 2
}

Frequently asked questions

Why is my JavaScript object rejected?

JSON requires double quotes around property names and strings. A trailing comma, a comment or an unquoted name will cause a syntax error.

Does minifying JSON remove spaces inside strings?

Minification removes formatting whitespace between values and punctuation. A string such as "mint tea" keeps its internal space.

Does valid JSON mean an API will accept my data?

A syntax check confirms that the data follows JSON grammar. The API can still require different field names, types or values. Compare the formatted object with its documentation.