Developer

How to Format JSON Correctly

Read, validate and repair common JSON syntax problems.

What valid JSON looks like

JSON uses quoted property names, a colon between each name and value, and commas between entries. Strings need double quotes. Values can be strings, numbers, booleans, null, arrays or objects. Comments and trailing commas are not part of standard JSON.

A reliable workflow

Paste the data into the JSON Formatter. If it parses, use two or four spaces to make nesting visible. If it fails, read the error and inspect that area for an unclosed quote, missing comma or extra trailing comma. Format again after each fix.

  • Use indentation to see object and array boundaries.
  • Minify only when a compact payload is useful.
  • Do not share secret keys in a copied example.

Example

The object {"name":"Ada","active":true} is valid. The object {name:"Ada",} is not: the key lacks double quotes and the final comma is invalid.

Use a related tool

JSON Formatter · CSV to JSON

Related tools

CSV to JSON

Convert CSV rows and headers into JSON with quoted fields handled.

DeveloperOpen →

Related guides