TOOLTIKI Lovable tool, really free
Developer Formatting

JSON formatter

What to do
Indent

Processed in your browser · nothing is uploaded

Local · errors reported with line and column
Advertisement
320 × 100

Formats JSON with the indent you choose, and tells you exactly where it broke if it will not parse — line and column, not just "invalid".

How to use the json formatter

1 Paste your input. The result appears immediately.
2 Pick the operation you want.
3 Copy the result, or save it as a file.

Almost every rejection comes down to one of three things, and all three are valid JavaScript, which is why they slip through. A trailing comma after the last element is fine in JS and illegal in JSON. Single quotes are fine in JS and illegal in JSON — strings must use double quotes. Unquoted keys are fine in JS and illegal in JSON. Two rarer causes are worth knowing: a byte order mark at the start of a file, which is invisible and breaks the parse on the very first character, and NaN or Infinity, which JavaScript produces happily and JSON cannot represent at all.

Questions

The three usual causes are a trailing comma after the last item, single quotes instead of double, and unquoted keys. All three are valid JavaScript and none is valid JSON.

ECMA-404 — the JSON data interchange syntaxMDN — JSON.parse()
Advertisement
300 × 250
Was this tool any good?
INTERNAL SIGNAL ONLY · WE USE IT TO FIND TOOLS WORTH REBUILDING