Developer tools · Practical tutorial
How to format JSON and identify syntax errors
Pretty-print JSON, recognise invalid structures and avoid confusing formatting with repair.
What does JSON formatting actually do?
JSON is a structured text format used by APIs, configuration files and data exchanges. A formatter can make valid JSON easier to read by adding indentation and line breaks. It does not invent missing quotation marks, decide the right values, or guarantee that the data makes sense to your application.
Use the formatter
- Open Format JSON and paste a JSON object or array, or choose an allowed text file.
- Check that property names use double quotes, strings are quoted, and braces or brackets are paired.
- Choose a comfortable indentation level (such as two spaces), run the formatter and inspect the result.
- Copy or download the output where the tool permits and re-test it in the application that consumes it.
Input: {"name":"Mira","roles":["editor","reviewer"],"active":true}
After formatting, the same object should span multiple indented lines. Keys, string values, boolean value and array order remain unchanged; only whitespace is meant to change.
Common syntax mistakes
{'name':'Mira'} is not standard JSON because single quotes cannot delimit JSON strings. A trailing comma after the last array element is also invalid. A formatter should report the problem instead of silently guessing at the intended meaning.
Common questions
Is JSON the same as JavaScript?
No. JSON resembles JavaScript object syntax but has stricter rules. Comments, functions, undefined values and unquoted property names are not allowed.
Can formatting validate the content of an API response?
Formatting helps confirm syntax, not business rules. A syntactically valid object may still be missing required fields or use an unexpected date format. Validate against the API's published schema when one is available.
Do not paste passwords, API tokens or private customer records into a tool unless you have assessed the site's processing and data-handling practices.
Put the steps into practice
The linked utility opens in your browser. Review its current on-page limits and inspect the output before sharing it.
Use JSON Formatter →